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

Screen Call Stack

auntieweirdo
Explorer
0 Likes
2,804

I have the following scenario (Old-fashioned ABAP Dialog programming):

Main overview screen number: 200. User presses a button to create a new transaction. This takes them to screen 300. They fill in the details in 300, and then the system takes them to screen 400 to finalise and confirm that they want to save the data. In screen 400, they HAVE to have the ability to go back to 300 and amend the details if they don't like what is shown to them in 400 (So we can't LEAVE to 400 from 300). Once they are happy with the data shown in screen 400, they can save it. Then the program takes them back to the overview screen (200). It would make no sense to take them back via 300.

Problem is: Because we have to have 'CALL SCREEN' for going to 300 and 400 (as we need to be able to go back to them), and from 400 we LEAVE TO 200 and not back via 300, if the procedure is called multiple times, all of these 300 and 400 screens stay in the stack. This can result in the LIST_TOO_MANY_LPROS dump. How do I avoid keeping screens 300 and 400 in the stack when they really don't need to be there once user has done what they need to do?

Alternatively, is there a way to read the actual SCREENS in the callstack (as opposed to programs/subroutines etc)? Function Module SYSTEM_CALLSTACK does not return the screens, it only shows programs/function modules/methods etc. I tried using class CL_TBDA_CTRL_HANDLER (and others in the confusing nest of similarly-named classes!) but it threw me right out of the SAP session! If I can get the screens somehow, I can at least then read how many there are and warn the user rather than having an inelegant shortdump.

Any suggestions for a straightforward and robust way to handle this please? Thanks.

1 ACCEPTED SOLUTION
Read only

0 Likes
2,349

Julia,

Most of the complex screen based SAP transaction, MM01/02, use configuration table to move from one screen to another. They mainly use Leave to screen ### to directly move to the screen. As you have only one screen to move, no need to use table. But you can use that technique of Leave to screen to resolve your issue easily.

4 REPLIES 4
Read only

Sandra_Rossi
Active Contributor
2,349

There are two ways to go to another screen: SET SCREEN or CALL SCREEN. CALL SCREEN is more constraining because the code will always return after CALL SCREEN, while SET SCREEN just defines the next screen.

Not sure why you say you "have to" use CALL SCREEN for going to 300 and 400...

200 -> 300 -> 400
  ↖______↖____↙

From 200, you can use SET SCREEN 300, from 300 you can use SET SCREEN 400, and from 400 you can use SET SCREEN 300 or SET SCREEN 200 as you wish.

Read only

0 Likes
2,350

Julia,

Most of the complex screen based SAP transaction, MM01/02, use configuration table to move from one screen to another. They mainly use Leave to screen ### to directly move to the screen. As you have only one screen to move, no need to use table. But you can use that technique of Leave to screen to resolve your issue easily.

Read only

0 Likes
2,349

Many thanks, that worked. I just had to be careful about ensuring that navigations in the target screens were set correctly. Working beautifully now!

Read only

auntieweirdo
Explorer
2,349

sandra.rossi - thank-you also. Great explanation. I could't mark your comment as an answer as it was entered as a comment only. But I would like to say thank-you!