2005 May 12 12:56 PM
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
Change File type tp DAT and try.
Rgds,
Manohar
2005 May 12 1:20 PM
2005 May 12 1:23 PM
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
2005 May 12 1:52 PM
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
2009 Apr 08 1:05 PM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |