‎2007 Dec 10 11:49 AM
What is the difference between check and sy-subrc. Please give me one example.
Message was edited by:
Sekhar Raju Sangaraju
‎2007 Dec 10 12:02 PM
Hi Sekhar,
1. Check can be used to check any condition.
eg.
CHECK A = 1.
2. Whereas sy-subrc is a system variable,
which keeps track of success/failure after almost all abap statements.
regards,
amit m.
‎2007 Dec 10 11:56 AM
hmmm you are comparing bees and elephants.
sy-subrc is a system variable which is 0 when statements are sucessful.
check is a way to exit program when condition is not fulfilled.
‎2007 Dec 10 12:02 PM
Hi Sekhar,
1. Check can be used to check any condition.
eg.
CHECK A = 1.
2. Whereas sy-subrc is a system variable,
which keeps track of success/failure after almost all abap statements.
regards,
amit m.
‎2007 Dec 10 12:08 PM
Hi,
Sy-subrc is a system field its a return code and check is just like if statement.
If sy-subrc eq 0.
endif.
check sy-subrc eq 0.
Regards,
PRashant