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

Issue with Ranges.

Former Member
0 Likes
792

Hi,

i'm using below Ranges in a Program.

R_Range-option = 'BT'

R_Range-low = 'XX01'

R_Range-high = 'XX15'.

Append R_Range.

R_Range-option = 'BT'

R_Range-low = 'AAAA'

R_Range-high = 'ZZZZ'.

Append R_Range.

XX is Alphanumeric.

am using this range in below loop.

loop at itab where range in R_Range.

" statements

endloop.

but Range XX00 t0 XX15 is not considered. But it takes AAAA to ZZZZ ,

is there any way to use alphanumeric in ranges?

Thanks in advance,

malai

7 REPLIES 7
Read only

ThomasZloch
Active Contributor
0 Likes
759

AAAA to ZZZZ includes XX01 to XX15, so what do you mean with "not considered"? Does the range contain both values when going into the loop, or just one of the two alternatively?

Is XX just a placeholder? If yes, list some actual values.

Thomas

Read only

0 Likes
759

And how are you informing R_Range-SIGN. With an 'I' or with an "E"?

Edited by: Arseni Gallardo on Feb 28, 2012 12:47 PM

Read only

0 Likes
759

Thomas,

It includes both the ranges.

are you sure AAAA-ZZZZ includes XX01 to XX15.??

Example values are... PPQU,

OM45,4487,0009,0015,AA12.

Whether A to Z include 0-9 also??

Regards,

Annamalai

Read only

0 Likes
759

Hi,

Using Include 'I' only.

Regards,

Annamalai.

Read only

former_member194152
Contributor
0 Likes
759

XX01 to XX15 is subset of AAAA to ZZZZ so it should be considered in your report, only items will not considered are which start with numeric value please see following code :


types lv_werks type marc-werks.

data r_werks type RANGE OF lv_werks.
data wa_werks LIKE LINE OF r_werks.

wa_werks-sign = 'I'.wa_werks-option = 'BT'.wa_werks-low = 'XX01'. wa_werks-high = 'XX15'.
append wa_werks to r_werks.

wa_werks-sign = 'I'.wa_werks-option = 'BT'.wa_werks-low = 'AAAA'. wa_werks-high = 'ZZZZ'.
append wa_werks to r_werks.

data : begin of itab OCCURS 0,
          werks type marc-werks,
       end of itab.


       itab-werks = 'AA01'. append itab.
       itab-werks = 'BA01'. append itab.
       itab-werks = 'BA01'. append itab.
       itab-werks = 'DA01'. append itab.
       itab-werks = 'EA01'. append itab.
       itab-werks = 'XX15'. append itab.
       itab-werks = 'ABCD'. append itab.
       itab-werks = 'DEFG'. append itab.
       itab-werks = 'HIJK'. append itab.
       itab-werks = 'LMNO'. append itab.
       itab-werks = '1234'. append itab.
       itab-werks = '2000'. append itab..
       itab-werks = '10BA'. append itab.


loop at itab where werks in r_werks.
write : / itab-werks.
endloop.

And output of above code is :

BA01

BA01

DA01

EA01

XX15

ABCD

DEFG

HIJK

LMNO

No plant like 1000 or 10BA considered.

Read only

0 Likes
759

Gagan,

First two characters are alphanumeric. it can also be numbers . In this case what shall i do?

Regards,

Malai.

Read only

0 Likes
759

Gagan,

> First two characters are alphanumeric. it can also be numbers . In this case what shall i do?

>

>

>

>

> Regards,

> Malai.

Hi,

then you can use like this only right?


r-low = '0000'.
R-HIGH = 'ZZZZ'.
R-SIGN = 'I'.
R-OPTION = 'BT'.
APPEND R.

What values exactly you want to select?

thanks and regards.

Aswath.