‎2006 Jul 07 9:43 AM
Hi..
I want to skip a specific piece of code in abap say for example, if the partner function and the message type in the control record is DHL/AL3PL8128 and 'ZORDER' respectively and the delivery type is 'LR', then I dont want certain processing to be done.
So what i am using is
IF ( CONTROL_RECORD_IN-RCVPRN NE 'DHL'
OR CONTROL_RECORD_IN-RCVPRN NE 'AL3PL8128' )
AND CONTROL_RECORD_IN-MESTYP NE 'ZORDER'
AND TAB_LIKP-LFART NE 'LR'.
then only perform the processing
But in this case only if all three conditions are satisfied then the processing will be skipped.
That is if I am using the same message type (ZORDER) for a different partner number, then our processing part will be skipped which should not happen.
I want a solution specific to my conditions only and for the rest of the cases the processing should run without any glitch.
Thanks
‎2006 Jul 07 9:49 AM
Hi subhash,
1. Writing conditions for NEGATIVE / NOT
are a little tricky.
2. use like this.
IF
(
CONTROL_RECORD_IN-RCVPRN = 'DHL'
OR CONTROL_RECORD_IN-RCVPRN = 'AL3PL8128'
)
AND CONTROL_RECORD_IN-MESTYP = 'ZORDER'
AND TAB_LIKP-LFART = 'LR'
.
ELSE.
*----
YOUR CODE
ENDIF.
*----
(Ya, OR should be there)
regards,
amit m.
‎2006 Jul 07 9:54 AM
hi,
if u dont want to perform
supoose u dont want to di if value of a is not eq 5 then wite it as
data : a type i value 5.
if not ( a eq 5 ) .
write : / 'hi'.
else .
write : / 'ha'.
endif.
u can apply same logic to u r conditions.
if useful do reward points
thanks
‎2006 Jul 07 10:01 AM
IF ( NOT ( CONTROL_RECORD_IN-RCVPRN NE 'DHL'
OR CONTROL_RECORD_IN-RCVPRN NE 'AL3PL8128' )
AND CONTROL_RECORD_IN-MESTYP NE 'ZORDER'
AND TAB_LIKP-LFART NE 'LR' ).
This is the solution
thanks..
‎2006 Jul 07 10:00 AM
Hi,
adding to amits suggestion...use OR instead of AND
IF (
CONTROL_RECORD_IN-RCVPRN = 'DHL'
<b>or</b> CONTROL_RECORD_IN-RCVPRN = 'AL3PL8128'
)
AND CONTROL_RECORD_IN-MESTYP = 'ZORDER'
AND TAB_LIKP-LFART = 'LR'.
ELSE.
ENDIF.Regards
vijay