08-20-2007 9:17 PM
Hi all,
I am checking the function module like this.
call function '.......'
endfunction.
if sy-subrc = 0 or sy-subrc = 3.
what is the meaing of above checking.
regards,
Ajayreddy
08-20-2007 9:22 PM
Ajay,
sy-subrc = 0 means the above statement is successful.
sy-subrc = 3 depends on what the condition has been set in that FM. It may be set to some exception.
Regards
Aneesh.
08-20-2007 9:19 PM
<b>SY-SUBRC = 0</b> Everything works Ok.
<b>SY-SUBRC = 3</b> You got an error.
Greetings,
Blag.
08-20-2007 9:19 PM
HI,
in the exceptions under function module see what does 3 means. how ever 0 is success...
Thanks
mahesh
08-20-2007 9:20 PM
It actually should be...
IF SY-SUBRC EQ 0.
ELSE.
*All other SY-SUBRC numbers...
ENDIF.
Greetings,
Blag.
08-20-2007 9:22 PM
Hello Ajay
If the coding is exactly as you described then it is faulty. The coding should look like:
CALL FUNCTION '...'
...
EXCEPTIONS
first_exception = 1
second_exception = 2
others = 3.
CASE syst-subrc.
WHEN '0'. " ok
WHEN '1'.
" do error handling
WHEN others.
" do error handling (error 2 & 3 fall into the same "error handling group")
ENDCASE.
The sy-subrc is set when an exception is raised within the function module. The numbering of the exceptions is arbitrary.
SY-SUBRC = '0' usually means the function call was ok, else there was some kind of error.
Regards
Uwe
08-20-2007 9:22 PM
Ajay,
sy-subrc = 0 means the above statement is successful.
sy-subrc = 3 depends on what the condition has been set in that FM. It may be set to some exception.
Regards
Aneesh.