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 and invoice reference (XBLNR)

Former Member
0 Likes
3,107

Hi all,

I am using BAPI_ACC_DOCUMENT_POST to post accounting documents. Does anybody know a way how to get generated document number (BELNR) to reference field (XBLNR) automatically (like FB01 does when one enters character * as invoice reference)?

Thanks for any ideas.

8 REPLIES 8
Read only

Former Member
0 Likes
2,178

Hi Rastislav,

you can refer to the following document :

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1a23a090-0201-0010-8cbd-8b3bc193...

Hope it helps.

Read only

0 Likes
2,178

sorry, in provided document I did not find the information I need Any other ideas?

Read only

0 Likes
2,178

Hi,

do u want to fill BSID-XBLNR with generated doc No automatically?

regards

Arjun

Read only

0 Likes
2,178

well, mainly I need to fill XBLNR in BKPF with generated document number BELNR. When I am calling BAPI_ACC_DOCUMENT_POST, I cannot pass document number, because I do not know it ... system automatically generates document numbers ...

Read only

0 Likes
2,178

hi,

i think u can do several things.

u can find the document number which is going to be generated from BKPF by adding the last document number of same doc type with 1,and pass this to XBLNR.

or

u can copy the bapi and make a custom bapi.

then write an insert sql statement to BKPF with the generated document number.

or search for user exit or badi.

first one is simplest

regards

Arjun

Read only

0 Likes
2,178

hi,

>> u can find the document number which is going to be generated from BKPF by adding the last document number of same doc type with 1,and pass this to XBLNR.

I do not think this is usable solution. We have to take into account a paralel transactions so we are not able to get lastly generated documet number

>> or can copy the bapi and make a custom bapi. then write an insert sql statement to BKPF with the generated document number.

well, maybe, but I am still hoping that standard bapi should support this ...

>> or search for user exit or badi.

YES, this was what I was asking for ... if anybody does not already know suitable and usable user exit or BADI

>> first one is simplest

... I think the first one is the worst solution

Read only

Former Member
0 Likes
2,178

Impossible using this BAPI.

Read only

0 Likes
2,178

I would expect this to be handled in config.

Rob