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

data passing into internal table...from string.

Former Member
0 Likes
1,539

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

6 REPLIES 6
Read only

Former Member
0 Likes
1,120

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

Read only

0 Likes
1,120

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?

Read only

0 Likes
1,120

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.

Read only

Former Member
0 Likes
1,120

w

Edited by: rohitaash sharma on Feb 6, 2008 1:04 PM

Read only

Former Member
0 Likes
1,120

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.

Read only

0 Likes
1,120

check previo