07-21-2006 11:13 AM
HI Everoyne,
I am trying to upload data data xd01 using bdc.i have few names for customer. the problem is when i am converitng the excel sheet to dat file(.txt) , if a name is having a comma in excel sheet (for ex. Detroit Edison Company,inc) then when converting to dat file , it is taking this field as ( "Detroit Edison Company, inc)" )
with double quotes.
How to solve this.
Thanks & Regards
07-21-2006 11:16 AM
Hi Shah ,
try to make use of Find / replace in .TXT file.That is standard problem while Converting excel - TXT.
Regards
Prabhu
07-21-2006 11:17 AM
You cant !!
I it known bug of Excel (we contactedd microsoft help and no solution was found). We had the same problem. After converting to TXT we manualy deleted it :(.
BR, Jacek
Message was edited by: Jacek Slowikowski
07-21-2006 11:17 AM
Hi syed,
1. Another options is
saving the file as
TAB DELIMITED FILE
(using excel only)
2. the upload it in internal table
using GUI_UPLOAD
3. also pass the parameter
HAS_FIELD_SEPARATOR = 'X'
4. Then comma problem won't be there.
regards,
amit m.
07-21-2006 11:43 AM
Hi,
SAve the File as Tab Delimited file and pass that file.
SAmple code is below :
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FNAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = itab
Regards,
Leo
07-21-2006 12:06 PM
hi,
save in excel as csv-file with separator ";"
-> this is standard!
sample to upload file:
call function gui_upload...
...
tables ftab
loop at ftab.
split ftab at ';' into table sptab.
loop at sptab.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE itab TO <F>.
IF SY-SUBRC <> 0.
EXIT.
endif.
<f> = sptab-line.
endloop.
endloop.
Andreas
07-21-2006 12:30 PM
Hi,
If the above mentioned workarounds solve your prob.. fine.
If not then use the FM 'ALSM_EXCEL_TO_INTERNAL_TABLE'.
to upload a excel directly without converting to txt file
YOU HAVE TO MANIPULATE THE CONTENTS OF THE INTERNAL TABLE RETURNED BY THIS fm TO THE DATA FORMAT U WANT.
Sharat,
ps: pls reward points if helpful