17.08.2013 Views

Data Interfaces

Data Interfaces

Data Interfaces

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Reading <strong>Data</strong> Records<br />

© SAP AG<br />

READ DATASET INTO .<br />

Sequential<br />

file<br />

data<br />

record<br />

Each READ DATASET statement reads one record from a sequential file into a field or structure.<br />

Possible structures are field strings or table work areas.<br />

The execution of the READ DATASET statement depends on the mode:<br />

- Binary mode: Reads the length of the structure.<br />

- Text mode: Reads a line.<br />

If the specified file is not open, READ DATASET tries to open the file (IN BINARY MODE FOR<br />

INPUT or with the options of the last OPEN DATASET statement for this file).<br />

If the end of the file is reached, SY-SUBRC is set to 4. Otherwise it is set to 0. If the file cannot be<br />

opened, SY-SUBRC contains the value 8. Errors result in program termination.<br />

READ DATASET, like TRANSFER, does not perform conversions implicitly. The data is read in as it<br />

was written.<br />

The additional parameter LENGTH of the READ DATASET statement allows you to specify<br />

a length in bytes (in the format READ DATASET INTO LENGTH ).<br />

In this case, the exact number of characters specified in is read from the data record into the<br />

structure. If the structure is shorter, the record is padded (with blanks in text mode and with<br />

hexadecimal zeros in binary mode). If the structure is longer, the record is truncated.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!