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 PROBLEM

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

Hi Shah ,

try to make use of Find / replace in .TXT file.That is standard problem while Converting excel - TXT.

Regards

Prabhu

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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