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

Duplicate Postings in SAP

Former Member
0 Likes
1,503

Hi All,

I have encountered an interesting situation. While trying to post a document through an RFC I have come across two postings which have all the header and line items same except for the document number. Even the posting time is same for both even to the extent of seconds. However, one of the document comes from the Program and the other is coming from the SM35 session which the program creates.

I have duplication checks present and active which involve a user exit when it comes across a duplication situation.

Can anyone advice as to how this situation came and the two entries got posted despite the duplication check present and active.

Hi All,

I have encountered an interesting situation. While trying to post a document through an RFC I have come across two postings which have all the header and line items same except for the document number. Even the posting time is same for both even to the extent of seconds. However, one of the document comes from the Program and the other is coming from the SM35 session which the program creates.

I have duplication checks present and active which involve a user exit when it comes across a duplication situation.

Can anyone advice as to how this situation came and the two entries got posted despite the duplication check present and active.

3 REPLIES 3
Read only

Former Member
0 Likes
1,258

COMMIT WORK in your exit?

Read only

0 Likes
1,258

No. There is no Commit Work in the exit.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,258

I suppose that your exit is executed before the Db Commit and the COMMIT-WORK, so when, the check was performed no record existed, and no error was raised, so both process executed the COMMIT-WORK update tasks and inserted records in the database with the same value.

You should try to lock "something" when checking duplicate posting (customer, vendor or the like so the second process will not be able to proceed further, and no duplicate posting will occur, the lock will be released by the COMMIT-WORK and the end of the update tasks (Be aware, there could be some duplicates nevertheless due to buffering(*) and delay in actual database update)

Regards,

Raymond

(*) Check [BYPASSING BUFFER |http://help.sap.com/abapdocu_70/en/ABAPFROM_CLAUSE.htm#&ABAP_ADDITION_3@3@]