‎2012 Aug 23 8:05 AM
Hi,
Is it allowed to have a commit work or FM call bapi_transaction_commit within an inbound function module? Would we get a negative effect?
Thanks!
‎2012 Aug 23 8:25 AM
Read some documentation like Modification Concepts: IDoc Inbound Processing or Processing BAPIs in ALE Inbound Processing, those documentations prohibit use of COMMIT-WORK.
If you create a function module or use customer exits, note that no COMMIT WORK command is set, as this can lead to errors in IDoc processing and to inconsistencies in error processing. The system returns to the ALE layer following processing, where the system updates any application errors that have occured, sets the IDoc status, and may even execute database rollbacks.Regards,
Raymond
‎2012 Aug 23 8:20 AM
The reason not to include it is that a COMMIT WORK marks the end of an LUW which might well consist of more than one BAPI call. So always let the outside caller decide whether the transaction can be closed or not, e.g. based on return messages or if there are more steps involved that still need to be started.
Thomas
‎2012 Aug 23 8:22 AM
‎2012 Aug 23 8:33 AM
the requirement is that whenever a stock movement idoc is triggered, I need to do a check and possibly change the PO depending on the condition.
It would seem it is really not allowed, but how do you deal with situation like this? If you need to call a bapi within the inbound function module?
‎2012 Aug 23 9:35 AM
Check the documentation of call function in background task/separate unit or a wrapper function with starting new task. It might help.
As suggested do not use a commit during a flow as it executes the previously registered update functions.
You can also go for a custom periodic background job which uses the IDOC data from the respective tables and posts it.
‎2012 Sep 11 8:33 AM
Hi,
I have used BAPI_TRANSACTION_COMMIT (after calling BAPI,similar to ur requirement) in inbound function module and acheived desired results..but note that I have called BAPI (and BAPI COMMIT) in an exit that is triggered after standard SAP COMMIT statement is executed.
Please check if it is the case with you.. let the standard inbound FM perform its own action and commit and check for exits after that(ex: check IDOC_INPUT_ORDERS for Inbound Sales Order creation in which exits are available after Commit).
Regards,
SG.
‎2012 Aug 23 8:25 AM
Read some documentation like Modification Concepts: IDoc Inbound Processing or Processing BAPIs in ALE Inbound Processing, those documentations prohibit use of COMMIT-WORK.
If you create a function module or use customer exits, note that no COMMIT WORK command is set, as this can lead to errors in IDoc processing and to inconsistencies in error processing. The system returns to the ALE layer following processing, where the system updates any application errors that have occured, sets the IDoc status, and may even execute database rollbacks.Regards,
Raymond