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

Select option in module pool program

former_member207480
Participant
0 Likes
3,668

Hi,

Is there any method to create select option functionality in module pool programming?

8 REPLIES 8
Read only

former_member212148
Participant
0 Likes
2,425

This message was moderated.

Read only

former_member187748
Active Contributor
0 Likes
2,425

Hi ,

you can create a select option in module pool, and for this you have to create a subscreen area

where you can define your select options.

Create a subscreen area in module pool, say its screen no. is 9000, and give it a name say NAME.

Write your logic as shown below

SELECTION-SCREEN BEGIN OF SCREEN 9000 AS SUBSCREEN.
PARAMETERS : p_werks TYPE ekpo-werks .
SELECT-OPTIONS : s_ebeln FOR ekpo-ebeln.
SELECTION-SCREEN END OF SCREEN 9000 .


In the PBO of the screen , you have to call your screen.


Please search, you will get some useful links.



Read only

Former Member
0 Likes
2,425

Hi Amol,

We can create select option in the module pool program in the below way,

1. create a screen ( say 2000 )

2. go to the screen( 2000 ) layout and drag a subscreen area and name it ( say sel ).

3. write code to call subscreen in the both PBO and PAI modules.


Here is sample code.


REPORT  ZSELECT_OPTIONS_MOD_1.

tables kna1.

SELECTION-SCREEN BEGIN OF SCREEN 100 as SUBSCREEN.

  select-OPTIONS : s_kunnr for kna1-kunnr.

SELECTION-SCREEN END OF SCREEN 100.

START-OF-SELECTION.

call SCREEN 2000.

must write call subscreen statement in both PBO and PAI modules as below


Hope this helps you.


Regards

Deeksha


Read only

0 Likes
2,425

It gives the error message as below.

Runtime Errors         DYNP_WRONG_SCREEN_TYPE

Date and Time          17.02.2014 08:30:41

Short text

     Incorrect screen type: Screen is incorrectly defined or used.

What happened?

     The attribute screen type with the values 'Normal Screen' and

     'Subscreen' determines the use of the screen. If a normal screen is used

      as subscreen or vice versa, an error occurs.

     The screen "ZSD_EXC_FORM" 9000 has, in this respect, an inappropriate screen

      type.

Read only

0 Likes
2,425

Hi,

Now I want to save some of the fields from report output and I am using

FORM user_command1 USING ucomm    TYPE sy-ucomm

                                                              selfield TYPE slis_selfield.

but, it saves only last record instead of all.

Please suggest the same.

Read only

Former Member
0 Likes
2,425

Hi Amol,

You can use function modules COMPLEX_SELECTIONS_DIALOG and FREE_SELECTIONS_DIALOG for that or define a selection screen and call it as a popup window.

Cheers,

Andy

Read only

former_member207480
Participant
0 Likes
2,425

Thanks

It is working now.

But, How can i provide process on value request for selection screen parameters.

Read only

Former Member
0 Likes
2,425

Hi,

In order to add F4 help to a field in modeule pool follow these steps:-

1. First go to SE11 and create your own search help

2. Now in your module pool program program go to the layout of your screen.

3. Now when you see the attributes of this field in the Dict tab you will find the field Search Help. Now here you can specify the name of the search help you created in SE11.

check this link F4 help in module pool porgramming | SCN