Created
March 16, 2013 14:29
-
-
Save EkremGungormez/5176608 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE' | |
EXPORTING | |
filename = lv_fname | |
i_begin_col = 1 | |
i_begin_row = 2 | |
i_end_col = 18 | |
i_end_row = '9999' | |
TABLES | |
intern = lt_excel | |
EXCEPTIONS | |
inconsistent_parameters = 1 | |
upload_ole = 2 | |
OTHERS = 3. | |
* get excel file inside. | |
LOOP AT lt_excel INTO ls_excel. | |
lv_col = ls_excel-col . | |
IF sy-subrc EQ 0. | |
IF lv_col = 1. | |
gs_tables-name = ls_excel-value. | |
TRANSLATE gs_tables-name TO UPPER CASE ."get the table name | |
ENDIF. | |
IF lv_col = 2.. | |
lv_cond = ls_excel-value. | |
APPEND lv_cond to gt_cond."get conditions | |
ENDIF. | |
IF lv_col = 3.. | |
lv_cond = ls_excel-value. | |
APPEND lv_cond to gt_cond."get conditions "its for second condition if you want | |
ENDIF. | |
ENDIF. | |
AT END OF row. | |
APPEND gs_tables TO gt_tables. | |
CLEAR gs_tables. | |
ENDAT. | |
ENDLOOP. | |
READ TABLE gt_tables INTO gs_tables INDEX 1. | |
SELECT * INTO CORRESPONDING FIELDS OF TABLE <gfs_tab> | |
FROM (gs_tables-name) | |
WHERE (gt_cond). | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment