on 2025 May 05 11:28 AM
I am trying to create info records with conditions using the ME_INFORECORD_MAINTAIN_MULTI function module. When I execute the function module manually via SE37, it works perfectly. However, when I run it through my report with the exact same data, I encounter an update error when BAPI_TRANSACTION_COMMIT is called.
Upon debugging, I found that the error occurs because the function module RV_KONDITION_SICHERN_V13A is being called twice within an update task. The second call attempts to insert the same key combination into table A017 that was already inserted during the first run. Since this key combination already exists, it causes a dump.
It's important to note that I only have one condition in my info record.
Further investigation in the debugger revealed two spots where RV_KONDITION_SICHERN_V13A is called:
Inside ME_INFORECORD_MAINTAIN_MULTI, the first call happens in the ME_POST_INFORECORD subroutine (PERFORM BUCHEN), which triggers RV_CONDITION_SAVE.
After ME_POST_INFORECORD, the method post_conditions() is called, which also triggers RV_CONDITION_SAVE in the update task.
When I execute the function module in SE37, the first call does not trigger the condition save, and
cl_mmpur_bapi_po=>check_repid_loaded( 'ME_INFORECORD_MAINTAIN_MULTI==FT' )returns abap_true because ME_INFORECORD_MAINTAIN_MULTI==FT exists in the call stack. As a result, the function proceeds without entering RV_CONDITION_SAVE, where RV_KONDITION_SICHERN_V13A is called.
Call stack from se37:
Call stack from se38 (my custom report):
Any ideas on how to resolve it?
Request clarification before answering.
| User | Count |
|---|---|
| 7 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.