cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Two documents are saved instead of one

hagit
Active Participant
0 Likes
537

Hi experts,

I know that in principle BTE is not intended for validations, but in our system, there are validations located in BTE2218. Now we've noticed that in the following scenario, two documents are being saved, even though the user entered only one document. (Two records are inserted into BKPF). The scenario:

  • The user enters invoice data in FV60 and saves it (as parked).
  • Code within BTE2218 performs a check, and as a result:
    • A message is displayed (even if no message, the process is incorrect).
    • The process is broken by a leave screen.
  • The user corrects the data on the screen and saves it again (as parked).
  • The system saves two documents, not one. (Two records are inserted into BKPF).

From the debugging, it seems that with every save attempt, the system creates a new record (with a new document number). When the second save attempt is valid and a commit work is executed, both records are saved in the database, even though one record is invalid.

In the debug, it appears that the internal table for BKPF contains only one record each time. My assumption is that there is an internal table that gathers the two records, and in the end, the update to BKPF is done according to this table. I couldn't find this internal table or the place where the DB update is done .

How can this be fixed?

Thank you.

View Entire Topic
RaymondGiuseppi
Active Contributor

Read first 1888123 - FI BTE 00002218 message handling in Enjoy transaction (FV60) - You have broken the transaction process, some of the update task functions are already registered, you (or your colleagues) are messing with the consistency of the data. 😕

hagit
Active Participant
0 Likes
Sorry for the late response, I missed your comment. In the link you send it written that ' Therefore any error message raised in the BTE has to be handled as A-message.' The problem with A-message is that it causes the screen to exit and the user must insert all the data again. Is there another solution? It is written that " There must be no error or warning messages issued when the BTE is called between the assignment of document numbers and the COMMIT WORK." Is it possible to interfere with the standard code before the assignment of document numbers?
hagit
Active Participant
0 Likes
@Raymond_giusepp The previous comment is addressed to you
RaymondGiuseppi
Active Contributor
0 Likes

(After my breakfast and morning emails, and then FIFO between my office tasks 😎 - Rules of Engagement - I'm not SAP employee)

In principle, this BTE is executed too late to be used for customer control. The interrupt message 'A' preserves the integrity of the data, but the entry is lost.
You need to find another place to run this check such as validation rules and some Finance BAdi (It depends on the exact data required to perform the check)

hagit
Active Participant
0 Likes
@Raymond_giusepp thank you