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: Creating a File<br />

© SAP AG<br />

REPORT RSFFF01A.<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 OUTPUT.<br />

GET SFLIGHT.<br />

MOVE-CORRESPONDING SFLIGHT TO REC.<br />

TRANSFER REC TO FILE.<br />

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

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

ULINE.<br />

END-OF-SELECTION.<br />

CLOSE DATASET FILE.<br />

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

help field, the header liner of an internal table or an ABAP/4 Dictionary work area.<br />

The field string can also be transferred from an include report.<br />

Next, you fill the structure. In principle, all statements that perform a value assignment can be used<br />

here. Examples include MOVE, COMPUTE, MOVE-CORRESPONDING, MOVE TO and WRITE<br />

TO. Refer also to the relevant online documentation.<br />

Finally, you transfer the structure with the TRANSFER statement.

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

Saved successfully!

Ooh no, something went wrong!