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

GUI_UPLOAD - EXCEL FILE PROBLEM

Former Member
0 Likes
1,865

Hi All,

I am using GUI_UPLOAD function for BDC. I want to upload a file but there i m gatting error. I tried with both file type excel & txt.

While running the recording it takes ##### chars.

Regards,

Dilip

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = 'c:\excel.xls'

FILETYPE = 'BIN'

  • HAS_FIELD_SEPARATOR = ' '

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • CHECK_BOM = ' '

  • IMPORTING

  • FILELENGTH =

  • HEADER =

tables

data_tab = it_bdc

4 REPLIES 4
Read only

Former Member
0 Likes
1,019

Change File type tp DAT and try.

Rgds,

Manohar

Read only

Former Member
0 Likes
1,019

Hi Dilip,

Try saving the excel file as CSV file ( file type *.csv in save as function of Excel) and change the FILETYPE in "GUI_UPLOAD" to 'ASC'.

Regards,

Sanjeev

Read only

Former Member
0 Likes
1,019

Dear Dilip,

I have used GUI_UPLOAD a lot, but never like this.

Well i'll tell you to upload .txt file . Download or save EXCEL file as text delimited by tab as it gets saved normally. Dont forget that except characters all other fields are in formatted as text field in Excel, they will get alinged as a normal text field only.

-


My txt file have data like below.

RAJESH 10

RAJSALECHA 11

BCONE 13

-


Then in program i have done as below.

Report ZTEST5.

PARAMETERS : FILE TYPE RLGRAP-FILENAME.

DATA : BEGIN OF IT OCCURS 0,

NAME(20),

AGE(4),

END OF IT.

DATA : PATH TYPE STRING.

PATH = FILE.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = PATH

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

TABLES

DATA_TAB = IT.

LOOP AT IT.

WRITE : /1 IT-NAME COLOR 1, 20 IT-AGE COLOR 4.

ENDLOOP.

-


Kindly see this and tell me if you face any problem in it.

Raj Salecha

rajeshkumar.salecha@bcone.com

Read only

Former Member
0 Likes
1,019

This message was moderated.