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

kiran_k8
Active Contributor
0 Kudos

Hi Folks,

1.does the value of sy-subrc changes depending on the kind of operation we are performing.I mean is sy-subrc value not 0 for success and 4 for failure irrespective of the kind of operation we are checking.

2.We will capture the errors during Call Transaction using an internal table of structure BDCMSGCOLL. and then to see the erroris we use the FM Format_message.My question is how to check the values in MESSTAB.

3. How to check whether BDC is success or fail?

K.Kiran.

4 REPLIES 4

Former Member
0 Kudos

S sy-ubrc value changes .

Eg. While u modify

SY-SUBRC = 0:

The entry was changed.

SY-SUBRC = 4:

Index position too large. No entry was changed, since the table contains less than idx entries

Not only 0 and 4 is there also 2,4,6,8...

See the READ help doc

SY-SUBRC = 0:

An entry was read.

SY-TABIX is set to the index of the entry.

SY-SUBRC = 2:

An entry was read.

SY-TABIX is set to the index of the entry. This return code can only occur when you use the COMPARING addition. For further detauls, refer to the COMPARING section of the additions

SY-SUBRC = 4:

No entry was read.

The value of SY-TABIX depends on the table type and whether the BINARY SEARCH addition was specified.

If the table is a SORTED TABLE or STANDARD TABLE with the BINARY SEARCH addition, SY-TABIX refers to the next-highest index.

Otherwise, SY-TABIX is undefined.

SY-SUBRC = 8:

No entry was read.

This return code only occurs with a SORTED TABLE or a STANDARD TABLE with the BINARY SEARCH addition. SY-TABIX is set to the number of all entries plus 1.

Former Member
0 Kudos

U can check the message type in the BDCMSGCOLL structure ,

If 'S' ,success,

'W', warning else

'E', error..

Former Member
0 Kudos

Hi,

1) Yes, the Value of SY-SUBRC will be chage the value depending on the Kind of operation

2) You need to Loop the internal table and get the MESSTAB values after the Call transaction.

3) You can not check the BDC, but you can check the Call transaction method, just check the sy-subrc value after the call transaction, if that is not successful then the Call transaction is failed. In SEssion method, we need to see the session status to check the success

Regards

Sudheer

kiran_k8
Active Contributor
0 Kudos

problem solved