I have created a custom function module using the SAP Standard Function module BAPI_PROJECT_MAINTAIN. This Custom Function module will be called from VB Interface. The while creating the Custom FM, I have commented the COMMIT WORK Statement which was the part of BAPI_PROJECT_MAINTAIN. I have done this because of the requirement of Commit to be called from the VB Interface.
I am calling the BAPI_TRANSACTION_COMMIT from my VB Code after I made a Call to my Custom FM and the Return Code of this Custom FM is a success.
The Return Code of this BAPI_TRANSACTION_COMMIT is also success, but the commit is not happenning, because when I go and check the PROJ Table, it has not created the Project.
Can soneone tell me why an external commit from another application is not working for this custom FM(Which is based on BAPI_PROJECT_MAINTAIN).
Thanks in Advance.
The first thing to do would be to create a test sequence in SE37, of first your custom function and then the BAPI_TRANSACTION_COMMIT. This executes the two functions one after the other in a single sequence. If this works, then you have a problem with your VB application.
In the VB application you should be calling your function and the commit within the one thread. So you should open a connection, call the function, and then call the commit bapi, before closing your connection. If you close the connection first, or call the commit in another thread, then the update wont occur.
As it is suggested above first try to test whether data you pass to BAPI_PROJECT_MAINTAIN are correct and if project is created in SAP environment. If yes you have problem in VB.
One additional suggestions:
You must include command:
METHOD_PROJECT-METHOD = 'Save'.
in your BAPI call.
If you have problem with this BAPI you can also turn on creation of log file via command:
METHOD_PROJECT-OBJECTTYPE = 'Trace'.
METHOD_PROJECT-METHOD = 'Create'.
METHOD_PROJECT-OBJECTKEY = filename.
Message was edited by: Krzysztof Konitz