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 program and set screen 0

Former Member
0 Kudos

I have two questions:

1. What is the difference between "Leave program" and "set screen 0" ? I think though both have its own meaning, but when it comes to the function they both do the same thing - come back to the main program? Right?

2.How to subscribe RSS feeds to this forum? (I know there is one RSS button on the front page of this forums but I wonder if it is working!)

I appreciate.

Thanks a lot.

1 ACCEPTED SOLUTION
6 REPLIES 6

Former Member
0 Kudos

Hi,

Check this Link

<b>KeyWord Index</b>

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Leave program will leave the program directly. SEt screen 0, leave screen will leave the current screen and come back to the previous screen. For example say you have a selection screen and another dynpro wich is being called in the start-of-seleciton with CALL screen. When you want to leave this screen, you want to come back to the selectoin screen. In the PAI, of the dynpro, for the "BACK" button, you would say...

set screen 0.
leave screen.

Regards,

Rich Heilman

former_member188685
Active Contributor
0 Kudos

Hi,

LEAVE PROGRAM always leaves the current program - there is never any processing after LEAVE PROGRAM!

SET SCREEN scr.

Effect

In ABAP/4 dialogs, this sets the next screen number.

The system processes the screen with the number scr immediately after the current screen.

Example

SET SCREEN 200.

Notes

To leave a screen called with CALL SCREEN or to return from a branch to the transaction selection screen, you must use the statement

SET SCREEN 0. or LEAVE TO SCREEN 0.

Regards

vijay

Former Member
0 Kudos

Hi Nuren,

<b>SET SCREEN</b> scr.

Effect

In ABAP/4 dialogs, this sets the next screen number.

The system processes the screen with the number scr immediately after the current screen.

Example

SET SCREEN 200.

<b>LEAVE PROGRAM</b>.

Effect

Leaves the current program and continues processing after CALL TRANSACTION, CALL DIALOG or SUBMIT prog AND RETURN .

If you use LEAVE TO TRANSACTION, SUBMIT prog or start the program via the transaction menu or a transaction code, you branch to the transaction selection screen.

Note

LEAVE PROGRAM always leaves the current program - there is never any processing after LEAVE PROGRAM!

regards,

Kiran B

Former Member
0 Kudos

Hi nuren,

Leaving a Called Program

To leave a program that you have called, use the ABAP statement

LEAVE PROGRAM.

In a program, you can use one of the two following ABAP statements to leave a screen:

LEAVE SCREEN.

or

LEAVE TO SCREEN <next screen>.

The LEAVE SCREEN statement ends the current screen and calls the subsequent screen. The next screen is either the static next screen or a dynamic next screen. In the second case, you must override the static next screen using the SET SCREEN statement before the LEAVE SCREEN statement.

The LEAVE TO SCREEN statement exits the current screen and calls the dynamic next screen, which you specify as part of the statement. The LEAVE TO SCREEN statement is no more than a contraction of the two statements

SET SCREEN <next screen>.

LEAVE SCREEN.

These statements do not end the screen sequence. They merely branch to another screen in the same sequence. The screen sequence only ends when you leave to next screen 0.

regards,

keerthi.