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 on subscreen for Module pool

Former Member
0 Likes
2,552

Hi all,

I need to add some elements on standard screen of a standard transaction. Everything works fine, but the problem starts when I want to add select-option. It is displayed, but when I press on Multiple selection button no action occurs, no window appears...I simplified the case and created test program with test screen and also I get the same behaviour. Anyone had similiar problem?

Thnak you in advance for help,

Anna

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,441

I donot know how u have created the select-option. but u can try these 2 methods to create it. And I have checked that both of them work fine.

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.

Regards,

Joy.

5 REPLIES 5
Read only

GauthamV
Active Contributor
0 Likes
1,441

hi,

use ranges instead of select-options.

Read only

Former Member
0 Likes
1,442

I donot know how u have created the select-option. but u can try these 2 methods to create it. And I have checked that both of them work fine.

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.

Regards,

Joy.

Read only

Former Member
0 Likes
1,441

Hi,

Check this link...

http://www.erpgenie.com/abap/code/abap19.htm

another option you might want to try:

CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'

Will provide you with a select options screen.


Check this declaration...
---------------------------------------
SELECTION-SCREEN:
BEGIN OF TABBED BLOCK SEL_BLOCK FOR 10 LINES,
TAB (40) TEXT-T01 USER-COMMAND TAB1 DEFAULT SCREEN 1,
TAB (40) TEXT-T02 USER-COMMAND TAB2 DEFAULT SCREEN 2,
END OF BLOCK SEL_BLOCK.
*
SELECTION-SCREEN BEGIN OF SCREEN 1 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK FRM2 WITH FRAME.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 01.
PARAMETERS: R_VACANT LIKE RPLXXXXX-LIST RADIOBUTTON GROUP LIST.
SELECTION-SCREEN COMMENT 04(22) TEXT-R01.
SELECTION-SCREEN END OF LINE.
*
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 05.
PARAMETERS: C_OPEN AS CHECKBOX.
SELECTION-SCREEN COMMENT 08(22) TEXT-C01.
SELECTION-SCREEN END OF LINE.
*
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 05.
PARAMETERS: C_FILLED AS CHECKBOX.
SELECTION-SCREEN COMMENT 08(24) TEXT-C02.
SELECTION-SCREEN END OF LINE.
*
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 01.
PARAMETERS: R_NOHOLD LIKE RPLXXXXX-LIST RADIOBUTTON GROUP LIST
DEFAULT 'X'.
SELECTION-SCREEN COMMENT 04(35) TEXT-R02.
SELECTION-SCREEN END OF LINE.
*
SELECTION-SCREEN END OF BLOCK FRM2.
*
SELECTION-SCREEN END OF SCREEN 1.
*
SELECTION-SCREEN BEGIN OF SCREEN 2 AS SUBSCREEN.
INCLUDE YHRRO002TOP.
SELECTION-SCREEN END OF SCREEN 2.

Hope it would solve your issue...

Regards

Narin Nandivada

Read only

Former Member
0 Likes
1,441

thank you all of you!!!!

The problem was i didnt have CALL SUBSCREEN sentence on PAI....

Regards,

Anna

Read only

0 Likes
1,441

Anna,

Let me know which transaction you're working on. May be we can help you to find out any PAI exit.

In this case, you should built it by yourself. Try out the following function:

CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'

EXPORTING

title = text-t01

just_display = v_just_display

search_help = c_user_comp

TABLES

range = r_bname

EXCEPTIONS

no_range_tab = 1

cancelled = 2

internal_error = 3

invalid_fieldname = 4

OTHERS = 5.

Regards,

Alexandre

Edited by: Alexandre do Carmo Rocha on Jul 11, 2008 4:00 PM