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 posting duplicate entries

Former Member
0 Likes
3,079

Hi All,

Im using the BAPI_ACC_DOCUMENT_POST for posting a FI document.
However the issue that im facing is that it will allow duplicate entries to be posted for the same data.

How can we restrict that ???

I've checked SCN for the same and the only solution which I could see is using FI_DUPLICATE_INVOICE_CHECK.

But since its an unreleased FM we should ideally not use it.

Any other fix apart from this??

Thanks,

Faiz

3 REPLIES 3
Read only

Former Member
0 Likes
1,504

Hi,

Please elaborate for what type of document you are posting through the said BAPI .

You can create your own logic and fetch the database table based on that. For eg let assume that the reference(XBLNR) field will be unique for all the document ( document types you are posting ) then you can fetch the Table BKPF and check of that Reference (XBLNR) is already given for any other document or not.

Please try and make the logic on header Table (BKPF) as it would be easy to fetch .

Hope this helps.

Read only

0 Likes
1,504

Hi,

I also use BKPF check in field AWKEY to prevent duplicate postings.

But it still generate double finance document in with same AWKEY in sequence running number(75000000001,75000000002).

This happen since we execute more than 10000 transaction in one loop.

It seems problem came from inside BAPI_ACC_DOCUMENT_POST.

Is there any duplicate check inside the bapi such as exit or enanchement spot, etc.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,504

If you don't use a WAIT option in the commit, you won't be able to check for duplicates, nor will any SAP standard too. And even if you wait, some performance or buffer problem can prevent correct check.

TWO checks required

  • Use some SQL statement to check between yourdata and current values in database (this one can simulate FI_DUPLICATE_INVOICE_CHECK or some AWTYP/AWKEY logic)
  • Check in your program data (internal tables) to block/remove duplicates in the received data

Regards,

Raymond