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

Small ABAP question..

Former Member
0 Likes
481

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
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
454

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
Read only

Former Member
0 Likes
454

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

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

xxxxxx

Endif.

Regards,

Atish

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
455

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

Read only

0 Likes
454

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