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.

Generating a Sequential File for BDC Program 2<br />

© SAP AG<br />

SELECT * FROM SCUSTOM<br />

WHERE ID BETWEEN '00000001'AND '00000050'.<br />

MOVE SCUSTOM-ID TO REC-ID.<br />

IF SCUSTOM-POSTCODE(1) BETWEEN '1' AND '5'<br />

OR SCUSTOM-POSTCODE(1) BETWEEN 'A' AND 'M'.<br />

MOVE CODE1 TO REC-POSTCODE.<br />

ELSE.<br />

MOVE CODE2 TO REC-POSTCODE.<br />

ENDIF.<br />

IF SCUSTOM-CUSTTYPE EQ 'P'.<br />

MOVE CUST1 TO REC-CUSTTYPE.<br />

ELSE.<br />

MOVE CUST2 TO REC-CUSTTYPE.<br />

ENDIF.<br />

TRANSFER REC TO FILE.<br />

WRITE: / REC-ID, REC-POSTCODE, REC-CUSTTYPE.<br />

ENDSELECT.<br />

END-OF-SELECTION.<br />

CLOSE DATASET FILE.<br />

ULINE. SKIP.<br />

WRITE: / TEXT-001, FILE.<br />

In the example, we use the file created by the above program.<br />

Comment:<br />

This is only a general example. As the data for this example comes from the same SAP system, the<br />

following batch input program could also read in the data directly with ABAP/4 Open SQL or via a<br />

logical database (if available).

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

Saved successfully!

Ooh no, something went wrong!