File Handling


What are datasets in ABAP?

The sequential files (on application server) are called datasets. They are used for file handling in SAP.

What is Dataset and how you use it?

The sequential files (on application server) are called datasets. They are used for file handling in SAP.
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.

Below are the list of modes used for processing along with above -

  • 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.
  • 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.

WHAT are the commands that allow you to process sequential file? And what is their syntax?

  • OPEN DTASET for <input/output> in mode at POSITION MESSAGE
  • READ DATASET (reading)
  • READ DATASET INTO
  • TRANSFER (writing)
  • CLOSE DATASET
  • DELETE DATASET
  • TRANSFER to

What is the process for transferring data from legacy system to SAP?

FTP file transfer, manufacturer specific field transfer, NFS (network file system) / BDC.

Explain the process to transfer a record to a dataset?

TRANSFER to.

Why batch input?

Batch input is one of the primary ways to transfer the data into the SAP system. Batch input used to input a large amount of information at off-peak times. Batch input is used for bulk data transfers and not for real-time data transfers.

Explain at high level, the batch input process?

Batch data places into queues called batch input sessions and then execute the application programs for maintenance into the database.

What are the function modules associated with batch input?

These are the 3 functional modules that are used in a sequence to perform a data transfer successfully using BDC programming -

  • BDC_OPEN_GROUP - Parameters like Name of the client, sessions and username are specified in these functional modules.
  • BDC_INSERT - It is used to insert the data for one transaction into a session.
  • BDC_CLOSE_GROUP - This is used to close the batch input session.

What is the meaning of Field group, extract data set?

Extract data sets are made of group of records. Every record may have same structure, or a record may have different structure from other. Every record type of an extract dataset can be defined as a field group with the statement FIELD GROUPS. The FIELD GROUPS statement brings multiple fields together with providing one single name.
Field groups do not generate field space however they show the fields that already exist. Field groups shows the records content if the records are met in the extract dataset.

For reading we use READ DATASET, for writing we use TRANSFER and for mode at POSITION MESSAGE, OPEN DATASET.

  • READ DATASET INTO
  • CLOSE DATASET
  • DELETE DATASET
  • TRANSFER