Application Development 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: 

Upload notepad into internal Table seperated by Semi colon

Former Member
0 Kudos

hi All,

I m currently using the GUI_UPLOAD FM .

but unable to get the data in proper format file

"CN06;S363201005;Non brand related(OB;CAMN107B2301 Investigator Meeting;04.05.10;04.05.11"

what is the Best way to upload the conrtent of notepad into Internal table sepreated by Semi colon.

thanks in advance .

Saurabh

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try the below code.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = fname

has_field_separator = 'X'

TABLES

DATA_TAB = it_dummy.

LOOP AT it_record.

wa_string = it_dummy.

CLEAR: wa_string, wa_uploadtxt.

SPLIT wa_string AT ; INTO wa_uploadtxt-txt1 wa_uploadtxt-txt2 wa_uploadtxt-txt3 wa_uploadtxt-txt4.

Thanks & Regards,

Neela.

Edited by: Neela M B on Sep 22, 2010 1:57 PM

5 REPLIES 5

matt
Active Contributor
0 Kudos

>but unable to get the data in proper format file

What precisely do you mean by that?

Have you considered the ABAP "SPLIT" command? Maybe a little searching would help - like this thread asked very recently:

Former Member
0 Kudos

Hi,

Try the below code.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = fname

has_field_separator = 'X'

TABLES

DATA_TAB = it_dummy.

LOOP AT it_record.

wa_string = it_dummy.

CLEAR: wa_string, wa_uploadtxt.

SPLIT wa_string AT ; INTO wa_uploadtxt-txt1 wa_uploadtxt-txt2 wa_uploadtxt-txt3 wa_uploadtxt-txt4.

Thanks & Regards,

Neela.

Edited by: Neela M B on Sep 22, 2010 1:57 PM

0 Kudos

Hi Neela,

The problem with your GUI_UPLOAD is that you are not specifying the file type. The default type is ASC i.e ASCII and the note pad is of type DAT. So specify the FILETYPE as DAT it will work. and also keep an eye on FIELD SEPARATOR.

If problem still persist I want to see your NOTEPAD.

with regards,

vimal

0 Kudos

Vimal..I guess Neela is helping Sourabh

0 Kudos

Problem solved with this case.

thanks a lot