‎2008 Nov 06 3:15 PM
Hello,
I have a veeery strange issue: I have a call FM, I exit the FM with sy-subrc = 0.
After the call FM I have the usual
if sy-subrc NE 0.
message...
endif.Guess what: the message is displayed when sy-subrc = 0.
Edited by moderator because the forum can't cope with < followed by > And put into tags because it looks nicer
Edited by: Matt on Nov 6, 2008 4:18 PM
‎2008 Nov 06 3:18 PM
Are you sure the message displayed is the one inside the exit if?
Post the code exactly how it is in the program inside the code markup
‎2008 Nov 06 3:27 PM
This is the code, nothing special... and yes, I am in debugger and the message inside the if statement is displayed.
REPORT xxx.
DATA: x TYPE y.
CALL FUNCTION 'ZZZ'
EXPORTING
zz = X
EXCEPTIONS
EX1 = 1.
OTHERS = 2.
* Here I check in debugger and sy-subrc = 0 !!!
IF sy-subrc NE 0.
* THIS PART IS EXECUTED!!!
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
‎2008 Nov 06 3:37 PM
check the sy-subrc when the debugger is on the if line, not on the call fucntion line
‎2008 Nov 06 3:40 PM
>
>
> EXCEPTIONS > EX1 = 1. > OTHERS = 2. >
Please try again - this won't pass a syntax check.
Rob
‎2008 Nov 06 3:44 PM
Belive me, I have checked sy-subrc at every click...
On if line sy-subrc = 0.
@Rob, I have an extra dot, sorry
I just had to modify the data object names and the exception name...
‎2008 Nov 06 3:50 PM
>
> This is the code, nothing special... and yes, I am in debugger and the message inside the if statement is displayed.
>
>
> REPORT xxx. > > DATA: x TYPE y. > > CALL FUNCTION 'ZZZ' > EXPORTING > zz = X > EXCEPTIONS > EX1 = 1. > OTHERS = 2. > * Here I check in debugger and sy-subrc = 0 !!! > IF sy-subrc NE 0. > * THIS PART IS EXECUTED!!! > MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno > WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. > ENDIF. >
Can you post the actual code that you are using.
Having a Function Module called 'ZZZ' appears to be a bit strange to me.
Also a field of type y would not syntax check.
Are you playing with ABAP.
Have you been hiding code.
This is not a straight forward question to me.