Sunday, December 26, 2010
This sample program creates dynamic internal table based on table given on selection. It reads data from database, downloads data to provided path.
REPORT ztest_program. DATA: gv_dref TYPE REF TO data, file_name TYPE string. *FIELD-SYMBOLS FIELD-SYMBOLS: <tab> TYPE STANDARD TABLE. PARAMETERS:p_table TYPE rsrd1-tbma_val. *" START-OF-SELECTION START-OF-SELECTION. CREATE DATA gv_dref TYPE TABLE OF (p_table). ASSIGN gv_dref->* TO <tab>. SELECT * FROM (p_table) INTO TABLE <tab> UP TO 10 ROWS. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING filename = 'C:\temp\test.txt' filetype = 'ASC' WRITE_FIELD_SEPARATOR = 'X' TABLES data_tab = <tab>. IF sy-subrc = 0. WRITE 'successfully downloaded'. 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.