Skip to Content

BOPF Optimistic Locking - How is it intended to work?

Dec 16, 2016 at 10:22 AM


avatar image


I am a bit confused how BOPF optimistic locking is intended to work.

I know, I can lock a DB line by retrieving it

          iv_node_key             = /cenitapm/if_bo_pw_phase_c=>sc_node-pwph
          it_key                  = t_key
          iv_edit_mode            = /bobf/if_conf_c=>sc_edit_optimistic
          eo_message              = o_message  
          et_data                 = t_pwph

And I know, I can promote the lock to an exclusive one by executing an action.

If a lock gets promoted, all other optimistic locks on that DB line are removed and can't be promoted anymore.

My problem is now: How does the BOPF behave if its optimistic lock was removed when I want to execute an action or do a modification to the DB line.

What I see is, that the BOPF simply sets a normal exclusive lock and overrides what happened in other sessions. Which leads to inconsistencies in the data.

Now my questions:

  • How is the optimistic lock intended to be used in BOPF? (The new entries in don't help here)
  • How can I explicitly promote an optimistic lock to an exclusive one (via BOPF) and be notified, that I have to reload the data?
  • (Additional Question: What is the appropriate primary tag for BOPF questions?)

Help is very much appreciated.

Regards David

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Martin Fischer
May 08, 2017 at 01:11 PM

Hi David,

did you find an answer for your question already?

If I got you right, you want to promote an optimistic lock after having an exclusive one?

I would do a retrieve as you showed in your coding. But maybe I got your question wrong.

BOPF should be the right tag. But the community just starts to get alive again after the relaunch.



Show 4 Share
10 |10000 characters needed characters left characters exceeded


the sequence is the following

  1. Lock object A optmisitic in session1
  2. Lock object A optmisitic in session2
  3. Change object A in session1
  4. Change object A in session2

Step 4 should fail with an error telling me, that I can't change object A, because my data is not up to date.

What actually happens is that the BOPF just creates a direct exclusive lock and writes the data. With this, the changes made in session1 are overwritten.


I guess you mean "3. Change object A in session1"?


Right :) That was what I meant


Hi David,

your observation for the steps 1-4 would clearly indicate an error. If you have a reproducible example, you could open an incident.

What is your SAP_BASIS or SAP_BS_FND release and SP? There have been a number of SAP notes related to BOPF locking, the most important one being 2182397 (but also 2264813 may be of interest).

You may also want to check if the BO you are using has its own implementation of the LOCK action.