Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_ACC_DOCUMENT_POST - Reference Document Number

Former Member
0 Likes
4,338

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.



1 ACCEPTED SOLUTION
Read only

Former Member
2,667

Karina,

Are you populating field REF_DOC_NO for DOCUMENT HEADER. ?

Raj

8 REPLIES 8
Read only

Former Member
2,668

Karina,

Are you populating field REF_DOC_NO for DOCUMENT HEADER. ?

Raj

Read only

0 Likes
2,667

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.


Read only

0 Likes
2,667

You need to pass the REF_DOC_NO to the DOCUMENTHEADER. This field is responsible to update the reference field in the acc document.

Read only

0 Likes
2,667

Excellent, problem solved!

Thank you so much for your help.

Read only

0 Likes
2,667

so then what make you think that system is going to populate ref document number by itself ????

Raj

Read only

0 Likes
2,667
Read only

0 Likes
2,667

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

Read only

0 Likes
2,667

Hi Raju, I assume you mean BKPF-XBLNR. Thanks for this really useful tip.

Regards,

Karina Hurtado