2016 Jun 02 10:48 AM
Hi,
Short dump when calling BAPI_TRANSACTION_COMMIT after creating GR using BAPI_GOODSMVT_CREATE_OIL.
Please find attached screen short with dump details .
Kindly help me out.
2016 Jun 02 10:54 AM
Hi,
Run it without commit bapi.
According to documentation -
The method can only perform your function if no error messages were generated in the Return table. This is the case if the header data and all the items were processed successfully.
Transaction control is not implemented. The calling program therefore has to execute the Commit Work itself after this method has been successfully invoked (in other words, if no errors were reported in the Return parameter).
2016 Jun 02 11:15 AM
Hi,
Without COMMIT WORK , How GR will be saved in database.
Can you explain me in details
2016 Jun 02 12:07 PM
Hi,
You are reading only one line from bapi return table. There can multiple entries in that table. Suppose first entry is of success/warning and others contain error. In this case your BAPI_Commit won't work.
Try like this:
data: lv_flag type c.
clear lv_flag.
loop at wlt_ret into wls_ret where ret-type eq 'E'.
lv_flag = 'X'.
endloop.
if lv_flag is initial.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = '1'.
endif.
2016 Jun 02 4:00 PM
As Bala said, this is explained in details in the ABAP documentation (COMMIT WORK cannot be used in an update task), so please read it and revert back if something in the doc is not clear.
2016 Jun 03 6:55 AM
Hi Rossi,
How can I avoid this dump without commit work?
Could you please suggest to me.
Thanks in Advance.
2016 Jun 03 11:32 AM
Do you have difficulties with understanding the documentation? It's very clear. You must not use commit work (and not database commit too) because it's the pillar of the update concept! Read the doc and revert back with a more precise question (which will prove you made an effort).
2016 Jun 02 1:15 PM
Hi,
Everything is looks fine. I believe this call to BAPI_*** and corresponding commit work is inside any Function Module(and that function module is update function module).
We are not suppose to write commit work in update function module.
Just to confirm can you share the Active Calls and Event. And if there are function modules in the stack just check in se37(Attibutes->Processing Type) whether they are update function module.
Best Regards,
Vishal Kumar Yadav
2016 Jun 03 8:34 AM
Hello Vishal,
My requirement is
If Invoice created to customer then output type should be trigger. Output type should create PO, based on Purchase order GR will be created automatically.
PO created successfully, Even GR also created but it's not committed to database so no document exits when I am checking in MIGO.
There is no update FM triggered. I believe my code everything correct, Is there any customizing changes required from functional side.
Could you please suggest to me.
Thanks.
2016 Jun 03 11:37 AM
There is no update FM triggered.
Sorry but you're wrong; the COMMIT_IN_POSTING exception that you have mentioned (in your screen capture) proves that there is an update task (so there is an update FM).
Maybe you didn't understand that your code is executed by a standard update function module?
2016 Jun 03 7:32 AM
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
2016 Jun 03 9:32 AM
Is this message not clear enough?
Invalid COMMIT WORK in an update function module
Some developper coded/triggered a COMMIT WORK in an update FM, when this FM is executed in update task this trigger the dump. Correct this, find the BAdI/Exit/enhancemnt in the Abap stack of the dump (or with transaction SM13)
Hints:
Regards,
Raymond
(*) so next time you wont any longer write something like "There is no update FM triggered." when executing a COMMIT WORK...
2016 Jun 03 1:10 PM
Check if there are any custom badi or customer exit implemented , in which a commit is triggered.
Regards
Kesav