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 in the <strong>Data</strong> and Creating Sessions<br />

© SAP AG<br />

CALL FUNCTION 'BDC_OPEN_GROUP'<br />

EXPORTING CLIENT = SY-MANDT<br />

GROUP = NAME<br />

USER = 'BC420BDC'<br />

KEEP = 'X'.<br />

DO.<br />

READ DATASET FILE INTO REC.<br />

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

WRITE: / REC-ID USING NO EDIT MASK,<br />

REC-POSTCODE, REC-CUSTTYPE.<br />

PERFORM GENERATE_BDC_DATA.<br />

CALL FUNCTION 'BDC_INSERT'<br />

EXPORTING TCODE = 'TFBA'<br />

TABLES DYNPROTAB = BDC_TAB.<br />

ENDDO.<br />

CALL FUNCTION 'BDC_CLOSE_GROUP'.<br />

WRITE: / TEXT-002,<br />

SY-MANDT, NAME, SY-UZEIT.<br />

END-OF-SELECTION.<br />

CLOSE DATASET FILE.<br />

You require the function modules for opening and closing sessions.<br />

To insert the data in the session, you set up the BDC table in a subroutine and call the function module<br />

BDC_INSERT.<br />

You set up the BDC table and call the subroutine in a loop for reading in the data with READ<br />

DATASET.<br />

The called subroutine is similar to the subroutine in the first program example.

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

Saved successfully!

Ooh no, something went wrong!