on 12-11-2015 12:13 PM
Dear Experts,
Am trying to upload excel file(xls) in SRM system using below code but am getting data in Chinese format don't know how to convert into normal format and i used other format like .CSV(Comma del..) but in this am getting data but getting with special characters like (, #) , please help me to upload excel file(xls format) file to internal table.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
EXPORTING
FILENAME = L_FHEAD01
FILETYPE = 'ASC'
* HAS_FIELD_SEPARATOR = '|'
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
DAT_MODE = 'X' "SPACE
* CODEPAGE = SPACE
* IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
* VIRUS_SCAN_PROFILE =
* IMPORTING
* FILELENGTH =
* HEADER =
CHANGING
DATA_TAB = LT_TRAN
* ISSCANPERFORMED = SPACE
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
Hi,
Use the function module ALSM_EXCEL_TO_INTERNAL_TABLE or use the class CL_FDT_XL_SPREADSHEET to upload excel file.
Please check the following links:
For FM: http://wiki.scn.sap.com/wiki/display/Snippets/How+to+use++FM+ALSM_EXCEL_TO_INTERNAL_TABLE
For the class: http://zevolving.com/2013/11/abap-webdynpro-upload-excel-file-using-class-cl_fdt_xl_spreadsheet/
Regard,
Taiyeb
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarmath
PLease try using this standard classes which may do the trick for you .
DATA : oref_container TYPE REF TO cl_gui_custom_container,
iref_control TYPE REF TO i_oi_container_control,
iref_document TYPE REF TO i_oi_document_proxy,
iref_spreadsheet TYPE REF TO i_oi_spreadsheet,
iref_error TYPE REF TO i_oi_error.
Check the attached on how I used it ..
Also try using these FM
cl_gui_frontend_services=>file_open_dialog
* CALL: FM to upload excel data into internal table
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
Check this note as well
790860 - Frequently asked questions for Excel upload and download
regards
Vinita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarmat,
I don't think that the class you are using for upload will work well in Web Dynpro.
Please see some below blogs for better approach.
Excel File Upload And Display Data Using Web DynPro ABAP - Web Dynpro ABAP - SCN Wiki
For delimiting the garbage value, you can follow the below thread.
BR,
RAM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.