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

Module Pool Program

Former Member
0 Likes
1,193

I have made a custom screen.

I am trying to make one of its field as select option.

How do i do that???

10 REPLIES 10
Read only

Former Member
0 Likes
864

Hii...

Seelct options do not work in module pool prgraming ...

we have to use ranges insted of select options ....

regrds

chandu reddy...

Read only

Former Member
0 Likes
864

Hi

Call your module pool program from report program .

this way you will have both selection screen and module pool output later.

regards

Read only

Former Member
0 Likes
864

hiii

Use two input text fields & to make it working like Select-Option you can write code for that input fields,Like for Low & high values..because Select-Option will not work here.Can manually enter values like in Ranges.

reward if useful

thx

twinkal

Read only

Former Member
0 Likes
864

Hi,

select-option is not possible in the module-pool.

So create 2 field in the screen.

Create a search help for that field and then we can find the search help option in the properties of the field in the module pool. Assign the search help to that particular fields in the module pool screen.

And then check the 2 fields as low and high for multiple selections.

I think it is useful for you.

Reward points if useful for you.

Thanks & regards

Deepika.

Read only

Former Member
0 Likes
864

Hi,

you cant make direclty like that.

So, do one thing.

write this code in the MAIN program.

SELECTION-SCREEN BEGIN OF SCREEN 100.

SELECT-OPTIONS : EBELN FOR V_EBELN MODIF ID G1,

VBELN FOR V_VBELN MODIF ID G2.

SELECTION-SCREEN END OF SCREEN 100 .

in The PAI of your Module Pool screen,

write :

call selection-screen 100.

this way you can achieve.

Regards

Sandeep Reddy

Read only

Former Member
0 Likes
864

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.

Read only

Former Member
0 Likes
864

Hi,

We can not create the Select-Options in module pool program.

Use RANGES to resemble like select-options on the screen as below.

TABLES KNA1.

RANGES: R_KUNNR FOR KNA1-KUNNR.

R_KUNNR-LOW to R_KUNNR-HIGH (put the fields on the screen

like this and fill the ranges with OPTION and SIGN and use in SELECT query as per your requirement)

Read only

Former Member
0 Likes
864

Hi,

Create a sub screen on a custom screen. Design a selection screen in your program as subscreen ( syntax: SELECTION-SCREEN BEGIN OF SCREEN <SCRNUMBER> AS SUBSCREEN, define the fields with select-options same is in your report. SELECTION-SCREEN END OF SCREEN <SCRNUMBER> )

Call this subscreen<SCRNUMBER> in above created custom screen subscreen area.

Let me know if you have any questions.

Thanks,

Rajinikanth

Read only

Former Member
0 Likes
864

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.

Read only

Former Member
0 Likes
864

Thanks a lot ..... My problem is solved.