01-08-2008 12:26 PM
Hi,
I am using BAPI: BAPI_CONTRACT_CREATEFROMDATA.
After which i want to use the bapi : BAPI_TRANSACTION_COMMIT.
Could anyone please tell me how do i go about it.
Thanks,
Riya.
01-08-2008 12:33 PM
some of the bapi's are not auto committed then u need to use this commit bapi, other wise data is not stored in database.
rewards some points if helpful
madhavi
01-08-2008 12:33 PM
Hi,
After calling BAPI_CONTRACT_CREATEFROMDATA with the appropriate parameters and if this BAPI has succeeded (contract has been created successfully do the following:
if not SALESDOCUMENT is initial. "contract document created
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = ' '.
else.
" issue error messages as the contract has not been created
endif.
Reward if helpful.
Regards,
George
01-08-2008 12:35 PM
Hi George,
I would like to know whether should we write anything in the IMPORTING parameter i.e.
IMPORTING
RETURN =
Thanks.
Riya.
01-08-2008 12:49 PM
Hi,
No Need to pass anything to RETURN parameter.
When u pass the data to the BAPI, every bapi will return some messages which are populated in the Return Parameter.
So system will return the RETURN parameter.
Before using :" BAPI_TRANSACTION _COMMIT". check the Rerturn - TYPE, ( Message type: S Success, E Error, W Warning, I Info, A Abort) .
If Rerturn - TYPE = 'S' " i.e susscess.
Call FM :" BAPI_TRANSACTION _COMMIT".
Endif.
Rvert back if nay issues,
Regards
Naveen
01-09-2008 8:41 AM
Hi,
I suggest you pass a table to the RETURN parameter in order to be able to get any error or warning messages created and show them to the user so that the user knows exactly what went wrong in case the transaction fails. However, this is not mandatory but personally, I always get the messages returned from SAP and inform the user appropriately.
Regards,
George
01-09-2008 8:48 AM
Oh k!
But in that case i want to know whether it is the same table i use in BAPI_CONTRACT_CREATEFROMDATA.
Thanks,
Riya.
01-08-2008 12:33 PM
some of the bapi's are not auto committed then u need to use this commit bapi, other wise data is not stored in database.
rewards some points if helpful
madhavi