File Handling in abap

 File - File is place where data is stored.

File handling - File handling means the various operations like opening the file, closing the file, Deleting the file, Reading the file, writing the file etc.


1. File handling on presentation server.

        * To work with files on presentation server, Sap provided the various function modules.

        * GUI_UPLOAD - Reading data from a file on presentation server.

        * GUI_DOWNLOAD - Writing data to a file on the presentation server.


 T-code SAP directory- AL11.

2. File handling on application server.

        * To work with files on application server sap provided the below statements.

        * OPEN DATASET - Opened the specified file.

        * CLOSE DATASET- Closes the specified file.

        * DELETE DATASET- Deletes the specified file.

        * READ DATASET- Read a record from the file.

        * TRANSFER- Write a record in to a file.

3. Write data to a file on Application server.

    * OPEN DATASET (file path) FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

    * TRANSFER (DATA) To (file path).

    * CLOSE DATASET.

4. Reading data from a file on Application server.

   * OPEN DATASET (FILE PATH) FOR INPUT IN TEXT MODE ENCODING.

    * READ DATASET (FILE PATH) TO VARIBALE.

    * CLOSE DATASET.

 

5. Archiving 

       * Moving the data to new directory and deleting from the existing directory.














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+ ).