10-08-2008 1:23 PM
Hi,
I am executing BAPI_ACC_DOCUMENT_POST bapi successfully showing 'S' flag msg.
like this -> 'S RW 605 Document posted successfully: BKPFF DOCUMENT NUMBER DV1CLNT400'.
but not genrated Accounting Document Number. Why ?
NOTE : I used commit work also.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = gd_documentheader
customercpd = gd_customercpd
contractheader = gd_fica_hd
IMPORTING
obj_type = l_type
obj_key = l_key
obj_sys = l_sys
TABLES
accountgl = it_accountgl
accountreceivable = it_accountreceivable
accountpayable = it_accountpayable
accounttax = it_accounttax
currencyamount = it_currencyamount
criteria = it_criteria
valuefield = it_valuefield
extension1 = it_extension
return = it_return
paymentcard = it_paymentcard
contractitem = it_fica_it.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
10-08-2008 1:30 PM
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = docheader
TABLES
accountgl = gltable
accountreceivable = artable
currencyamount = aramounts
return = returntab.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
REFRESH : docheader, docheader[], gltable, gltable[], artable,
artable[], aramounts, aramounts[], returntab,returntab[].
10-08-2008 1:40 PM
10-09-2008 10:32 AM
You don't get the number in return. You have to search for it after commit.
Try BAPI_ACC_DOCUMENTS_RECORD with
obj_type = l_type
obj_key = l_key
obj_sys = l_sys
in EXTERNAL_DOCUMENTS.
Then loop ACCOUNTING_DOCUMENTS, rec_key should contain account document number.
Regards,
Allan Finden
11-14-2008 9:42 AM