Write data to the file on presentation server

 

    * Transfer the data into desktop or presentation server.

    * Task: I want to see student details in local system not in sap table based on student id.

    Code

    REPORT zajay_file_download.
    TABLES:zajay_zstu.
    TYPESBEGIN OF ty_zstu,
             zst_id   TYPE zajay_zstu-zst_id,
             zst_name TYPE zajay_zstu-zst_name,
             zst_dept TYPE zajay_zstu-zst_dept,
             zst_fee  TYPE zajay_zstu-zst_fee,
           END OF ty_zstu.
    datait_zstu type table of ty_zstu,
          wa_zstu type ty_zstu.
    select-OPTIONS s_id for zajay_zstu-zst_id.
    IF s_id is NOT INITIAL.
      SELECT zst_id
              zst_name
              zst_dept
              zst_fee
              from zajay_zstu
              into TABLE it_zstu
              WHERE zst_id in s_id.

    ENDIF.
   CALL FUNCTION 'GUI_DOWNLOAD'
   EXPORTING
    filename 'C:\Users\JFR2KOR\Desktop\student details.txt'
    WRITE_FIELD_SEPARATOR  'X'
   tables
        data_tab              it_zstu.

    

    * Create a empty text file.

    Input


       * After successful execution

            


     Output

            * Initially file is empty.

        * Check that student details text file.

                





    Table

        





Comments

Popular posts from this blog

New syntax for append- VALUE (new syntax 7.4+) in ABAP

Read statement new syntax in ABAP. (7.4+).

Concatenation new syntax( 7.4+ ).