How to Read data from Excel File
wg_data2 TYPE alsmex_tabline.
DATA : l_b_col TYPE integer VALUE 1 , "Begining Column Position
l_e_col TYPE integer VALUE 12 , "Ending Column position
l_b_row TYPE integer VALUE 1 , "Begining Row position
l_e_row TYPE integer VALUE 60000 . "Ending Row position
CALL FUNCTION ’ALSM_EXCEL_TO_INTERNAL_TABLE’
EXPORTING
filename = p_p_path
i_begin_col = l_b_col
i_begin_row = l_b_row
i_end_col = l_e_col
i_end_row = l_e_row
TABLES
intern = i_data2
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3 .
IF sy-subrc EQ 0 .
LOOP AT i_data2 INTO wg_data2.
CASE wg_data2-col .
WHEN 1 .
wg_data1-pernr = wg_data2-value .
WHEN2 .
wg_data1-zname = wg_data2-value .
WHEN 3 .
wg_data1-emptyp = wg_data2-value .
ENDCASE .
AT END OF row.
APPEND wg_data1 TO i_data1.
CLEAR : wg_data1.
ENDAT .
ENDLOOP .
ELSE .
* Error Message
ENDIF .
Where are the comments?
ReplyDelete