‎2007 Feb 15 1:47 PM
friends we see sy-subrc returning some values ,please provide me alist of values
and what do they suggest?
‎2007 Feb 15 1:49 PM
‎2007 Feb 15 1:49 PM
0 is a success in all cases...
other values depends on what "statement / function" you executed...it depends on that...
Thanks.
‎2007 Feb 15 1:53 PM
hi,
the value will get set depending upon the statements. If u press F1 and see the documentation u can understand.
Do F1 for READ, SELECT, etc.
If sy-subrc =0 then the statement suceeded adn if it is 4 it is with error.
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,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.
Message was edited by:
Judith Jessie Selvi
‎2007 Feb 15 1:57 PM
Hi there!
The values of sy-subrc depends on the instruction that's run before the sy-subrc check. When the statement runs correctly the sy-subrc will be equal zero, otherwise it encontered and error.
You can see the exceptions of a function using the model to call the function or accessing it by se37 and get the meaning of the sy-subrc numbers that the function returns.
Hope this help you out.