Tuesday, December 21, 2010
REPORT ztest_program. DATA: BEGIN OF it_t001 OCCURS 0, bukrs TYPE t001-bukrs, butxt TYPE t001-butxt, ort01 TYPE t001-ort01, land1 TYPE t001-land1, waers TYPE t001-waers, spras TYPE t001-spras, ktopl TYPE t001-ktopl, waabw TYPE t001-waabw, END OF it_t001. DATA: BEGIN OF it_app_file OCCURS 0, data TYPE string, END OF it_app_file. CLASS cl_abap_char_utilities DEFINITION LOAD. CONSTANTS:hor_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab. PARAMETERS : p_file(150) TYPE c. START-OF-SELECTION. "Open file for reading OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT. IF sy-subrc EQ 0. DO. READ DATASET p_file INTO it_app_file-data. IF it_app_file IS INITIAL. "If file ends or if does not have data EXIT. ELSE. "Splitting TAB delimited data into into internal table SPLIT it_app_file-data AT hor_tab INTO it_t001-bukrs it_t001-butxt it_t001-ort01 it_t001-land1 it_t001-waers it_t001-spras it_t001-ktopl it_t001-waabw. APPEND it_t001. CLEAR it_t001. ENDIF. ENDDO. ENDIF. "close file CLOSE DATASET p_file. LOOP AT it_t001. WRITE:/ it_t001-bukrs, it_t001-butxt, it_t001-ort01, it_t001-land1, it_t001-waers, it_t001-spras, it_t001-ktopl, it_t001-waabw. ENDLOOP.
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.