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: 

Leave a module to Selection screen and continue

Former Member
0 Kudos

Hello,

I have a report with selection screen (1000) and calling few more screens in sequence like 9100, 9200 and 9300. Like to know how to get to the selection screen and continue processing again 1000->9100-9200-9300.

In 9300 PAI i have written the below code

When 'BACK'

       call SELECTION-SCREEN 1000.

This indeed takes me to selection screen, but when i fill the values in selection screen variables and click execute, it is continue processing in 9300 screen and not 9100 screen.

This is the bit i am not able to fix - reaching selection scree is happening, but it is not going forward with calling the 9100 screen and so forth. any suggestions would help. thanks

5 REPLIES 5

raymond_giuseppi
Active Contributor
0 Kudos

When you use CALL SCREEN statements you are stacking the screen "screen sequence", statements to get back is SET SCREEN 0. LEAVE SCREEN. or LEAVE TO SCREEN 0.

So either you have used a LEAVE TO SCREEN to navigate to the current screen (LEAVE TO SCREEN  9300 in screen 9200 PAI) or you should pass the OK_CODE back to previous screen logic (execution will then continue in the PAI 9200 logic code wrote after the CALL SCREEN 9300) to get back til selection-screen, or you could use a shortcut as LEAVE TO CURRENT TRANSACTION if you don't care about current user input.

Screen sequence
1000
CALL SCREEN 910010009100
CALL SCREEN 9200100091009200
CALL SCREEN 93001000910092009300
LEAVE TO SCREEN 0100091009200
LEAVE TO SCREEN 010009100
LEAVE TO SCREEN 01000
CALL SCREEN 910010009100
LEAVE TO SCREEN 920010009200
LEAVE TO SCREEN 930010009300
LEAVE TO SCREEN 01000

Regards,

Raymond

0 Kudos

Also an example of wrong solution could be

Screen sequence
1000
CALL SCREEN 910010009100
CALL SCREEN 9200100091009200
CALL SCREEN 93001000910092009300
LEAVE TO SCREEN 10001000910092001000
CALL SCREEN 910010009100920010009100
CALL SCREEN 9200100091009200100091009200
CALL SCREEN 93001000910092001000910092009300
LEAVE TO SCREEN 10001000910092001000910092001000
CALL SCREEN 910010009100920010009100920010009100
CALL SCREEN 9200100091009200100091009200100091009200
CALL SCREEN 93001000910092001000910092001000910092009300

Til maximum number of  nested screen (50 dynpro sequences or nine popup level) reached and dump raised...

0 Kudos

Hi Raymond,

Thanks for the details, but still having issues. Let me explain

As per requirement, i would need to have the ability to tranverse from

1) 1000->9100->9200->9300  &  ability to travel backwards

     9300->9200->9100 for Review & modification of selection

Hence cannot use the Leave to Screen in PAI of 9200 or 9300

Only when we click on Execute button in 9300 screen, then it loads the 9400 (log output scr)

So now the flow required (Only) from 9400 is to go back to Selection screen (1000) and not 9300.

This is were i am getting struck. I tried the below as per the suggestions

In 9400 PAI under 'BACK'. added

-- Sy-ucomm = lv_back " Value as  BACK

-- Leave to screen 0. "Failed as it loaded again the 9300

-- Sy-ucomm = lv_back " Value as  BACK

-- Leave to screen 9100." Failed as it went to PBO of 9100 and loaded it

For some reason, its going to PBO and NOT PAI of the called screen. How do go to the PAI of the previous screen, so that it will leave from

9400->9300->9200->9100->1000 or

9400->9100->1000

Please suggest.

thx

AB

nishantbansal91
Active Contributor
0 Kudos

Dear AB,

Instead of calling Selection screen,

use the Set Screen 1000.

Thanks and Regards,

Nishant

prad_k
Explorer
0 Kudos

You can find much information on screen sequences at below links, Hope this helps.

Screen Sequences - ABAP Programming (BC-ABA) - SAP Library