Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Check statement

Former Member
0 Likes
566

What is the difference between check and sy-subrc. Please give me one example.

Message was edited by:

Sekhar Raju Sangaraju

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
539

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.

3 REPLIES 3
Read only

Former Member
0 Likes
539

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.

Read only

Former Member
0 Likes
540

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.

Read only

former_member386202
Active Contributor
0 Likes
539

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