Register Login

Dataset in ABAP/4

Updated May 18, 2018

What is dataset and how to use it?

ABAP/4 provides three statements for handling files: 

  • The OPEN DATASET statement opens a file. 
  • The CLOSE DATASET statement closes a file. 
  • The DELETE DATASET statement deletes a file. 
  • To open a file for read access, use the FOR INPUT option of the OPEN DATASET statement 
  • To open a file for write access, use the FOR OUTPUT option of the OPEN DATASET statement 
  • To open a file for appending data to the file, use the FOR APPENDING option of the OPEN DATASET statement 
  • To process a file in binary mode, use the IN BINARY MODE option of the OPEN DATASET statement 
  • To process a file in text mode, use the IN TEXT MODE option of the OPEN DATASET statement 

To open a file at a specific position, use the AT POSITION option of the OPEN DATASET statement When you work with the operating systems UNIX or WINDOWS NT, you can send an operating system command with the statement OPEN DATASET. 

To do so, use the option FILTER To receive the operating system message after trying to open a file, use the MESSAGE option of the OPEN DATASET statement To close a file on the application server, use the CLOSE DATASET statement.

To delete a file on the application server, use the DELETE DATASET statement To write data to a file on the application server, use the TRANSFER statement To read data from a file on the application server, use the READ DATASET statement.


×