DATA: innertable1 TYPE TABLE OF alsmex_tabline,
structor1 TYPE alsmex_tabline,
innertable2 TYPE TABLE OF zztcomp_gs,
structor2 TYPE zztcomp_gs,
innertable11 TYPE TABLE OF alsmex_tabline,
structor11 TYPE alsmex_tabline,
innertable22 TYPE TABLE OF zztcompt_gs,
structor22 TYPE zztcompt_gs,
aim_path TYPE rlgrap-filename.
SELECTION-SCREEN BEGIN OF BLOCK qwe WITH FRAME TITLE TEXT-001.
PARAMETERS: filepath type rlgrap-filename,
filename type rlgrap-filename ,
coltotal type i default 15.
SELECTION-SCREEN END OF BLOCK qwe.
INITIALIZATION.
move ‘C:\Users\I527935\Desktop’ to filepath.
at SELECTION-SCREEN.
aim_path = filepath && filename.
CALL FUNCTION ‘ALSM_EXCEL_TO_INTERNAL_TABLE’
EXPORTING
filename = aim_path
i_begin_col = 1
i_begin_row = 2
i_end_col = coltotal
i_end_row = 618
TABLES
intern = innertable1.
LOOP AT innertable1 INTO structor1.
CASE structor1-col.
WHEN 1.
structor2-matnr = structor1-value.
WHEN 2.
REPLACE ALL OCCURRENCES OF ‘/’ IN structor1-value WITH ‘’.
structor2-ersda = structor1-value.
WHEN 3.
structor2-ernam = structor1-value.
WHEN 4.
REPLACE ALL OCCURRENCES OF ‘/’ IN structor1-value WITH ‘’.
structor2-laeda = structor1-value.
WHEN 5.
structor2-aenam = structor1-value.
WHEN 6.
structor2-vpsta = structor1-value.
WHEN 7.
structor2-pstat = structor1-value.
WHEN 8.
structor2-lvorm = structor1-value.
WHEN 9.
structor2-mtart = structor1-value.
WHEN 10.
structor2-mbrsh = structor1-value.
WHEN 11.
structor2-matkl = structor1-value.
WHEN 12.
structor2-bismt = structor1-value.
WHEN 13.
structor2-meins = structor1-value.
WHEN 14.
structor2-bstme = structor1-value.
ENDCASE.
write: / structor1-row,
structor1-col,
structor1-value.
AT END OF row.
APPEND structor2 TO innertable2.
ENDAT.
ENDLOOP.
MODIFY zztcomp_gs FROM TABLE innertable2.
CALL FUNCTION ‘ALSM_EXCEL_TO_INTERNAL_TABLE’
EXPORTING
filename = ‘C:\Users\I527935\Desktop\component description.XLSX’
i_begin_col = 1
i_begin_row = 2
i_end_col = 5
i_end_row = 632
TABLES
intern = innertable11.
LOOP AT innertable11 INTO structor11.
CASE structor11-col.
WHEN 1.
structor22-mandt = structor11-value.
WHEN 2.
structor22-matnr = structor11-value.
WHEN 3.
structor22-spras = structor11-value.
WHEN 4.
structor22-maktx = structor11-value.
WHEN 5.
structor22-maktg = structor11-value.
ENDCASE.
AT END OF row.
APPEND structor22 TO innertable22.
ENDAT.
ENDLOOP.
MODIFY zztcompt_gs FROM TABLE innertable22.
call TRANSACTION ‘SE16’.