Using a BAPI or an RFC function that accepts table input

The preferred method of reading or writing data to ECC is to use a BAPI. If no BAPI is available to do what you need to have done, the second best way is to use an RFC function that writes data back to ECC. If you do not find an appropriate RFC, you may want to create your own RFC that does the job. If you have none of the options mentioned here, refer to the next section, "Transaction-based activity."

Writing data to ECC using a BAPI or RFC is very similar to reading data from ECC.

Here is an ABAP code example of an RFC function that writes data to ECC:
*"   EXPORTING        
*"          RFCRC LIKE  SY-SUBRC           
*"          ERROR_TEXT LIKE  T100-TEXT     
*"   TABLES           
*"   EXCEPTIONS       
*"          UPDATE_ERROR  


The Metadata takes the name of the table indicated by RFC_CUSTOMER_UPDATE. Enter the Metadata table name for the SAP source in the HEI activity document "Table Name" field as follows:

By entering "*", you can work with the entire interface to RFC_CUSTOMER_UPDATE. This allows you to map the EXPORTS back to the source using output parameter support.

Field mapping

Keep in mind that the fields contained in an RFC/BAPI table are referred to by concatenating the name of the table with the actual field name. As an example, note that table CUSTOMER_T has the structure BRFCKNA1, as above in the section entitled "Field Mapping".

To access output parameter support for your Direct Transfer activity, select "Target Metadata is Stored Procedure" and then select "Accept Return Values into Source". This will display a field mapping section where you can enter field mapping that will take data from the EXPORTS of your RFC, BAPI or TRANSACTION and send them back to the Source.

Note: When your Target is an RFC or BAPI and you enable the "Accepting Return Values into Source" option, only one record at a time is transferred.

Note: If you do not want to use the "Accept Return Values into Source" option, do not select "Target Metadata is Stored Procedure". For a Transaction, however, the "Target Metadata is Stored Procedure" box must always be enabled.