‎2008 Apr 03 10:25 AM
I have the following logic
if
loop
if
if
-
> Here I use EXIT command
endif
endif
endloop
endif
............
Will the control of the program return out of the outermost if endif
‎2008 Apr 03 10:29 AM
No, it will get out of the loop.
If you're using this in a subroutine for example, and you want to leave this subroutine, then use RETURN.
‎2008 Apr 03 10:29 AM
No it will come out of the innermost if-endif.
I ahve tries out ur case and it will jst come out of the innermost if-endif. for ur concern u can jst debug this code
types : begin of zmr_tc_cert_header,
lfimg type lfimg,
meins type meins,
length(100),
end of zmr_tc_cert_header.
data : zmr_tc_cert_header type zmr_tc_cert_header.
data : it_try type standard table of zmr_tc_cert_header.
data : d type c value 1,
e type c value 1,
f type c value 1.
start-of-selection.
append zmr_tc_cert_header to it_try.
if d = 1.
loop at it_try into zmr_tc_cert_header.
if e = 1.
if f = 1.
write:/ 'dlfkjasdlfk'.
endif.
endif.
endloop.
endif.
reward if helpful
Edited by: Ashish Paliwal on Apr 3, 2008 3:12 PM
‎2008 Apr 03 10:29 AM
Hi S V,
No it would not.
Exit command works in the same way as it works in other languages
1.In IF statement it comes out at the end of the code.
2.In for loop it comes out of the inner loop.
3.In perform it comes out the particular subroutine.
Kindly Reward Points If You Found The Reply Helpful,
Cheers,
Chaitanya.
Edited by: Chaitanya Raju on Apr 3, 2008 11:29 AM
‎2008 Apr 03 10:30 AM
what ever may be...
if you exit place it in side loop and endloop then it comes out of loop and endloop.
if and endif is not a loop. so it take comes out of loop and endloop. even you place it inside if and endif.
so because of the reason it comes out of your main if and endif that is your feeling.
‎2008 Apr 03 10:31 AM
hi,
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.
‎2008 Apr 03 10:35 AM
Hi,
The control of the program return out of the outermost if endif.
Your exit is with in all the if endifs and loop...endloop.
Reward.
‎2008 Apr 03 10:53 AM
Hi,
When you write exit it will come out of the loop and it will there with in outermost if endif.