2009 Feb 06 4:34 PM
Hi ,
I am currently doing a report and i have a query in 1 section :
i am using an IF condition
IF ( BCLASS NE 'MSVC' ) OR
( BCLASS NE 'USVC' ) .
if sy-subrc = 0.
but here BCLASS EQ MSVC but sy-subrc is getting set to 0 .
Can anyone please tell me if anything is wrong in my declaration or what could be the reason .
Thanks in advance .
2009 Feb 06 4:39 PM
use AND condition
And Sy-subrc check is not required (Thanks to Rob) -- Sorry for partial answer
Edited by: Abhishek Jolly on Feb 6, 2009 5:41 PM
2009 Feb 06 4:39 PM
Try this:
IF ( BCLASS NE 'MSVC' OR BCLASS NE 'USVC' ) .
if sy-subrc = 0.Hmm...
IF ( 'A' = '1' OR 'B' = 'C' ).
WRITE:/ sy-subrc.
ENDIF.Edited by: J@Y on Feb 6, 2009 11:52 AM
2009 Feb 06 4:39 PM
use AND condition
And Sy-subrc check is not required (Thanks to Rob) -- Sorry for partial answer
Edited by: Abhishek Jolly on Feb 6, 2009 5:41 PM
2009 Feb 06 4:39 PM
Not all ABAP statements set sy-subrc. "IF" is one of these.
Total Questions: 11 (10 unresolved)
While your at it, please clean up your unresolved questions.
Rob
2009 Feb 06 4:44 PM
Hi,
Check this
IF ( BCLASS NE 'MSVC' ) AND
( BCLASS NE 'USVC' ) .
2009 Feb 06 4:46 PM
hi,
SY-SUBRC is by default zero.
and sy-subrc is not set with respect to a if condition, so that might be the reason that sy-subrc is 0.
Hope this is helpful
Thanks
Sharath
2009 Feb 06 4:47 PM
dont you need to use if .. else.. endif blcok completely
IF ( BCLASS NE 'MSVC' ) OR
( BCLASS NE 'USVC' ) .
-----
ELSE.
---
ENDIF.