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

converting values in internal table to range values

suhaskrishna_sondur
Product and Topic Expert
Product and Topic Expert
0 Likes
4,287

Hi,

Can anyone tell me how to convert values in a field on an internal table into range? Thanks.

Regards,

Suhas

4 REPLIES 4
Read only

matt
Active Contributor
0 Likes
1,482

Make a range table (TYPE RANGE OF) with SIGN, OPTION, LOW and HIGH fields, loop through your itab, and for each value of the field you're interested in, create a record in the range table with

-SIGN = 'I'

-OPTION = 'EQ'

-LOW = field value

-HIGH = blank

matt

Read only

Former Member
0 Likes
1,482

Hi,

  • Declaration of ranges

data: r_extid type range of TABLENAME,

r_exitid_l like line of r_extid.

Now loop on your internal table:

loop at it_itab into wa_itab.

r_exitid_l-sign = 'I'.

r_exitid_l-OPTION = 'EQ'.

r_exitid_l-LOW = wa_itab-FIELDNAME.

r_exitid_l-high = ' '.

append r_exitid_l to r_extid.

endloop.

Hope this is helpful.

Read only

Former Member
0 Likes
1,482

HI,

Make a range table (TYPE RANGE OF) with SIGN, OPTION, LOW and HIGH fields, loop through your itab, or take BAPI structure for the range...for every field der will be range structure...den u can use that as IT...search for structure first ...for range...if not available...den go for Range Of.....and for each value of the field you're interested in, create a record in the range table with

-SIGN = 'I'

-OPTION = 'EQ'

-LOW = field value..

-HIGH = field value...

append ...

regards,

anilreddy

Read only

suhaskrishna_sondur
Product and Topic Expert
Product and Topic Expert
0 Likes
1,482

thanks for your replies...cheers!