‎2011 Dec 20 3:21 PM
I am working on a existing code in which BAPI_GOODSMVT_CREATE, was called three times successively.
Here is the older code (in which there was a problem):
Step 1. With movement type 261.
Step 2. With movement type 101.
Step 3. With movement type 532.
Step 4. BAPI_TRANSACTION_COMMIT in WAIT mode.
In this case I required a Smartform to be triggered during database update. The Smartform was not getting triggered.
After examination of the control flow, I added a extra commit in between step 2 and 3. To my surprise the Smartform was getting printed fine.
Here is the modified code (in which the problem was solved).:
Step 1. With movement type 261.
Step 2. With movement type 101.
Step 3. BAPI_TRANSACTION_COMMIT in WAIT mode.
Step 4. With movement type 532.
Step 5. BAPI_TRANSACTION_COMMIT in WAIT mode.
-
I am unable to understand why it worked when I added the COMMIT between 101 and 532 movement type calls.
‎2011 Dec 20 5:28 PM
Hi
See SAP Note 520813 - FAQ: BAPIs for goods movements, question 12.
I hope this helps you
Regards
Eduardo
‎2011 Dec 20 5:28 PM
Hi
See SAP Note 520813 - FAQ: BAPIs for goods movements, question 12.
I hope this helps you
Regards
Eduardo
‎2011 Dec 20 6:03 PM
Thank you Hinojosa.
In fact I did go through this note from earlier discussions in SDN. However, I was unable to determine the solution to my problem from the ocean of information that this SAP Note and others related to it provide.
I shall surely go through the note you suggested and the ones related to it in much details, to understand the case.
I admit my solution was a based on trial and error approach. I do not completely understand my solution till now.
However, since I have already fixed my problem, the only thing that haunts me is whether my approach towards solving this problem was correct or not !
I am keeping this thread open. I shall revert back with the doubts that I face, while going through the notes.
‎2011 Dec 20 6:21 PM
HI Ghosh,
There is no relation between bapi_goodsmvt_create and bapi_transcation_commit . But we should call bapi_transcation_commit after using standard bapi, because these bapis are created entries in standard data base tables , with out commit work and wait
data base tables are not updated they need some time to update this table entries , while using bapi_transcation_commit it stops the system it commits the work process , other wise instead of bapi_transcation_commit , try with commit work and wait that will also work fine. some bapis already exit bapi_transcation_commit in source code , for that bapis we dont need tun this bapi again.
if you execute this bapis through fm tcode se37 , you must run this bapis in sequence , for this se37 --> functionmodule in menu bar,test sequence --> bapi_goodsmvt_create, bapi_transcation_commit.
check the source code of bapi_transcation_commit once then you get clear picture .
Regards
Siva
‎2011 Dec 20 6:45 PM
Thanks Siva for your reply.
It seems to me, that I have mislead you by my thread's improper heading.
I am looking for an answers to the question:
"What is it in placement of the commit, between 101 and 532 movement type, that could have solved my problem?"
I am unable to understand, how does this extra commit solved the problem. There was already a commit at the very end earlier, yet it did not work in that previous case.