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: 

AT SELECTION-SCREEN ON VALUE-REQUEST with SUBSCREEN

Former Member
0 Kudos

I am calling a subscreen from the <b>AT SELECTION-SCREEN ON VALUE-REQUEST</b> event. The select-option defined on the subscreen will not show the "Multiple Selections" pop-up to allow more entries (single values, ranges, etc). The "Multiple Selections" pushbutton shows on screen 100 but it does not correctly show the pop-up to add more entries. Any help is appreciated.

<b>Example program: </b>

REPORT zcaltest .

TABLES: z9snt.

select-options s_test for z9snt-cdate no intervals.

SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT (10) text-001.

SELECT-OPTIONS: s_srlnr FOR z9snt-srlnr.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF SCREEN 300.

AT SELECTION-SCREEN OUTPUT.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_test-low.

CALL SCREEN 100 STARTING AT 5 5

ENDING AT 80 12.

AT SELECTION-SCREEN.

************************************************************************************

  • Screen 100 Flow Logic - subscreen AREA defined on screen 100

************************************************************************************

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

call subscreen area including sy-repid '300'.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0100.

call subscreen area.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try using the FM F4IF_INT_TABLE_VALUE_REQUEST..

TABLES: T005T.

DATA: BEGIN OF t_t005 OCCURS 0,

land1 TYPE t005-land1,

END OF t_t005.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(6) v_text FOR FIELD P_LAND1.

PARAMETERS: p_land1 TYPE t005-land1.

SELECTION-SCREEN COMMENT 13(35) v_text1.

SELECTION-SCREEN END OF LINE.

INITIALIZATION.

v_text = 'Country'.

v_text1 = ' '.

AT SELECTION-SCREEN OUTPUT.

IF NOT p_land1 IS INITIAL.

SELECT SINGLE * FROM t005t

WHERE spras = sy-langu

AND land1 = p_land1.

IF sy-subrc = 0.

v_text1 = t005t-landx.

ENDIF.

ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_land1.

REFRESH: t_t005.

SELECT land1

INTO TABLE t_t005

FROM t005.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = 'T005'

PVALKEY = ' '

retfield = 'LAND1'

dynpprog = sy-repid

DYNPNR = sy-dynnr

dynprofield = 'P_LAND1'

callback_program = sy-repid

value_org = 'S'

TABLES

value_tab = t_t005

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Thanks,

Naren

6 REPLIES 6

Former Member
0 Kudos

Hi,

Try using the FM F4IF_INT_TABLE_VALUE_REQUEST..

TABLES: T005T.

DATA: BEGIN OF t_t005 OCCURS 0,

land1 TYPE t005-land1,

END OF t_t005.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(6) v_text FOR FIELD P_LAND1.

PARAMETERS: p_land1 TYPE t005-land1.

SELECTION-SCREEN COMMENT 13(35) v_text1.

SELECTION-SCREEN END OF LINE.

INITIALIZATION.

v_text = 'Country'.

v_text1 = ' '.

AT SELECTION-SCREEN OUTPUT.

IF NOT p_land1 IS INITIAL.

SELECT SINGLE * FROM t005t

WHERE spras = sy-langu

AND land1 = p_land1.

IF sy-subrc = 0.

v_text1 = t005t-landx.

ENDIF.

ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_land1.

REFRESH: t_t005.

SELECT land1

INTO TABLE t_t005

FROM t005.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = 'T005'

PVALKEY = ' '

retfield = 'LAND1'

dynpprog = sy-repid

DYNPNR = sy-dynnr

dynprofield = 'P_LAND1'

callback_program = sy-repid

value_org = 'S'

TABLES

value_tab = t_t005

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Thanks,

Naren

0 Kudos

Exactly what I was looking for.

Thanks,

Ali

sourabhshah
Advisor
Advisor
0 Kudos

hi,

Defining Input Help

If an input field declared in an executable program refers to a field in the ABAP Dictionary for which possible entries help is defined, the list of values from the Dictionary is automatically displayed when the user calls the F4 help for that field. To create possible values help for report input fields that have no Dictionary reference, or to override the Dictionary input help linked to the field, you can create an event block for the event (see also Search Help for Parameters),

AT SELECTION-SCREEN ON VALUE-REQUEST FOR field

The event is triggered when the user calls the F4 help for the field field. If no corresponding event block has been defined, no possible values help or values list from the Dictionary is displayed. If a corresponding event block exists, it takes precedence over the default possible values help mechanism. It is then up to the programmer to ensure in the event block that an appropriate list of values is displayed, and that the user can choose a value from it.

No event block AT SELECTION-SCREEN ON VALUE-REQUEST can be created for input fields on the selection screen that are declared within the logical database used. You cannot override the input help mechanism of the logical database within the executable program. You can define separate help within the logical database program using the VALUE-REQUEST option in the PARAMETERS and SELECT-OPTIONSstatements.

REPORT demo_selection_screen_f4.

PARAMETERS: p_carr_1 TYPE spfli-carrid,

p_carr_2 TYPE spfli-carrid.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carr_2.

CALL SCREEN 100 STARTING AT 10 5

ENDING AT 50 10.

MODULE value_list OUTPUT.

SUPPRESS DIALOG.

LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.

SET PF-STATUS space.

NEW-PAGE NO-TITLE.

WRITE 'Star Alliance' COLOR COL_HEADING.

ULINE.

p_carr_2 = 'AC '.

WRITE: / p_carr_2 COLOR COL_KEY, 'Air Canada'.

HIDE p_carr_2.

p_carr_2 = 'LH '.

WRITE: / p_carr_2 COLOR COL_KEY, 'Lufthansa'.

HIDE p_carr_2.

p_carr_2 = 'SAS'.

WRITE: / p_carr_2 COLOR COL_KEY, 'SAS'.

HIDE p_carr_2.

p_carr_2 = 'THA'.

WRITE: / p_carr_2 COLOR COL_KEY, 'Thai International'.

HIDE p_carr_2.

p_carr_2 = 'UA '.

WRITE: / p_carr_2 COLOR COL_KEY, 'United Airlines'.

HIDE p_carr_2.

CLEAR p_carr_2.

ENDMODULE.

AT LINE-SELECTION.

CHECK NOT p_carr_2 IS INITIAL.

LEAVE TO SCREEN 0.

This program declares a selection screen with two parameters that both refer to the column CARRID of the SPFLI database table. While the Dictionary input help is used for p_carr_1, no special input help is programmed for p_carr_2. Screen 100 is used for the possible entries help. In the flow logic, the dialog module value_list is started at the time of PBO. The actual screen mask 100 is not required, and there are no dialog modules used in the PAI.

PROCESS BEFORE OUTPUT.

MODULE value_list.

PROCESS AFTER INPUT.

The dialog module value_list suppresses the screen 100 and switches to list processing. The list contains values for the parameter p_carr_2. These values are also placed in the HIDE area. When the user selects a line from the value list, the AT LINE-SELECTION event is triggered, and the selected value is transferred from the HIDE area into the field p_carr_2. If the user selects a valid line, the system switches directly from the event block AT LINE-SELECTION back to the selection screen, and fills the corresponding input field.

Regards,

Sourabh

Former Member
0 Kudos

Thanks for the replies. CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' won't work in this case... I don't need a possible entries list.

The issue is I have a subscreen called from the AT SELECTION-SCREEN ON VALUE-REQUEST event which contains a select option. After displaying the subscreen, I attempt to select the "Multiple Selections" for the select option but it does not issue the pop which allows the user to INPUT a list or range of entries.

Any help is appreciated.

Former Member
0 Kudos

Still no luck. Any other suggestions??