‎2008 Jan 29 5:30 AM
Hello Everyone,
There is a field of more than 500 characters in internal table .
i need to read that table characterwise.
In a conditional statement ( do ) we need to assign the internal table field to a variable by character wise.
in each do loop we need to retrieve one character and store it in a field.
please do the need.
Thanks & regards,
Lakshmi.
‎2008 Jan 29 5:34 AM
Hi,
How about using OFFSET operations?
len = strlen( itab-fld ).
pos = 0.
do len times.
<fld> = itab-fld+pos(1).
..... " Additional coding
pos = pos + 1.
enddo.
Regards
Eswar
‎2008 Jan 29 5:35 AM
Hi check this
itab-text. "<<<<<<<< the ffiel where you have the data
field-symbols: <fs> type any.
lv_len = strln(itab-text).
lv_buff = 0.
do lv_len times.
assign lv_buff to <fs>
lv_buff = lv_buff + 1.
<fs> = itab-text+lv_buff(lv_len).
enddo.
‎2008 Jan 29 5:55 AM
just an another way to handle
len = strlen( itab-fld ).
pos = 0.
data fld type c.
do len times.
fld = itab-fld( pos ).
..... " Additional coding
pos = pos + 1.
enddo.
‎2008 Jan 29 5:59 AM
use the following code
DATA: v_lengts TYPE i,
v_var1 TYPE c,
v_var2 TYPE i VALUE 0,
v_var3 TYPE i VALUE 1,
BEGIN OF itab OCCURS 0,
len(500) TYPE c,
END OF itab.
LOOP AT itab.
v_lengts = STRLEN( itab-len ).
DO v_lengts TIMES.
v_var1 = itab-len+v_var2(v_var3).
v_var2 = v_var2 + 1.
ENDDO.
ENDLOOP.