Application Development 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: 

return codes

Former Member
0 Kudos

Hi pls,

in abap program what r all the statements give return code.

6 REPLIES 6

Former Member
0 Kudos

Hi,

The return code value is set as follows:

SY-SUBRC = 0 At least one line was read.

SY_SUBRC = 4 No lines were read.

SY-SUBRC = 8 The search key was not fully qualified.

*********please reward points if the information is helpful to you*************

Former Member
0 Kudos

Hi pandu,

It depends on the result of that ABAP statement.

And the return code is checked using sy-subrc and its value is 0 when the command is succesful and all other times the command is unsuccessful but each value has there own meaning.

Regards,

Atish

0 Kudos

Hi,

All the DB related stetementsl ike INSET, SELECT, MODIFY and DELETE

All the Internal table realted statements like READ, APPEND, INSERT, MODIFY

Function modules, Class methods(Not PERFORM's) if they are called using EXCEPTIONS addition and if you assign numbers to the exceptions in the calling program.

Above are some of the most used.

Its hardto list all the ABAP statements that effect sy-subrc what you can do is just press F1 on any KEY WORD for which you want to know and it gives wether this effects sy-subrc or not

Regards,

Sesh

.

Former Member
0 Kudos

Hi,

The statements which give return code are :

select, insert,modify,read, append, update,delete,.

All the above return sy-subrc.

Sy-subrc = 0 -


Success

Sy-subrc = 4 -


Failure(known reason)

Sy-subrc = 8 -


Internal error(Unknown reason).

Regards,

Priyanka.

Former Member
0 Kudos

HI.

if return is 0 it run successfully

if return is 4 it not run successfully.

Reward all helpfull answers.

Regards.

Jay

Former Member
0 Kudos

hi,

in abap all most all open sql statements which r used on internal tables returns return value for ex: SELECT, INSERT, UPDATE, DELETE MODIFY, APPEND returns return value as 0, 4,8,........... based on situation and condition where they are used.

ex: SELECT * FROM MARA INTO TABLE ITAB WHERE MATNR = S_MATNR.

IF SY-SUBRC EQ 0.

WRITE:/10 'SUCCESS'.

ELSE.

WRITE:/10 'FAILURE OF SELECT STATEMENT'.

ENDIF.

if helpful reward some points.

with regards,

Suresh.A