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: 

whats sy-subrc=1 ?

Former Member
0 Kudos

Hi all,

a function module is returning 1 as sy-subrc value.

does that mean that it couldnt execute properly because the values imported to the FM were not correct?

Exceptions 1,2,3 exist in this FM. Does the sy-subrc value represent this exception value ?

thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

the sy-subrc value represents the exception value.

4 REPLIES 4

Former Member
0 Kudos

Hi

the sy-subrc value represents the exception value.

soumya_jose3
Active Contributor
0 Kudos

Hi,

Yes, Sy-subrc represents the exception.

Regards,

Soumya.

Former Member
0 Kudos

Hi,

Well, usually SY-SUBRC would be set to 1 when an exception of a function module of class/method is mapped to sy-subrc =1.

For example.........

call function 'ZTEST'

exceptions

not_found = 1

not_here = 2

not_there = 3.

case sy-subrc.

when '1'.

when '2'.

when '3'.

endcase.

Refer

https://forums.sdn.sap.com/click.jspa?searchID=10556063&messageID=3237483

Regards

Kiran

Former Member
0 Kudos

Hi

SY-SUBRC allways checks for the above statement is true or false

if it gives value as zero(0) then it is success

other wise it is failed that be 1 or 4 etc..

it allways returns the suuccess or failure of a statement which is above to it