cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI failing if one line of data is faulty

Former Member
0 Kudos

Hi,

I am calling BAPI_EXCHRATE_CREATEMULTIPLE from PI. My input file has multiple lines and this BAPI can take in many lines too. If all the input values are correct, the BAPI updates the database because the RFC adapter does the BAPI commit.

If there was an error in any one of the lines, the other lines that have good data are not getting updated. I guess because the RFC adapter help says - If executed successfully, the transaction is written to the database by calling the function module BAPI_TRANSACTION_COMMIT explicitly. If an error occurs, the transaction is rolled back by BAPI_TRANSACTION_ROLLBACK.

So i belive the entire transaction is rolled back. I dont want to write a wrapper to call this bapi or i dont want to make one BAPI call for each line. I wanted to know if there is a way around this?

Regards,

Balaji.M

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

As far as i can remember is this the way how BAPI'S work.

If you don't want this BAPI to fail just generate e multi line recordstructure and for eacht record execute the BAPI.

Or be sure that before the records are send to the SAP system the messages are scanned for incompatibilities. Allthough this isn't very easy due to the fact that the BAPI also checks on content as well as context.

Greets

Former Member
0 Kudos

Basically the purpose of handling database transaction is for this purpose only i.e success commit other wise rollback in transaction

Your BAPI is failing so rollback data in a transaction

If dont need like this do invoke BAPI for each record

otherwise do some validation for source data in such a way that data passed is perfect

Rajesh