‎2012 Jun 20 5:45 PM
Hi all,
I'm using BAPI_ACC_DOCUMENT_POST and BAPI_TRANSACTION_COMMIT to post documents in a program. After the documents are posted I see in transaction FB03 and
the document is visible but the Reference Document Number is empty.
I checked the return table and it has the message "Document posted successfully: BKPFF 180000004030002012 QASCLNT010".
I found this thread http://scn.sap.com/thread/1367599
And I added the parameters obj_type, obj_key, obj_sys without any value.
But the reference remains empty after that change.
I filling the following fields:
DOCUMENTHEADER:
bus_act
username
header_txt
comp_code
doc_date
pstng_date
fisc_year
fis_period
doc_type
ACCOUNTGL:
itemno_acc
gl_account
item_text
comp_code
plant
fis_period
fisc_year
pstng_date
value_date
tax_code
costcenter
ACCOUNTRECEIVABLE:
itemno_acc
customer
gl_account
comp_code
pmnttrms
bline_date
item_text
tax_code
CURRENCYAMOUNT:
itemno_acc
currency
amt_doccur
amt_base
tax_amt
Am I missing something? I appreciate any guidance.
‎2012 Jun 20 6:03 PM
Karina,
Are you populating field REF_DOC_NO for DOCUMENT HEADER. ?
Raj
‎2012 Jun 20 6:03 PM
Karina,
Are you populating field REF_DOC_NO for DOCUMENT HEADER. ?
Raj
‎2012 Jun 20 6:24 PM
No, in document header I'm just populating fields:
bus_act , username, header_txt, comp_code, doc_date, pstng_date, fisc_year, fis_period, doc_type.
‎2012 Jun 20 6:28 PM
You need to pass the REF_DOC_NO to the DOCUMENTHEADER. This field is responsible to update the reference field in the acc document.
‎2012 Jun 20 6:37 PM
‎2012 Jun 20 6:42 PM
so then what make you think that system is going to populate ref document number by itself ????
Raj
‎2012 Jun 20 7:26 PM
What I read in this thread http://www.stechno.net/sap-notes.html?view=sapnote&id=561175
‎2012 Jun 21 5:31 AM
Hi,
In general if you do not know which fields to populate in BAPI so as to get the desired field, follow the procedure. In most of the cases you will get the field required to be populated to get the desired field.
In this case you want to get the value in BLPF-XBLNR. So You know it has to be populated in BAPI in the header structure 'DOCUMENTHEADER'. so Se11--->'DOCUMENTHEADER' . This has been defined as LIKE 'BAPIACHE09'. So double click on 'BAPIACHE09'. Find ( Control F ) XBLNR. This is appearing against the field 'REF_DOC_NO'. This is useful because most of the BAPI's are very 'Pooerly' documented.
I hope you wont have such issue in future for any of the BAPI's.
Regards
Raju Chitale
‎2012 Jun 21 5:05 PM
Hi Raju, I assume you mean BKPF-XBLNR. Thanks for this really useful tip.
Regards,
Karina Hurtado