Skip to Content
0
Apr 23, 2014 at 12:05 PM

Inconsistency when checking if sy-subrc NE 0.

967 Views

Hello,

I have the following code snippet after performing a function:

IF sy-subrc NE 0.

WRITE: / 'bla bla'.

EXIT.

ENDIF.

The problem is that, in debug mode, I am watching the value of sy-subrc and its value IS 0 after my function is performed. However, the IF condition is behaving strangely, because it is entering the condition and executing the EXIT. What is even stranger is that the WRITE is not being executed. The debugger pointer goes directly to the EXIT.

I have tried the solutions proposed in a Helpuful Answer given by thread: 2108929

1) I have also checked for any non-active objects. But they are all active.

2) I tried to use an auxiliary variable to hold the value of sy-subrc, and then check in the IF clause for this value.

None of those worked.

Do you know what can be the cause for this issue?

Many thanks,

Luis