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

Hello

Former Member
0 Likes
436

Hello gurus,

I have a "," delimited text file, and i have to upload that to an internal table of two columns as as follows.

example:-

Text file:

Book,Pencil,pen

kumar,ramesh,srini,ram,lakshman.

Intenal table should get populated as follows:-

Book pencil

Book pen

kumar ramesh

kumar srini

kumar ram

kumar lakshman

plz help me out.

Thanks

Kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
413

Something like this.

loop at input_text_table.

split input_text_table-csv_line at ',' into result_itab-field1 rest_of_it.

do.

split rest_of_it at ',' into result_itab-field2 rest_of_it.

if sy-subrc <> 0.

exit.

endif.

append result_itab.

clear result_itab-field2 .

enddo.

3 REPLIES 3
Read only

Former Member
0 Likes
413

Hi,

you have to write programming logic to achiveve that.

thanks,

sksingh

Read only

0 Likes
413

Hi,

please can you give me the logic if you know..?

Thanks,

kumar

Read only

Former Member
0 Likes
414

Something like this.

loop at input_text_table.

split input_text_table-csv_line at ',' into result_itab-field1 rest_of_it.

do.

split rest_of_it at ',' into result_itab-field2 rest_of_it.

if sy-subrc <> 0.

exit.

endif.

append result_itab.

clear result_itab-field2 .

enddo.