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: 

CALL SCREEN

Former Member
0 Kudos

I am writing my first dialog program. I'm about 95% done. It consists of 10 different normal/dialog screens. It's working fine. I get to the screens that I want to go to and come back to the previous screen and even end the program normally. I just found out now, when I was doing a major test on it that it is bombing out. Since I've been using the CALL SCREEN command to go from 1 screen to the next, i'm getting this error "You requested too many consecutive nested call screens". This is not good, this program is needed by next week! I am having problems using the LEAVE TO SCREEN command that's why I have been using the CALL SCREEN to go back and forth different screens.

How do I fix this problem? Is there a command to close the screen or delete the nested call without me using the leave command? I tried setting the screen to 0 before issuing a call screen, that does not work. Please help!

Thanks in advance.

5 REPLIES 5

ssimsekler
Active Contributor
0 Kudos

Hi!

This is the runtime error "DYNP_TOO_MANY_CALL_SCREENS". The maximum number of nested screen levels is restricted to 50 at present. So, you must program your screen chain yourself. I think, you must use "LEAVE TO SCREEN <scr>" and use some global variables to control screen transitions.

*--Serdar

Former Member
0 Kudos

Hallo SAPHELP,

Serdar is right that CALL SCREEN is limited to 50 repeats. LEAVE TO SCREEN nn would work though and, as far as I'm aware, there are no global fields that would have to be altered. Perhaps it yould be easier to try and use this command. What problems were you having with it?

Gerard.

ssimsekler
Active Contributor
0 Kudos

Hi!

I didn't try but I think, if there is some complicated transition algorithm (Only a program having just simple forward navigation will not suffer); using merely "LEAVE TO SCREEN..." won't be enough since then the screen instances are not cascaded. That's why, one must handle his own screen chain stack to control screen transitions if number of his screens exceeds 50 since he is restricted to use "LEAVE TO SCREEN" instead of "CALL SCREEN". By a global variable, I meant a program variable of a global lifecycle not a system variable.

To illustrate;

<i>[Assuming we have more than 50 screens and we normally have a complicated navigation procedure among our screens]</i>

Screen #100:

...

CALL SCREEN 200 .

*==> This processes screen 200 where still instance of screen 100 is active.

Screen #200:

...

LEAVE TO SCREEN 300 ." Assume I am restricted to use 'LEAVE...'

*==> This <u>leaves</u> screen 200 and processes screen 300.

Screen #300:

...

*Here is the critical point:

LEAVE TO SCREEN 0 .

*==> Here, although "0" means a 'BACK', the next screen will be '100', not '200'.

Q: Is it a solution to use "LEAVE TO SCREEN 200"?

A: No. Because, I have a complicated navigation and don't know from which screen I came to screen 300.

Solution: I should use my own stack (defined globally) to handle my screen navigation history.

However, if your navigation algorithm is so simple, then of course just "LEAVE TO SCREEN..." will be enough. <b>But the best will be splitting our whole process into subprocesses so that less than 50 screens can do an independent job.</b>

I am so garrulous today. Sorry if I've disturbed...

*--Serdar

Former Member
0 Kudos

Hi saphelp,

All that Gerard and Serdar have said is true. There's just one small point that I want to direct your attention to.

You said that in your program you have just 10 screens. So the limitation of 50 screens in a call sequence should not ideally be a bother for you. Be very judicious in your usage of the statements "CALL SCREEN nnnn" and "LEAVE TO SCREEN nnnn". If you use one for the other, you will find it next to impossible to keep track of the various call sequences. Furthermore, rigorous testing will uncover a lot of issues related to left over data on the screen and other navigational problems.

Whenever you CALL a screen, the ABAP code for the back button on the next screen should almost always be "LEAVE TO SCREEN 0". This will bring you to the statement immediately following the CALL SCREEN statement. It also ends the screen sequence that you have initiated using the CALL SCREEN statement.

You have also said that you have had problems using the "LEAVE TO SCREEN nnnn" option. As such, you might had a problem with <i><b>a few instances</b></i> of "LEAVE TO SCREEN nnnn" in which case you have used the "CALL SCREEN nnnn" to meet the requirement. But I guess you have used the same statement <i><b>for all instances</b></i> of "LEAVE TO SCREEN". If that's the case, please re-check all the screen sequences and understand where you need to use which option.

Lastly, you have mentioned that you tried setting the screen to 0 before issuing a CALL SCREEN statement. I'm not sure that's quite right, at least in your case. You will have to set the screen to 0 when you want to end the screen sequence that is initiated by a "CALL SCREEN nnnn" statement - for example, like I said, for the BACK button for the called screen.

Get back if you have any moe doubts on this one. Since you say that you are a beginner, I tell you, it is very important that you understand these two statement perfectly, which goes a long way into your understanding of many of the SAP Dialog Programs.

Regards,

Anand Mandalika.

0 Kudos

Hi

Hey, was I drunk such that I couldn't realize that number of saphelp's screens was 10. Anyway, some brainstorming on that would have been good.

*--Serdar