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-subrc

Former Member
0 Likes
749

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
721

Hi Kushagra,

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

Reward points, if useful.

Regards,

Nitin.

6 REPLIES 6
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
721

Hi

That can be based on condition pass/fail?

Regards,

Sree

Read only

Former Member
0 Likes
721

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

Read only

Former Member
0 Likes
722

Hi Kushagra,

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

Reward points, if useful.

Regards,

Nitin.

Read only

Former Member
0 Likes
721

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

Read only

Former Member
0 Likes
721

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

Read only

former_member386202
Active Contributor
0 Likes
721

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