‎2007 Nov 05 6:54 PM
Hi ,
This is my if condition....
IF NOT xvbap-posnr IS INITIAL.
<b>IF ( xvbap-pstyv = 'ZIRO' OR xvbap-pstyv = 'ZIRW' ) AND
( yvbap-pstyv = 'ZROR' OR yvbap-pstyv = 'ZROW' ).
MESSAGE e901 WITH text-005.
ELSEIF ( xvbap-pstyv = 'ZIRO' OR xvbap-pstyv = 'ZIRW' ) AND
( xvbap-pstyv is intial ).
MESSAGE e901 WITH text-005.
endif.
ENDIF.</b>
ENDIF.
can some one tell me how to combine the inner If- Elseif condition into a single if condition using OR.
i.e. IF ( xvbap-pstyv = 'ZIRO' OR xvbap-pstyv = 'ZIRW' ) AND
( yvbap-pstyv = 'ZROR' OR yvbap-pstyv = 'ZROW' ) OR
( xvbap-pstyv = 'ZIRO' OR xvbap-pstyv = 'ZIRW' ) AND
( xvbap-pstyv is initial ).
MESSAGE e901 WITH text-005.
endif.
the statement should have the same functionaity like the above (in bold)..
Thank You,
Challa.
‎2007 Nov 05 6:58 PM
IF ( xvbap-pstyv = 'ZIRO' OR xvbap-pstyv = 'ZIRW' ) AND
( yvbap-pstyv = 'ZROR' OR yvbap-pstyv = 'ZROW' OR xvbap-pstyv is INITIAL).
MESSAGE e901 WITH text-005.
ENDIF.Regards
Aneesh.
‎2007 Nov 05 6:58 PM
IF ( xvbap-pstyv = 'ZIRO' OR xvbap-pstyv = 'ZIRW' ) AND
( yvbap-pstyv = 'ZROR' OR yvbap-pstyv = 'ZROW' OR xvbap-pstyv is INITIAL).
MESSAGE e901 WITH text-005.
ENDIF.Regards
Aneesh.
‎2007 Nov 05 7:04 PM
Check this below.
IF NOT xvbap-posnr IS INITIAL and
( xvbap-pstyv = 'ZIRO' OR xvbap-pstyv = 'ZIRW' ).
IF ( yvbap-pstyv = 'ZROR' OR yvbap-pstyv = 'ZROW' ).
MESSAGE e901 WITH text-005.
ELSE xvbap-pstyv is intial.
MESSAGE e901 WITH text-005.
ENDIF.
ENDIF.
<b><REMOVED BY MODERATOR></b>
Thanks,
Srinivas
Message was edited by:
Alvaro Tejada Galindo
‎2007 Nov 05 8:24 PM
Hi,
Your second condition will never be true..
ELSEIF ( xvbap-pstyv = 'ZIRO' OR xvbap-pstyv = 'ZIRW' ) AND
( xvbap-pstyv is intial ).
There are two cases
1) IF XVBAP-PSTYV is initial -- In this case the First Condition before AND Will fail and second condition after AND will be TRUE. Net result is FALSE.
2) IF XVBAP-PSTYV is filled --- In this case the SECOND condition AFTER AND will Fail. First condition might or might not be true depending on the value of the field. Net Result is FALSE.
Regards,
Abhishek