09-22-2010 8:26 AM
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
09-22-2010 9:27 AM
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
09-22-2010 8:31 AM
>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:
09-22-2010 9:27 AM
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
09-22-2010 9:37 AM
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
09-22-2010 11:17 AM
09-22-2010 12:12 PM