Hello Gurus,
i am trying to create document entries in CV12 using BAPI - BAPI_DOCUMENT_CHANGE2.
But when i try to add single document through BAPI all existing documents are getting deleted automatically and new one getting added and i am not able to see that in CV13.
I have tried by getting all existing documents details using BAPI - BAPI_DOCUMENT_GETDETAIL2 and pass existing documents along with new document then this is working fine and i can see all documents in CV13.
Please suggest what should i do so existing documents will not get deleted when i pass single document.
i am passing values as below.
ls_docdata-DOCUMENTTYPE = 'INV'.
ls_docdata-DOCUMENTNUMBER = '0000000000000010000000134'.
ls_docdata-DOCUMENTVERSION = '00'.
ls_docdata-DOCUMENTPART = '000'.
ls_docdatax-DOCUMENTTYPE = 'X'.
ls_docdatax-DOCUMENTNUMBER = 'X'.
ls_docdatax-DOCUMENTVERSION = 'X'.
ls_docdatax-DOCUMENTPART = 'X'.
ls_docstr-DOCUMENTTYPE = 'INV'.
ls_docstr-DOCUMENTNUMBER = '0000000000000010000000134'.
ls_docstr-DOCUMENTPART = '000'.
ls_docstr-DOCUMENTVERSION = '00'.
ls_docstr-QUANTITY = '1'.
append ls_docstr to lt_docstr.
CALL FUNCTION 'BAPI_DOCUMENT_CHANGE2'
EXPORTING
DOCUMENTTYPE = 'FOL'
DOCUMENTNUMBER = 'INVOICES'
DOCUMENTPART = '000'
DOCUMENTVERSION = '00'
DOCUMENTDATA = ls_docdata
DOCUMENTDATAX = ls_docdatax
IMPORTING
RETURN = ls_return
TABLES
DOCUMENTSTRUCTURE = lt_docstr.
bapi commit.
Regards
Sanja