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.

Example: Variable Format (Read)<br />

© SAP AG<br />

REPORT RSFFF01H.<br />

TABLES: SBC420A, SBC420B.<br />

DATA: FLAG.<br />

PARAMETERS<br />

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

LOWER CASE.<br />

START-OF-SELECTION.<br />

OPEN DATASET FILE FOR INPUT<br />

IN BINARY MODE.<br />

DO.<br />

READ DATASET FILE INTO FLAG.<br />

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

CASE FLAG.<br />

WHEN 'A'.<br />

READ DATASET FILE INTO SBC420A.<br />

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

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

WHEN 'B'.<br />

READ DATASET FILE INTO SBC420B.<br />

WRITE: / SBC420B-BOOKID, SBC420B-CUSTID,<br />

SBC420B-CUSTYP, SBC420B-CLASS.<br />

ENDCASE.<br />

ENDDO.<br />

END-OF-SELECTION.<br />

CLOSE DATASET FILE.<br />

The above program reads the data records of the file created with the previous program.<br />

The program assumes that an ID (‘A’ or ‘B’) precedes each data record.<br />

The file is opened in binary mode and the records are read in the length of the structure specified.

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

Saved successfully!

Ooh no, something went wrong!