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

ABAP programs

Former Member
0 Likes
706

how do u find a return code of a stmt in ABAP programs?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
684

Hi,

if sy-subrc = 0.we can say that stmt is returning some o/p properly.

rgds,

bharat.

8 REPLIES 8
Read only

Former Member
0 Likes
684

Hi,

Use Sy-SUBRC

that contains the RC

Reward if useful

Read only

Former Member
0 Likes
684

hi,

By Checking SY-SUBRC statement.

 IF SY-SUBRC = 0.
   Message e100.
 ENDIF.

Read only

Former Member
0 Likes
684

Hi,

refer

Hope this solves your purpose.

Award points if it helps.

-Gaurang

Read only

Former Member
0 Likes
684

sy-subrc is a system variable which will be maintained by the system. U can use it for the return code

Read only

Former Member
0 Likes
685

Hi,

if sy-subrc = 0.we can say that stmt is returning some o/p properly.

rgds,

bharat.

Read only

Former Member
0 Likes
684

Hi,

Return code for an ABAP statement is stored in system field sy-subrc .

select *

from spfli

into table t_spfli .

if sy-subrc eq 0 .

" Sucessfull

else

" Unsucessful .

Regards

Praveen

Read only

former_member2382
Active Participant
0 Likes
684

Hi,

U can check the status using a system field called SY-SUBRC.

If sy-subrc value is equal to 0, it means the stmt is executed or else not executed.

eg:

select ....................

if sy-subrc eq 0.

stmtms.........

endif.

regards,

parvez.

Read only

Former Member
0 Likes
684

answered