‎2008 Jul 04 8:23 AM
Hi All,
I am trying to do archiving of files to PO line item for which I am calling BAPI_DOCUMENT_CREATE to create the document first.
After execution of BAPI i am getting document number but when i check the same through CV03N then it gives me error as document does not exist in system.
Pls guide me whether anything else is required to do here so that document is created in system.
This is very urgent so pls helo ASAP.
Points will be rewarded....
Regards,
Ashutosh
‎2008 Jul 04 8:26 AM
Hi,
I think we need to use FM BAPI_TRANSACTION_COMMIT intored to ssave to database tablle.
After the FM BAPI_DOCUMENT_CREATE process is done explcity we need to have commit work FM
Reward if helpful.
Regards
Chandralekha
‎2008 Jul 04 8:26 AM
Hi,
I think we need to use FM BAPI_TRANSACTION_COMMIT intored to ssave to database tablle.
After the FM BAPI_DOCUMENT_CREATE process is done explcity we need to have commit work FM
Reward if helpful.
Regards
Chandralekha
‎2008 Jul 04 8:26 AM
hi,
you need to run BAPI_TRANSACTION_COMMIT after executing BAPI_DOCUMENT_CREATE
regards,
Peter
‎2008 Jul 04 8:39 AM
hi...
use the following BAPI.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = i_return1.
This is neceessary after every BAPI called for creation of document.
whatever document number is generated will get generated in the system as well after this function module..
‎2008 Jul 04 9:03 AM
Make sure you are using the CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
Also make sure its not running in test mode.
thanks
‎2008 Jul 07 10:08 AM
Hi,
Use the Bapi's latest version i.e "BAPI_DOCUMENT_CREATE2" and then call the Commit function module.
Sample code given below.....
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
documentdata = wa_docdata
pf_http_dest = c_http_dest
IMPORTING
documenttype = v_doc_type
documentnumber = v_doc_number
documentversion = v_doc_version
return = v_return
TABLES
documentdescriptions = i_documentdescriptions
documentfiles = documentfiles
objectlinks = objectlinks
longtexts = longtexts.
IF v_return-type CA 'EA'.
ROLLBACK WORK.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
Thanks and Regards
Senthil Kumar A
‎2008 Jul 07 10:41 AM
hi ashutosh,
Try using simple COMMIT WORK also after execution of BAPI.
Regards,
SUDHIR MANJAREKAR