17.08.2013 Views

Data Interfaces

Data Interfaces

Data Interfaces

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example: Reading a File<br />

© SAP AG<br />

REPORT RSFFF01E.<br />

TABLES SFLIGHT.<br />

* INCLUDE RSFFF01B.<br />

DATA: BEGIN OF REC,<br />

CARRID LIKE SFLIGHT-CARRID,<br />

CONNID LIKE SFLIGHT-CONNID,<br />

FLDATE LIKE SFLIGHT-FLDATE,<br />

PLANETYPE LIKE SFLIGHT-PLANETYPE,<br />

END OF REC.<br />

PARAMETERS<br />

FILE(20) DEFAULT '/tmp/RSFFF01A'<br />

LOWER CASE.<br />

START-OF-SELECTION.<br />

OPEN DATASET FILE FOR INPUT.<br />

DO.<br />

READ DATASET FILE INTO REC.<br />

IF SY-SUBRC NE 0. EXIT. ENDIF.<br />

WRITE: / REC-CARRID,REC-CONNID,<br />

/ REC-FLDATE,REC-PLANETYPE.<br />

ULINE.<br />

ENDDO.<br />

CLOSE DATASET FILE.<br />

First you define the structure to be read. In this example, it is a field string. It can also be transferred<br />

from an include report.<br />

The structure used for reading with READ DATASET must match the structure used for writing with<br />

TRANSFER.<br />

You read the data records into your structure within a loop and process them.<br />

READ DATASET does not require a logical database. You can therefore analyze your extract data<br />

along with data from any logical database (which you then specify in the report attributes).

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

Saved successfully!

Ooh no, something went wrong!