Share |

Downloading files to SAP Application Server


The abap code snippet below shows you how to download data from an internal table into a file on the sap application server. Use the OPEN and CLOSE dataset abap commend.


*   Download internal table to Application server file(Unix)
DATA: e_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.

  open dataset e_file for output in text mode.
  lOOP AT it_datatab......
    transfer it_datatab to e_file.
  ENDLOOP.

  close dataset e_file.