Skip to Content

BOPF Optimistic Locking - How is it intended to work?


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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • 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.



    Add comment
    10|10000 characters needed characters exceeded

    • 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.