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

Reading internal table

Former Member
0 Likes
1,030

Hi All,

I have to read internal table character by character for each line(row)in the internal table & select the data at the particular offset for e:g:- position 35 to 40,10 to 20...etc.

kindly advice me how this can be done?

Thanks,

Chetan.

5 REPLIES 5
Read only

Former Member
0 Likes
893

Hi Chetan ,

Loop on the internal table and use the offset option used for strings to acheive your result.

Regards

Arun

Read only

Former Member
0 Likes
893

Hi,

use the READ statment along with that use the offset position and read the record from thwe internal table.

if it is helpful, reward points,

satish.

Read only

0 Likes
893

hi.

data : ch(10) type c.

u can do by moving string

like

ch = str+4(10).

then in ch it will store from 4th character upto 10 character store.

may be it will help u.

regards,

Arpit

Read only

Former Member
0 Likes
893

Hi Chetan,

I hope you have an internal table with only one field of character type (fixed length) or string type.

loop at that internal table

get the length of that that field in a variable var = strlen(<field name>)

then in a while loop

count = 1.

WHILE VAR > 0

*you will get the value of that variable in field(count)

VAR = VAR-1

count = count + 1

ENDWHILE.

Try this

Regards,

Pankaj

Read only

former_member156446
Active Contributor
0 Likes
893

read table itab into wa_itab with key = k1.

if sy-subrc eq 0.

lv_len = strln(wa_itab-f1).

lv_1 = wa_itab-f1+35(lv_len-35)

lv_2 = wa_itab-f1+40(lv_len-40)

endif.

hope this helps