Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

module pool programming " to add selection-option on screen"

Former Member
0 Kudos

I want to add selection option for a field ( matnr ) on the screen in module pool programmiing. ( how it comes in report programming). If you you know how to add Please help me to solve.....

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Sure, you need to define your selection screen as a subscreen, then embed this into your subscreen area on the dynpro. Here is a sample program.



report zrich_0006 .

tables: mara.

* Custom Selection Screen 1010
selection-screen begin of screen 1010 as subscreen.
selection-screen begin of block b1 with frame title text-001.
parameters: p_rad1 radiobutton group grp1 default 'X',
            p_rad2 radiobutton group grp1,
            p_rad3 radiobutton group grp1.
select-options: s_matnr for  mara-matnr,
                s_matkl for  mara-matkl,
                s_mtart for  mara-mtart.
selection-screen end of block b1.
selection-screen end of screen 1010.


start-of-selection.

  call screen 100.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
module status_0100 output.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

endmodule.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
module user_command_0100 input.

endmodule.


* Create Screen 100 with a subscreen area called "subscreen_1010"
* Screen Flow Logic follows

*process before output.
*
*  module status_0100.
*
*  call subscreen subscreen_1010 including sy-repid '1010'.
*
*process after input.
*
*  call subscreen subscreen_1010 .
*
*  module user_command_0100.

Regards,

Rich Heilman

Former Member
0 Kudos

HI,

You can declare a Selection sreen in the Screens, decalre it as a Subscreen and pass the Selection screen to the Subscreen ..

SELECTION-SCREEN BEGIN OF SCREEN screen_number AS SUBSCREEN NO-INTERVALS.
....
...
SELECTION-SCREEN END OF SCREEN screen_number .

http://sap.niraj.tripod.com/id40.html

see the below SAP links ...

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbabfe35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/00/deb23789e95378e10000009b38f8cf/content.htm

Regards

Sudheer

Former Member
0 Kudos

I had exactly same requirement of adding a select-option on a module pool program screen. I did so in following manner:

1) In a separate report program (lets say ZREPORT) I declared a selection-screen with a single select-option S_PERNR FOR PA0001-PERNR

2) I embedded calls to this subscreen of ZREPORT in both the PBO & PAI of my module pool screen (lets say screen 9001 of module pool ZMODULE)

By doing this, I got the select-option to appear in the defined subscreen area of screen 9001. But now I have the following problem.

How do I access the contents of S_PERNR in the flow logic of screen 9001, because as you see, S_PERNR is declared in report ZREPORT and not ZMODULE. What do I have to make data transfer of S_PERNR possible To-and-Fro screen 9001?

I declared S_PERNR (same name) as a global RANGES variable in the module pool program ZMODULE but that the automatic data transfer mechanism does not fill it.