Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

IF-ENDIF Doubt??

Former Member
0 Likes
522

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

4 REPLIES 4
Read only

Former Member
0 Likes
487

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.

Read only

Former Member
0 Likes
487

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

Read only

0 Likes
487

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..

Read only

Former Member
0 Likes
487

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