Uplode file to excel to internal table
CALL FUNCTION 'TEXT_CONVERT_ XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = lt_type
i_filename = p_file
TABLES
i_tab_converted_data = it_upload* EXCEPTIONS
* CONVERSION_FAILED = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
* CALL FUNCTION 'ALSM_EXCEL_ TO_INTERNAL_TABLE'
* EXPORTING
* filename = p_file
* i_begin_col = '1'
* i_begin_row = '2'
* i_end_col = '17'
* i_end_row = '9999'
* TABLES
* intern = it_inter.
*
*
* IF sy-subrc NE 0.
* MESSAGE ID sy-msgid
* TYPE sy-msgty
* NUMBER sy-msgno
* WITH sy-msgv1 sy- msgv2 sy-msgv3 sy-msgv4.
* ELSE.
*
*
* LOOP AT it_inter INTO wa_ inter.
* CLEAR: lv_bldat, lv_ budat.
* CASE wa_inter-col.
* WHEN '0001'.
* wa_upload-customer = wa_inter-value.
* WHEN '0002'.
* wa_upload-delar_ code = wa_inter-value.
* WHEN '0003'.
* wa_upload-model = wa_inter-value.
* WHEN '0004'.
* wa_upload-qty = wa_ inter-value.
* WHEN '0005'.
* wa_upload-price_sm = wa_inter-value.
* WHEN '0006'.
* wa_upload-total_pm = wa_inter-value.
* WHEN '0007'.
* wa_upload-credit_ am = wa_inter-value.
* WHEN '0008'.
* wa_upload-po_num = wa_inter-value.
* WHEN '0009'.
* wa_upload-po_date = wa_inter-value.
* WHEN '0010'.
* wa_upload-do_valu = wa_inter-value.
* WHEN '0011'.
* wa_upload-cust_ name = wa_inter-value.
* WHEN '0012'.
* wa_upload-cust_fn = wa_inter-value.
* WHEN '0013'.
* wa_upload-phone_ num = wa_inter-value.
* ENDCASE.
* AT END OF row.
* APPEND wa_upload TO it_upload.
* CLEAR wa_upload.
* ENDAT.
* ENDLOOP.
* ENDIF.
EXPORTING
* I_FIELD_SEPERATOR
i_line_header
i_tab_raw_data
i_filename
TABLES
i_tab_converted_data
* CONVERSION_FAILED
* OTHERS
.
IF sy-subrc <> 0.
* Implement suitable error
ENDIF.
* CALL FUNCTION 'ALSM_EXCEL_
* EXPORTING
* filename = p_file
* i_begin_col = '1'
* i_begin_row = '2'
* i_end_col = '17'
* i_end_row = '9999'
* TABLES
* intern = it_inter.
*
*
* IF sy-subrc NE 0.
* MESSAGE ID sy-msgid
* TYPE sy-msgty
* NUMBER sy-msgno
* WITH sy-msgv1 sy-
* ELSE.
*
*
* LOOP AT it_inter INTO wa_
* CLEAR: lv_bldat, lv_
* CASE wa_inter-col.
* WHEN '0001'.
* wa_upload-customer
* WHEN '0002'.
* wa_upload-delar_
* WHEN '0003'.
* wa_upload-model =
* WHEN '0004'.
* wa_upload-qty = wa_
* WHEN '0005'.
* wa_upload-price_sm
* WHEN '0006'.
* wa_upload-total_pm
* WHEN '0007'.
* wa_upload-credit_
* WHEN '0008'.
* wa_upload-po_num =
* WHEN '0009'.
* wa_upload-po_date =
* WHEN '0010'.
* wa_upload-do_valu =
* WHEN '0011'.
* wa_upload-cust_
* WHEN '0012'.
* wa_upload-cust_fn =
* WHEN '0013'.
* wa_upload-phone_
* ENDCASE.
* AT END OF row.
* APPEND wa_upload TO
* CLEAR wa_upload.
* ENDAT.
* ENDLOOP.
* ENDIF.
Comments
Post a Comment