07-04-2009 1:27 PM
hi
what happens in the following scenarios
form a
perform b
statement1
statement 2
endform
form b
if sy-subrc eq 0
exit
endif.
endform
will it exit from form b or form a also?
in the above case if the form b is like this
form b
select statement
check sysubrc eq 0.
statemnet1
statement2
endform.
what happens now?
07-04-2009 1:31 PM
Hi,
Code and check.
This seems to be some interview question.
Regards,
Ankur Parab
07-04-2009 2:18 PM
hi
it doesn't work until you write 'perform a' stmt in report.
if you write so ,
1)in first case
( if sy-subrc eq 0.
exit.
endif in form b).....
it wil excute what ever you write after perform b stmt in form a.(i.e in your case stmt 1 stmt2)
because if sy-subrc = 0 or any value control just terminate the form .
2)in second case.(check stmt)
if sy-subc = 0.
then it wil excute after check stmt.
if sy-subrc = any other value
control terminate the form.
07-04-2009 2:50 PM
Hi,
In the first case it will only exit from perform b and then continue with perform a.
Try to write the code and then try debugging it, you will come to know the exact flow.
In second case statement1 and statement 2 gets executed twice.
Hope this may be useful..
Regards,
Prashant