‎2008 Feb 06 11:53 AM
Hi All,
Having a string with value "AAA BBB CCC DDD EEE FFF GGG HHH III JJJ KKK LLL.........."
split it and Need to pass into internal table like this:
AAA BBB CCC---row1
DDD EEE FFF---row2
GGG HHH III-----row3
JJJ KKK LLL----row4
begin of Itab.
text typ c,
endif itab.
Thanks,
Sridhar
‎2008 Feb 06 12:00 PM
HI,
DATA:
begin of it_tab occurs 10,
char(12) type c,
end of it_tab.
DATA:
w_no type i.
do.
it_tab-char = string+w_no(12).
if it_tab-char is initial.
clear.
exit.
else.
append it_tab.
clear it_tab.
w_no = w_no + 12.
endif.
enddo.
plzz reward if ti is usefull..
plzz dont forget too reward...
for any further quiries u can contact me on mutyalasunilkumar@gmail.com
‎2008 Feb 06 12:42 PM
sorry the condition is not working.......
its dumping because : it_tab-char = lv_werks+w_no(20).
say in my string length is 34 and with the above statement its taken with 20 into first record and looking for second one, for the second the the length is 14 ...it means length is not enough ...how to resolve?
‎2008 Feb 06 12:46 PM
IN the internal table declaration insted of type c and length give type as werks u r problem will get solves i hope
plzz reward if it is useful.
‎2008 Feb 06 12:02 PM
‎2008 Feb 06 12:55 PM
LOOP at it_data into wa_data.
l_length = strlen(wa_data-value)
IF l_length > 10(u want split after 9 characters including the two spaces).
wa_data1-value = wa_data-value+0(10).
append wa_data1 into it_data1.
ELSE.
wa_data1-value = wa_data-value+0(l)_length).
append wa_data1 into it_data1.
ENDIF.
ENDLOOP
Hope this helps you.
Reward points if helpful.
‎2008 Feb 06 1:53 PM