Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Doubt about BAPI_MATERIAL_SAVEREPLICA and COMMIT / ROLLBACK

This BAPI allows to create or modify several materials at once. My doubt is how the transaction should be handled. As you know common practice after any BAPI execution is to check for errors in RETURN table, then if some are found call BAPI_TRANSACTION_ROLLBACK or else call BAPI_TRANSACTION_COMMIT.

In the case of this BAPI, following this approach with a batch of e.g. 100 materials, causes that if even only one of them has errors, all the remaining 99 are also not updated. Also, the application log is not saved in SLG1 even if using NOAPPLLOG = space.

The possible solutions I see would be a) to update 1 material at a time (which is pointless since BAPI_MATERIAL_SAVEDATA should be used for that, and also would hurt performance), OR b) call BAPI_TRANSACTION_COMMIT in any case (errors or not).

I haven't found any piece of documentation in function module nor OSS/SMP about this issue. So I'm afraid that doing this would cause any kind of inconsistencies. Also, I don't fully understand the role of the NO_ROLLBACK_WORK parameter (it rollbacks the whole update or the single errored material?).

I've run out of time for investigating this further so I'd appreciate comments from people experienced in using this BAPI.

Many thanks and regards

Tags:

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question