Code: Alles auswählen.
DATA: DATEI3 LIKE RLGRAP-FILENAME VALUE 'C:\TEMP\TEST.XLS'.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_LINE_HEADER = 'X'
I_TAB_RAW_DATA = G_RAW_DATA
I_FILENAME = DATEI3
TABLES
I_TAB_CONVERTED_DATA = ITAB " Data
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2.
Code: Alles auswählen.
DATA: DATEI2(60) TYPE C VALUE 'C:\TEMP\TEST.XLS'.
CALL FUNCTION 'FILE_READ_AND_CONVERT_SAP_DATA'
EXPORTING
I_FILENAME = DATEI2
I_SERVERTYP = 'OLE2'
I_FILEFORMAT = 'XLS'
* I_FIELD_SEPERATOR =
I_LINE_HEADER = 'X'
* IMPORTING
* E_BIN_FILELENGTH =
TABLES
I_TAB_RECEIVER = ITAB
EXCEPTIONS
FILE_NOT_FOUND = 1
CLOSE_FAILED = 2
AUTHORIZATION_FAILED = 3
OPEN_FAILED = 4
CONVERSION_FAILED = 5
OTHERS = 6
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.