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 command

Former Member
0 Likes
750

Hello,

How to do XOR command between 2 numbers in SAP. The formula is NUM1 XOR NUM2 (where NUM1 and NUM2 are binary expressions since an XOR is a bit command).. Is there any FM available?

I saw a command BIT-XOR but it only works for HEX characters.

Thanks,

AP

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
413

Hi,

You should use BIT-XOR. See:

data: w_xx(10) type x,
      w_x1(10) type x,
      w_x2(10) type x,
      w_ii type i,
      w_i1 type i,
      w_i2 type i.

w_i1 = 12345.
w_i2 = 67890.

w_x1 = w_i1.
w_x2 = w_i2.

w_xx = w_x1 BIT-XOR w_x2.

w_ii = w_xx.

write w_ii.

Best regards,

Leandro Mengue

1 REPLY 1
Read only

Former Member
0 Likes
414

Hi,

You should use BIT-XOR. See:

data: w_xx(10) type x,
      w_x1(10) type x,
      w_x2(10) type x,
      w_ii type i,
      w_i1 type i,
      w_i2 type i.

w_i1 = 12345.
w_i2 = 67890.

w_x1 = w_i1.
w_x2 = w_i2.

w_xx = w_x1 BIT-XOR w_x2.

w_ii = w_xx.

write w_ii.

Best regards,

Leandro Mengue