Application Development 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: 

Small ABAP question..

Former Member
0 Kudos

Hi,

I have following pseudo code. How do I code it in ABAP ?

If EKPO-EBELN starting with number range 44 or 45.

xxxxxx

Endif.

Regards,

Rajesh.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

If the po number takes up all 10 digits, meaning that there is no leading zeros before the 44 or 55. Then you can do this. ONly look at the first two digits.

If EKPO-EBELN(2) = '44 or ekpo-ebeln(2) = '45'

Endif.

Regards,

Rich Heilman

3 REPLIES 3

Former Member
0 Kudos

If EKPO-EBELN+0(2) = '44' OR

EKPO-EBELN+0(2) = '45' .

xxxxxx

Endif.

Regards,

Atish

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

If the po number takes up all 10 digits, meaning that there is no leading zeros before the 44 or 55. Then you can do this. ONly look at the first two digits.

If EKPO-EBELN(2) = '44 or ekpo-ebeln(2) = '45'

Endif.

Regards,

Rich Heilman

0 Kudos

Of if there are leading zeros before it, you can do this.



data: tmp_ebeln type ekpo-ebeln.

tmp_ebeln = ekpo-ebeln.
shift tmp_ebeln left deleting leading '0'.
If tmp_ebeln(2) = '44 or tmp_ebeln(2) = '45'
 
Endif.

Regards,

Rich Heilman