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

Multiple Selection-Screen Issue

Former Member
0 Likes
1,439

Hello everyone,

I am creating a program that is prompting the user to either enter inputs, or reference a file that has inputs. When I use the below code, the program creates a begin screen that prompts the user, then correctly navigates to the manual / file input reference. The issue comes when the user inputs the information then clicks execute, the program does not process, but when you click (F3) back, the program processes.

*&---------------------------------------------------------------------*
*& SELECT-OPTIONS & PARAMETER DECLARATION
*&---------------------------------------------------------------------*
parameters: rb1 RADIOBUTTON GROUP ab,
rb2 RADIOBUTTON GROUP ab.

selection-screen begin of screen 100 title TEXT-T03.
parameters: P_BUKRS like PAYR-ZBUKR obligatory,
P_HBKID like PAYR-HBKID obligatory.
select-options P_HKTID for PAYR-HKTID.

selection-screen end of screen 100.

selection-screen begin of screen 200.
parameters: P_FNAME type STRING obligatory.

selection-screen end of screen 200.

at SELECTION-SCREEN.
if rb1 = 'X'.
call SELECTION-SCREEN 100.
perform GET_CHECKS_FOR_YEAR.
perform FIND_KUKEY.
perform FIND_OPEN_CHECKS.
perform UPDATE_OPEN_CHECKS.
else.
call SELECTION-SCREEN 200.
perform READ_UNIX_FILE.
endif.

end-of-selection.

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,059

Be careful, AT SELECTION-SCREEN is called after input for any of the 3 selection screens (1000, 0100, 0200). You should test the system variable SY-DYNNR (screen number) to decide which code to run.

4 REPLIES 4
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,060

Be careful, AT SELECTION-SCREEN is called after input for any of the 3 selection screens (1000, 0100, 0200). You should test the system variable SY-DYNNR (screen number) to decide which code to run.

Read only

Former Member
0 Likes
1,059

Thank you, Sandra. I updated to the code below and it looks to work properly now.

*&---------------------------------------------------------------------*
*& SELECT-OPTIONS & PARAMETER DECLARATION
*&---------------------------------------------------------------------*
parameters: rb1 RADIOBUTTON GROUP ab,
rb2 RADIOBUTTON GROUP ab.

selection-screen begin of screen 100 title TEXT-T03.
parameters: P_BUKRS like PAYR-ZBUKR obligatory,
P_HBKID like PAYR-HBKID obligatory.
select-options P_HKTID for PAYR-HKTID.

selection-screen end of screen 100.

selection-screen begin of screen 200.
parameters: P_FNAME type STRING obligatory.

selection-screen end of screen 200.

start-of-selection.

if SY-DYNNR EQ 1000.
if rb1 = 'X'.
call SELECTION-SCREEN 100.
perform GET_CHECKS_FOR_YEAR.
perform FIND_KUKEY.
perform FIND_OPEN_CHECKS.
perform UPDATE_OPEN_CHECKS.
else.
call SELECTION-SCREEN 200.
PERFORM READ_UNIX_FILE.
endif.
endif.

end-of-selection.

Read only

0 Likes
1,059

You don't need anymore SY-DYNNR because your code is in event START-OF-SELECTION (SY-DYNNR is to be used only in events AT SELECTION-SCREEN).

Moreover, the event END-OF-SELECTION is not needed as it doesn't contain any code (and it's usually only for the obsolete "logical databases").

Read only

Former Member
1,059

Or, hide the fields dependant on the value of the radio buttons. Then on the at selection screen output event, either activate or deactivate the fields. that is a lot simpler than having to handle sub screens and the like. You then end up with a standard report and making decisions based upon parameters rather than screen numbers.


Rich