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

SY - System fields and return codes in ABAP

Former Member
0 Likes
2,578

Hi

I'm new to ABAP, where do I find what the meaning of the system field return codes are ?

example SY-SUBRC returns a number of codes 0, 2, 4, 8 etc what do they mean.

Is there a resource somewhere that provides this information for all the system fields.

I have searched high and low and have found little, they must be defined somwhere ?

cheers Hugh

1 ACCEPTED SOLUTION
Read only

GauthamV
Active Contributor
0 Likes
1,962

Use this.

[http://help.sap.com/saphelp_46c/helpdata/en/7b/fb96c8882811d295a90000e8353423/content.htm]

Use this.

[http://help.sap.com/saphelp_46c/helpdata/en/7b/fb96c8882811d295a90000e8353423/content.htm]

8 REPLIES 8
Read only

GauthamV
Active Contributor
0 Likes
1,963

Use this.

[http://help.sap.com/saphelp_46c/helpdata/en/7b/fb96c8882811d295a90000e8353423/content.htm]

Read only

Former Member
0 Likes
1,962

SY-SUBRC is different based on the command that sets it. So it is docuemtned for each command, not in general.

Rob

Read only

former_member376453
Contributor
0 Likes
1,962

Hi - Welcome to SDN. You can search the forum before posting a question, to get quick resolution. Check the below link :

http://help.sap.com/saphelp_47x200/helpdata/en/7b/fb96c8882811d295a90000e8353423/frameset.htm

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,962

Here is a listing of all of the system fields.

http://help.sap.com/saphelp_scm50/helpdata/en/7b/fb96c8882811d295a90000e8353423/frameset.htm

As for what the return codes( 0, 4, 😎 for SY-SUBRC mean, that is a little tricky. The meanings of the values are dependent on what statement was used previously. They would mean different things when used with different statements. For example, if you check SY-SUBRC after a FIND statement, the return code value 4, would mean something different than if you had check the SY-SUBRC value after doing an OPEN DATASET. So you need to look at the specific statements in help.sap.com and see what it says about the SY-SUBRC values for each statement.

http://help.sap.com/saphelp_scm50/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,962

hello there,

well..when you try to retrieve data from database table its always either 0 or 4.

as 0< always success no matter where u use it.

and 8 is returned when you try to read the file from application server and its unsuccessful.

Read only

matt
Active Contributor
0 Likes
1,962

In addition to the above - if you go to SE11 and enter SYST in the "Data Type" field and display, you'll get all the system fields, with description.

matt

Read only

Former Member
0 Likes
1,962

This message was moderated.

Read only

Former Member
0 Likes
1,962

Thanks for the Info. I think my original searches were too generic !