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: 

How to creat select-option on module pool screen???

Former Member
0 Kudos

Hi All,

please tell me how to creat select-option on module pool screen???

Regards

Deepak

1 ACCEPTED SOLUTION

former_member387317
Active Contributor
0 Kudos

Hi Deepak Kumar Sharma,

There are Two ways to achieve it...

1) How to create a select-options in a module pool screen.

Method 1

-


a) Create a subscreen area in your screen layout where you want to create the select options.

b) In the top include of your module pool program declare a selection screen as a subscreen e.g.

SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
select-options s_matnr for mara-matnr.
SELECTION-SCREEN END OF SCREEN.

c) In the PBO and PAI of the main screen where the select options needs to be created do a call subscreen of the above screen (100).

CALL SUBCREEN sub_area INCLUDING <program> <screen>

This call subscreen statement is necessary for transport of values between screen and program.

Note: All validations of the selection screen fields e.g. the s_matnr field created above should be done in selection screen events like AT SELECTION-SCREEN etc and not in PAI. These selection screen validations etc should be done in the top include only.

Method 2

-


a) Create 2 separate fields in your screen layout - one for the low value and one for the high value. Insert an icon beside the high value which will call the multiple selections popup screen on user command. Use function module COMPLEX_SELECTIONS_DIALOG to achieve this.

struc_tab_and_field-fieldname = con_cust. " 'KUNNR'
struc_tab_and_field-tablename = con_kna1. " 'KNA1'.

CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
EXPORTING

TITLE = ' ' 
text = g_titl1 " 'Customers'
tab_and_field = struc_tab_and_field
TABLES
RANGE = rng_kunnr
EXCEPTIONS
NO_RANGE_TAB = 1
CANCELLED = 2
INTERNAL_ERROR = 3
INVALID_FIELDNAME = 4
OTHERS = 5.

IF NOT rng_kunnr[] IS INITIAL.

Read the very first entry of the range table and pass it to 
dynpro screen field 
READ TABLE rng_kunnr INDEX 1.
IF sy-subrc = 0.
g_cust = rng_kunnr-low.
ENDIF.

You can use the return table rng_kunnr to populate your own internal range table with the values entered by the user. Basically here you are just simulating the work of a select-options parameter by module pool screen elements.

Also have a look on below threads

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

11 REPLIES 11

former_member262988
Active Contributor
0 Kudos

Hi ,

create a screen for the module pool program

go to layout create an field on screen for lower limiet and also another for upper limit .

ex: matnr_low

matnr_high.

now inthe code onsider the values enterd on the screen and write the logic..

reward points if useful..

Former Member
0 Kudos

Hi

REPORT zreport .

TABLES : ekko , ekpo .

SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.

PARAMETERS : p_bukrs TYPE ekko-bukrs OBLIGATORY DEFAULT '1000'.

SELECT-OPTIONS : s_ebeln FOR ekko-ebeln ,

s_ebelp FOR ekpo-ebelp .

SELECTION-SCREEN END OF SCREEN 300 .

START-OF-SELECTION .

CALL SCREEN 100 .

&----


*& Module status_0100 OUTPUT

&----


MODULE status_0100 OUTPUT.

SET PF-STATUS 'ZPF01' .

SET TITLEBAR 'ZTITLE01' .

ENDMODULE. " status_0100 OUTPUT

&----


*& Module user_command_0100 INPUT

&----


MODULE user_command_0100 INPUT.

IF sy-ucomm = 'BACK' OR sy-ucomm = 'EXIT' .

LEAVE TO SCREEN 0 .

ENDIF.

ENDMODULE. " user_command_0100 INPUT

Regards

Divya

Former Member
0 Kudos

Hi Deepak,

Check this link it give you complete refenence of select-option on module pool screen with good example.

http://sample-code-abap.blogspot.com/2008/06/select-option-in-module-pool-screen.html

Regards,

Sowmya

Former Member
0 Kudos

Former Member
0 Kudos

Hi,

In module-pool u can't get like select-options.

u can use two variables like from and to.

in select statment u can use WHERE BETWEEN <VAR1> AND <VAR2>

Former Member
0 Kudos

Hi

Follow this sequence of steps.

