‎2008 Jul 11 8:27 AM
Hi,
what is the difference between exit and leave program.
I want to come to sap screen which one have to use.?
Thanks,
srii.
‎2008 Jul 11 8:28 AM
Hi,
The EXIT command will stop the LOOP passings, exit from the SUBROUTINES..etc.
LEAVE PROGRAM.
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 !
‎2008 Jul 11 8:29 AM
Hi
use EXIT statement to come on to the main SAP Screen if you want to come back to the program then use LEAVE PROGRAM
Regards
Pavan
Edited by: Pavan Bhamidipati on Jul 11, 2008 9:29 AM
‎2008 Jul 11 8:30 AM
Hello sridhar ,
exit is a command used with to come out of the loops while leave program is used to leave the running program.
Check the following programs ;-
EXIT
http://help.sap.com/saphelp_nw2004s/helpdata/en/71/9f893f17493c17e10000000a114084/content.htm
LEAVE PROGRAM
http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba50035c111d1829f0000e829fbfe/content.htm
Regards,
Bhumika
‎2008 Jul 11 8:33 AM
Hi..,
EXIT:
If the EXIT statement is listed within a loop, it leaves the loop by ending the current loop process. Program execution is continued after the closing statement in the loop.
Outside of a loop, the EXIT statement leaves the current processing block. But better to use Exit inside the loop only!
LEAVE PROGRAM:
This statement immediately ends the current main program and deletes its internal session - including all loaded programs, instances, and their data .
The LEAVE PROGRAM statement can appear anywhere within any processing blocks. It ends the program regardless of the program/object or the program group of the internal session in which it is executed.
Thanks,
Naveen.I
‎2008 Jul 11 8:37 AM
Hi,
EXIT is used to end the Further processing after The EXIT Statement if the condition does not meet.
The output before EXIT is then Displayed.
But LEAVE PROGRAM is used to Leave the defined program just after the the Statement.
Generally if to Coming Back to Calling Program after the Processing of Called Program it is used.Or After a Certain Statement if you want to Leave the program.
Follow the link-
http://help.sap.com/saphelp_nw2004s/helpdata/en/71/9f893f17493c17e10000000a114084/content.htm
http://www.sapbrainsonline.com/ARTICLES/TECHNICAL/ABAP/CALL%20ANOTHER%20PROGRAM%20FROM%20LIST.html
http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba50035c111d1829f0000e829fbfe/content.htm
Regards,
Sujit
‎2008 Jul 11 8:38 AM
The EXIT command will stop the LOOP passings, exit from the SUBROUTINES..etc.
LEAVE PROGRAM.
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 !
‎2008 Jul 11 8:40 AM
Hi Sridhar,
EXIT is mainly used
In Events (to leave the event and to process further) .
In Loops (to exit from the current loop).
LEAVE PROGRAM.
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.
LEAVE PROGRAM always leaves the current program - there is never any processing after LEAVE PROGRAM!
Regards,
Swapna.