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

XOR

Former Member
0 Likes
1,456

Can we use XOR in ABAP. Say, IF wa_itab-status XOR wa_itab1-status. If we can't use it then what is the alternative.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
449

You can perform XOR only on bit-operands. It is not supported for logical operators. U need to use general rule for XOR as logical expressions in ABAP statements.

A XOR B = ((A OR B) AND NOT(A AND B)) In ur case,

A = wa_lt_op_exist-status EQ 'PDST' and

B = wa_lt_op_pos-status EQ 'PDST'.

For this part IF wa_itab-status EQ 'PDST' XOR wa_ltab1-status EQ 'PDST'

just replace the following part in ur report

IF ((wa_ltab-status EQ 'PDST' OR wa_ltab1-status EQ 'PDST')

AND (NOT(wa_ltab-status EQ 'PDST' AND wa_ltab1-status EQ 'PDST')))

1 REPLY 1
Read only

Former Member
0 Likes
450

You can perform XOR only on bit-operands. It is not supported for logical operators. U need to use general rule for XOR as logical expressions in ABAP statements.

A XOR B = ((A OR B) AND NOT(A AND B)) In ur case,

A = wa_lt_op_exist-status EQ 'PDST' and

B = wa_lt_op_pos-status EQ 'PDST'.

For this part IF wa_itab-status EQ 'PDST' XOR wa_ltab1-status EQ 'PDST'

just replace the following part in ur report

IF ((wa_ltab-status EQ 'PDST' OR wa_ltab1-status EQ 'PDST')

AND (NOT(wa_ltab-status EQ 'PDST' AND wa_ltab1-status EQ 'PDST')))