Excel upload
*&---------------------------------------------------------------------*
*& Report ZJTEST_EXCEL_UPLOAD
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZJTEST_EXCEL_UPLOAD.
TYPE-POOLS truxs.
*TABLES : zscarr.
Types : Begin of wa ,
matnr(50) type c,
werks(10) type c,
mtart(20) type c,
maktx(20) type 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.
*& Report ZJTEST_EXCEL_UPLOAD
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZJTEST_EXCEL_UPLOAD.
TYPE-POOLS truxs.
*TABLES : zscarr.
Types : Begin of wa ,
matnr(50) type c,
werks(10) type c,
mtart(20) type c,
maktx(20) type 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
Post a Comment