Application Development and Automation 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: 
Read only

how to create select-options in module pool program

Former Member
0 Likes
1,658

Hi

i am structed at this point could you please tell me

how to create select-options in module pool program

8 REPLIES 8
Read only

Former Member
0 Likes
1,151

Hi,

Check the following link, you can find lots of examples.

[]

Regards,

Vik

Read only

Former Member
0 Likes
1,151

Hi

In TOP include u need to define a SELECTION-SCREEN using SELECTION-SCREEN statament:

SELECTION-SCREEN BEGIN OF SCREEN <screen number>.
SELECT-OPTIONS: S_SELOPT FOR .........
PARAMETERS: PARAM LIKE ...............
SELECTION-SCREEN END OF SCREEN.

In a module of PBO or PAI (that depends on your logic) u can call that screen using statament CALL SELECTION-SCREEN

Max

Read only

MarcinPciak
Active Contributor
0 Likes
1,151

Alternatively to what Max have suggested you can include select-options to screen as subscreen.

This just give a bit more flexibility as you only define select-options as subscreen, the rest of the parameters are defined directly on screen layout.

Refer [Select-options in module pool screen|http://sample-code-abap.blogspot.com/2008/06/select-option-in-module-pool-screen.html]

Regards

Marcin

Read only

Former Member
0 Likes
1,151

Hi,

Try using the function module COMPLEX_SELECTIONS_DIALOG. Create a variable of type rstabfield. Say you need to create select option for the field vbeln from table vbap, then define the structure tab (type rstabfield) and tab-fieldname = 'VBELN' and tab-tablename = 'VBAP'. Pass this to the parameter tab_and_field of the function module. Create a range say r_vbeln and paa it to the tables parameter range. The defined range will have the values you entered and you can read the table to access the values.

Hope this helps.

Regards,

Sachin

Read only

venkat_o
Active Contributor
0 Likes
1,151

Steps to get SELECT-OPTIONS in module pool programs. <li>. Start one dialog program with SAPZ_TEST. <li>. Place the below code in the TOP include of the dialog program.


PROGRAM SAPMZ_TEST.
TABLES mara.
SELECTION-SCREEN BEGIN OF SCREEN 2100 AS SUBSCREEN.
SELECT-OPTIONS: matnr FOR mara-matnr.
SELECTION-SCREEN END OF SCREEN 2100.
<li>. Create one screen 2000 . <li>. Go to Layout of the screen and Define subscreen area on the screen and Name it as g_subscreen. <li>. Place the below code in the Flow logic of the screen.
PROCESS BEFORE OUTPUT.
  CALL SUBSCREEN g_subscreen INCLUDING 'SAPMZ_TEST' '2100'.
 
PROCESS AFTER INPUT.
  CALL SUBSCREEN g_subscreen.
<li>. Activate all. <li>. Create Transaction code for the dialog program SAPZ_TEST. <li>. Execute the transaction code. You will see the select-option like we see on Selection-screen. I hope that it gets u clear idea. Thanks Venkat.O

Read only

Former Member
0 Likes
1,151

SELECTION-SCREEN BEGIN OF SCREEN <screen number>.

USE SELECT-OPTIONS HERE

SELECTION-SCREEN END OF SCREEN.

Regards,

Vijay

Read only

Former Member
0 Likes
1,151

hi ctr.raj1,

you can use of the FM : COMPLEX_SELECTIONS_DIALOG to make select options in a module pool program.

Please check this link it might solve your problem.

Regards

Saurabh Goel

Read only

sreekanthgo
Contributor
0 Likes
1,151

Hi,

Here is another [LINK|http://sample-code-abap.blogspot.com/2008/06/select-option-in-module-pool-screen.html].

Hope it helps.

Thanks,

Sreekanth