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: 

sy-subrc

Former Member
0 Kudos

what is the value of sy-subrc inside a loop??

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Kushagra,

Inside the loop, the value of sy-subrc always remains zero..

Reward points, if useful.

Regards,

Nitin.

6 REPLIES 6

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi

That can be based on condition pass/fail?

Regards,

Sree

Former Member
0 Kudos

Hi Kushagra

Once you enter the LOOP, it means a record is found and so SY-SUBRC will always be 0 inside the LOOP.

Merlin

Former Member
0 Kudos

Hi Kushagra,

Inside the loop, the value of sy-subrc always remains zero..

Reward points, if useful.

Regards,

Nitin.

Former Member
0 Kudos

HI

SY-SUBRC VALUE ALLWAYS DEPENDS UP ON THE CONIDTION

POSSIBLE SY-SUBRC VALUES IS ZERO OR ANY VALUE

IF ITS VALUE IS ZERO MEANS ITS VALUE IS TRUE

IF ITS VALUE IS OTHER THAN ZERO MEANS ITS A FAILURE

THE VALUE ALLWAYS DEPENDS ON THE ABOVE CONDITION , I.E WHAT EVER THE LINE ABOVE THE SY-SUBRC IT CONSIDERS THAT CONDITION

REWARD IF USEFUL

Former Member
0 Kudos

SAP provided us with predefined Data objects. One such object is SUBRC in the table SYST.

The purpose of this field to indicate success/failure of any action in SAP. After each statement in SAP is executed, the SY-SUBRC is set depending on the result of the statement. the SY-SUBRC can contain the following values.

0 - This value is set when the statement is executed successfully.

2 - This value is set when the statement is executed unsuccessfully.

4 - This value is set when the statement is executed unsuccessfully.

8 - This value is set when the statement is executed unsuccessfully.

Check the following link

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb304e358411d1829f0000e829fbfe/content.htm

former_member386202
Active Contributor
0 Kudos

Hi,

Its a return code n its depends on condtion which ur passing.

If condtion is true then sy-subrc is 0 otherwise ioots not zero.

Reagrds,

Prashant