2007 Jul 09 10:33 AM
Hi all
I want complete description on sy-subrc
2007 Jul 09 10:34 AM
hi,
Depending on what the senario is, the value could be anything. For ABAP statements, it is usually, 0,4,8 which means success or failure. Or from BDC CALL tranaction, 1001, will mean failure. Or if we are talking about sy-subrc value after calling a function module, it will depend on the exceptions list from the function module, and what values are assigned to the exceptions. Here is could be anything.
Sy-subrc = 0 -
Success
Sy-subrc = 4 -
Failure(known reason)
Sy-subrc = 8 -
Internal error(Unknown reason).
2007 Jul 09 10:37 AM
Hi,
SY-SUBRC is the system return parameter that SAP provides for all actions like Select, Read, the outcome of a Function module etc.
In general, if the SY-SUBRC = 0, then that action has been performed successfully.
If SY-SUBRC > 0 then, the system has raised an exception
***do reward if usefull
vijay
2007 Jul 09 10:47 AM
GOTO SE11, and type SY / SYST and display,goto SUBRC field you can see the description there.
It is mainly useful, to know whether return code is successful or failure or error.
0-SUCCESS 4- FAILURE 8- ERROR
Rgds,
SaiRam
2007 Jul 09 12:02 PM
Hi Subin,
Sy-subrc statement is for checking the errors in the coding.
it applies after quries and read statements.
if sy-subrc = 0
the result contains at least one record.
if sy-subrc = 4
The result table is empty
if sy-subrc = 8
applies only to select single for update you did not specify all the primary key fields in the where condition .The result table is empty.
Use this link,
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3a6d358411d1829f0000e829fbfe/content.htm
If useful reward points.
Thanks
Sanket.
2007 Jul 09 12:08 PM
Hi..
SY-SUBRC is a system field that stores the status of previously executed statement.
If a statement is SUCCESSFUL it stores the value 0.
otherwise it will store any other value like 4 , 8 based on the error condition.
reward if useful.
regards.