Also define PF status and title bar with names 'ZPF01' and 'ZTITLE01' respectively. This is not shown in any screen shot.

Step 3 : Put code in PBO and PA1 of screen as shown in below screen shot.

http://sample-code-abap.blogspot.com/2008/06/select-option-in-module-pool-screen.html

Activate all objects and execute the report you should get following module pool screen with select-options.

see the above link for further references..

reward if useful

Regards

Divya

0 Kudos

Hi,

just try this one.

u already drag the input field from particular table . which is in screen painter.

now just drag the one more input field and place it to beside previous one.

in select quiry where condition .

where kunnr between s_kunnr-low and s_kunnr-high.

regards.

sriram.

Former Member
0 Kudos

Hi Deepak.

Please, Refer to this link about select-option on module pool screen:

[select-option on module pool screen|;

Hope this will help.

Good luck & Regards.

Harsh Dave

Edited by: Harsh Dave on Jul 11, 2008 2:05 PM

asik_shameem
Active Contributor
0 Kudos

Hi,

Best option is to go for a report program

If still you need to go for module pool there is one solution.

1. Define a subscreen on ur screen.

2. Define The screen as we do in report program but with addition 'AS SUBSCREEN' .

3.call the subscreen in ur flow logic of main screen.

Following code may help.

define this in ur top include.

SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECT-OPTIONS:
                s_vkorg1  FOR zadvhead-vkorg  NO-EXTENSION NO INTERVALS,
SELECTION-SCREEN END OF SCREEN 200.

in screen flow logic

PROCESS BEFORE OUTPUT.
CALL SUBSCREEN subscr_is1 INCLUDING sy-repid dynnr_is1.
"dynnr_is1 = 0200 & subscr_is1 = subscreen area name
 
PROCESS AFTER INPUT.
 CALL SUBSCREEN subscr_is1.

former_member387317
Active Contributor
0 Kudos

Hi Deepak Kumar Sharma,

There are Two ways to achieve it...

1) How to create a select-options in a module pool screen.

Method 1

-


a) Create a subscreen area in your screen layout where you want to create the select options.

b) In the top include of your module pool program declare a selection screen as a subscreen e.g.

SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
select-options s_matnr for mara-matnr.
SELECTION-SCREEN END OF SCREEN.

c) In the PBO and PAI of the main screen where the select options needs to be created do a call subscreen of the above screen (100).

CALL SUBCREEN sub_area INCLUDING <program> <screen>

This call subscreen statement is necessary for transport of values between screen and program.

Note: All validations of the selection screen fields e.g. the s_matnr field created above should be done in selection screen events like AT SELECTION-SCREEN etc and not in PAI. These selection screen validations etc should be done in the top include only.

Method 2

-


a) Create 2 separate fields in your screen layout - one for the low value and one for the high value. Insert an icon beside the high value which will call the multiple selections popup screen on user command. Use function module COMPLEX_SELECTIONS_DIALOG to achieve this.

struc_tab_and_field-fieldname = con_cust. " 'KUNNR'
struc_tab_and_field-tablename = con_kna1. " 'KNA1'.

CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
EXPORTING

TITLE = ' ' 
text = g_titl1 " 'Customers'
tab_and_field = struc_tab_and_field
TABLES
RANGE = rng_kunnr
EXCEPTIONS
NO_RANGE_TAB = 1
CANCELLED = 2
INTERNAL_ERROR = 3
INVALID_FIELDNAME = 4
OTHERS = 5.

IF NOT rng_kunnr[] IS INITIAL.

Read the very first entry of the range table and pass it to 
dynpro screen field 
READ TABLE rng_kunnr INDEX 1.
IF sy-subrc = 0.
g_cust = rng_kunnr-low.
ENDIF.

You can use the return table rng_kunnr to populate your own internal range table with the values entered by the user. Basically here you are just simulating the work of a select-options parameter by module pool screen elements.

Also have a look on below threads

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

0 Kudos

Hi ilesh ,
I want to go with your 2nd method, So can you please elaborate at which include/PBO/PAI what we have to write and one more point how to create that multiple option icon and how proceed with that fm?
It will help number of peoples.
Thanks a lot in advance.