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 to screen 0 doesn't navigate back to previous screen

Former Member

Hi all,

I'm doing a report on ALV.

I have a selection screen at beginning, after user fill in, it will call screen 100.

In screen 100, if user double click on a row, it will call screen 200 to display further detail.

In screen 200, once user press back and return to screen 100, what is the necessary code to navigate the user back to the selection screen at the start?

I try to use "Leave to screen 0", it doesn't really work, as I have to press several time of back only can go back to the selection screen.

I try to use "Call selection-screen 1000", it navigate back to the selection screen but once I enter the select options, it will call screen 100 but nothing can displayed (ALV gone missing), in fact it doesn't route back to my "START-OF-SELECTION" point...

Any help will be deeply appreciated, if you need more info I can added the necessary code thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You may try calling your transaction code.

CALL TRANSACTION <your tcode here>.

Regards,

iostreamax

8 REPLIES 8

Former Member
0 Kudos

Hi,

You may try calling your transaction code.

CALL TRANSACTION <your tcode here>.

Regards,

iostreamax

0 Kudos

Hi Jake,

My scenario is a report program, so I can't use call transaction statement.

In fact, I have solved this one by using "SUBMIT <pro> VIA SELECTION-SCREEN".

Thanks for your help.

0 Kudos

Hi,

Ya that might have solved your problem but you have to execute your program again. Instead you could have called you selection screen itself in screen 200 when back is pressed.

Call screen 1000.

regards.

Aswath.

Former Member
0 Kudos

Hi,

What you need to do is to return back to screens as you went forward with it. For having select-options on your screen you must have created screen 100, as it navigated well by itself. Next step as per your requirement is to have user navigate to screen number 200 whenever it clicks on 1 of the row of an ALV column.

Now, for returning back you can do the following to return to screen 100 -

  • Create a push button on screen 200 and under it you need to write the logic for returning back i.e. CALL SCREEN 100 for the push button.
  • You can also create buttons on the standard toolbar, whereby you can create modules in the flow-logic of the respective screens i.e. under the PAI section write the below mentioned code -
    • MODULE exit AT EXIT-COMMAND or
    • MODULE cancel AT EXIT-COMMAND

         and under these section/s put the following code - CALL SCREEN 100

The same thing needs to be done for screen 100. You can follow the above procedure for the screen 100. Here in screen 100 you can use the command LEAVE TO SCREEN 0 at the push buttons or mention it under the buttons created in standard toolbar.

Hope this helps !

alex_campbell
Contributor

This question has already been answered but I think I have a better answer than those offered:

You have two options for navigating to other screens:

  • CALL SCREEN
  • LEAVE TO SCREEN

CALL SCREEN will simply add the screen which you are navigating to the top of the stack. If you go back, this screen will be removed from the stack, and you will return to the previous screen.

LEAVE TO SCREEN removes the current screen from the top of the stack, and adds the screen which you are navigating to the top of the stack. If you go back, this screen too will be removed from the stack, and you will return to the screen before the one you started from. Also note that LEAVE TO SCREEN 0 removes the current screen from the top of the stack, and does not add any screen to the top of the stack. This is why you return to the previous screen. It is now on the top of the stack.

If your situation, on screen 100 you should NOT use a CALL SCREEN 200, because on screen 200 if you go back, you will return to screen 100. You should instead use a LEAVE TO SCREEN 200. This way if you go back, you will return to the selection screen, because screen 100 will have been removed from the stack.

0 Kudos

Hello Alex,

Yes you sure do have a pretty good answer for the original post. It's clean, nice and well explained concept on call and leave screen.

0 Kudos

This is good explanation, Thanks Alex.

mnaghizadeh
Explorer
0 Kudos

this will solve your problem

leave to current transaction.