Sunday, December 19, 2010
Posted by Venkat.O at 12:20 AM
We can use the Function module TEXT_CONVERT_XLS_TO_SAP to read the Excel file into the internal table. From this internal table you can fill the target internal table.
We can use the Function module TEXT_CONVERT_XLS_TO_SAP to read the Excel file into the internal table. From this internal table you can fill the target internal table.
REPORT ztest_notepad. DATA: BEGIN OF it_data OCCURS 0, bukrs TYPE t001-bukrs, butxt TYPE t001-butxt, ort01 TYPE t001-ort01, END OF it_data. TYPE-POOLS:truxs. DATA:it_tab_raw_data TYPE truxs_t_text_data. "Call TEXT_CONVERT_XLS_TO_SAP fm CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP' EXPORTING i_tab_raw_data = it_tab_raw_data i_filename = 'C:\test.xls' TABLES i_tab_converted_data = it_data EXCEPTIONS conversion_failed = 1 OTHERS = 2. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. "Loop the data table LOOP AT it_data. WRITE:/ it_data-bukrs,it_data-butxt, it_data-ort01. ENDLOOP. ENDIF.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Step by step tutorial on Smart Forms - Template Node
- ABAP - Sending email with pdf attachment
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
0 comments:
Post a Comment
Your useful comments, suggestions are appreciated.Your comments are moderated.