100 Germany X
100 Greece X
100 Ireland X
100 USA X
*&---------------------------------------------------------------------*
*& Report ZDE_EXCEL_IMPORT_INTO_TABLE
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZDE_EXCEL_IMPORT_INTO_TABLE.
tables: ZDE_EXAMPLE_TABLE.
data: it_data type standard table of ZDE_EXAMPLE_TABLE.
data: l_file type string,
l_table_count type I.
PARAMETERS file LIKE l_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = file
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = it_data
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
DELETE FROM ZDE_EXAMPLE_TABLE.
INSERT ZDE_EXAMPLE_TABLE FROM TABLE it_data.
DESCRIBE TABLE it_data LINES l_table_count.
COMMIT WORK AND WAIT.
WRITE l_table_count.
WRITE 'entries imported!'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
5 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 |