‎2007 Mar 10 2:20 PM
perform rajesh.
form rajesh.
some code.
exit.
endform.
what will hapen when exit triggers.
is it come out from perform or come out from form.
could u plz explain clearly step by step
with code.
‎2007 Mar 10 2:32 PM
hi Rajesh,
exit will come out of the form, which eventually means that it comes out of
the perform!
When and <b>EXIT</b> is called inside,
<u>1. loop</u>
It exits the current loop.
<u>2. IF condition.</u>
it exits the current condition check.
<u> Form</u>
it exits the form
<u>event (start of selection) </u>
it exits the event.
Hope this helps,
Sajan Joseph.
‎2007 Mar 10 2:32 PM
hi Rajesh,
exit will come out of the form, which eventually means that it comes out of
the perform!
When and <b>EXIT</b> is called inside,
<u>1. loop</u>
It exits the current loop.
<u>2. IF condition.</u>
it exits the current condition check.
<u> Form</u>
it exits the form
<u>event (start of selection) </u>
it exits the event.
Hope this helps,
Sajan Joseph.
‎2007 Mar 10 2:33 PM
Hi Rajesh,
EXIT - will come out the routine.
For an example You want to come out of the loop if sy-tabix is greter than 5.
PERFORM populate_data.
FORM populate_data .
Loop at internal table.
if sy-tabix > 5.
exit.
ENDIF.
endloop.
ENDFORM.
If u r not clear let me know i will send the detail code.
By
Nava
‎2007 Mar 10 2:54 PM
‎2007 Mar 10 2:41 PM
Hi Rajesh....
Here when exit is encountered the processing of that subroutine will stop there and the statements after the exit will not get executed........
the control comes to the next statement after perform.
Ex:
execute the following code then u will understand.
REPORT XYZ.
perform rajesh.
Write / 'Rajesh1' .
form rajesh.
Write / 'Rajesh2' .
exit.
Write / 'Rajesh3' .
endform.
This program will print the output as:
Rajesh2.
Rajesh1.
If u have any doubt, Reply .
Reward points if helpful.
Suresh...
‎2007 Mar 10 2:58 PM
‎2007 Mar 10 2:44 PM
Hi,
Please check this sample codes regarding exit statement.
...
perform rajesh.
perform rajesh2.
...
form rajesh.
if <condition> = <condition check>.
exit. <--- Exit1
else.
<codes>.
endif.
loop at <internal table>.
if <condition> = <condition check>.
exit. <--- Exit2
else.
continue.
endif.
endloop.
<codes>.
exit. <--- Exit3
endform.
Exit1:
The exit will exit from IF statement when the condition check is met. Then continue to perform loop statement.
Exit2:
The exit will exit from current loop when the condition check is met in IF statement. Then continue to perform next <codes>.
Exit3:
The exit will exit from form rajesh and continue to perform rajesh2.
Regards,
Ferry Lianto