You either save the excel sheet as Tab delimited file
or .csv file. and declare your internal table to get the corresponding
the contents from the file. Then when its tab delimited or
.csv, SPLIT the contents into respective fields.
Here is a sample for CSV file :
*declaration of internal tables.
DATA : BEGIN OF IT_DUMMY OCCURS 0,
TEXT(500),
END OF IT_DUMMY.
DATA : BEGIN OF IT_MAIN OCCURS 0,
MATNR
LIKE RMMG1-MATNR,
"material selection to change
DISLS
LIKE MARC-DISLS,
"lot size key
END OF IT_MAIN.
*uploading the input file***********************************************
CALL FUNCTION 'UPLOAD'
EXPORTING
FILENAME
= INPUT
TABLES
DATA_TAB
= IT_DUMMY
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH
= 4
UNKNOWN_ERROR = 5
OTHERS
= 6.
*appending it_main by splitting the uploaded file
LOOP AT IT_DUMMY.
SPLIT IT_DUMMY
AT ',' INTO IT_MAIN-MATNR IT_MAIN-DISLS.
APPEND IT_MAIN.
ENDLOOP.
Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP MM SD Consultant
Contact : serkurumsal@yandex.com
Social Plugin