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: 

purpose of call screen 0

Former Member
0 Kudos

Hello Experts,

I know the difference between call screen and set screen , In call screen the current processing of the screen is terminated and a new screen is called and once we press back from the new screen the original screen logic is processed and in set the screen once the current screen is completely processed the next screen would be set under set screen.

I want to know the purpose of call screen 0 and what does this 0 mean and what is the purpose of set screen 0 and what does this zero mean.

Thanks,

RG

1 ACCEPTED SOLUTION

raghug
Active Contributor

With Call Screen 0, you need to have a screen numbered 0 in your program. When you call it, it will reset the screen call stack - from the documentation "The called dynpro sequence is terminated as soon as one of the involved dynpros branches to a next dynpro with number 0. The program continues after CALL SCREEN." If you try calling screen 0 with out creating it, you will get a short dump. The problem with this premise though - is that you cannot create a screen numbered 0.

Leave to Screen 0 goes back to the previous screen in the call stack. So, confusingly, you will be using LEAVE TO SCREEN 0 along with CALL SCREEN xyz.

For example, from SCREEN 100...

CALL SCREEN 200. "Call stack is now 100, 200

CALL SCREEN 300. "Call stack is now 100, 200, 300

LEAVE TO SCREEN 0. "Call stack is now 100, 200

LEAVE TO SCREEN 0. "Call stack is now 100

LEAVE TO SCREEN 0. "This will leave the program, because there are no other screens in the stack

6 REPLIES 6

former_member196331
Active Contributor
0 Kudos

I hope Call screen 2000 ->Screen number.

It might be Leave to Screen 0,

Now i am at 2000
you are using Call screen 4000.
Now i am at 4000.
If you use Leave to screen 0. Means From(2000) Where the Screen called that place moving.

raghug
Active Contributor

With Call Screen 0, you need to have a screen numbered 0 in your program. When you call it, it will reset the screen call stack - from the documentation "The called dynpro sequence is terminated as soon as one of the involved dynpros branches to a next dynpro with number 0. The program continues after CALL SCREEN." If you try calling screen 0 with out creating it, you will get a short dump. The problem with this premise though - is that you cannot create a screen numbered 0.

Leave to Screen 0 goes back to the previous screen in the call stack. So, confusingly, you will be using LEAVE TO SCREEN 0 along with CALL SCREEN xyz.

For example, from SCREEN 100...

CALL SCREEN 200. "Call stack is now 100, 200

CALL SCREEN 300. "Call stack is now 100, 200, 300

LEAVE TO SCREEN 0. "Call stack is now 100, 200

LEAVE TO SCREEN 0. "Call stack is now 100

LEAVE TO SCREEN 0. "This will leave the program, because there are no other screens in the stack

Sandra_Rossi
Active Contributor

I have never seen "call screen 0" ! Dynpro 0 cannot be created. But "SET SCREEN 0" exists to "leave the current screen sequence" (or using the variant "leave to screen" if one needs to EXIT the current dynpro event (PBO/PAI/...)).

raghug
Active Contributor
0 Kudos

Call screen 0 is mentioned in the help https://help.sap.com/abapdocu_70/en/ABAPCALL_SCREEN.htm - I can't see any point to it though because like you say you can't create screen 0.

No, it's impossible, the number zero is reserved to leave the screen sequence. The documentation says "The called dynpro sequence is terminated as soon as one of the involved dynpros branches to a next dynpro with number 0" (static attribute "next dynpro" of a dynpro, or set dynamically in ABAP). If you click on the hyperlink of "next dynpro", it says "Next screens can be set statically in the Screen Painter or with SET SCREEN or LEAVE TO SCREEN in the ABAP program". So, it does not mention CALL SCREEN. I can't find a mention in the documentation that a dynpro cannot be zero, but if you try creating it, you'll get the error message "Screen number 0 is not permitted (Message number 37018), the screen number must always be greater than 0".

raghug
Active Contributor

Ah ha, clever wording, or unclever reader - justifies my hate of documentation 🙂