Excel upload

*&---------------------------------------------------------------------*
*& Report  ZJTEST_EXCEL_UPLOAD
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ZJTEST_EXCEL_UPLOAD.

TYPE-POOLS truxs.
*TABLES : zscarr.

Types Begin of wa ,
        matnr(50type c,
        werks(10type c,
        mtart(20type c,
        maktx(20type c,
      End of wa.

Data itab type table of wa.
data itab_wa type wa.
data it_type TYPE truxs_t_text_data.

*PARAMETERS: p_file(300) TYPE c.
*

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
  EXPORTING
*   I_FIELD_SEPERATOR =
*   I_LINE_HEADER  = 'X'
    i_tab_raw_data it_type
    i_filename     'C:\Users\in8jatsi\Desktop\jatin_test.xlsx'

  TABLES
    i_tab_converted_data itab
  EXCEPTIONS
    conversion_failed 1
    OTHERS            2.


IF sy-subrc <> 0.
Write 'value in file'.
Loop at itab into itab_wa.
Endloop.
* Implement suitable error handling here
ENDIF.

Comments

Popular posts from this blog

Export data to xls using OOPS

Factory method ALV sap abap

Delete Selected Record in ALV Report