cancel
Showing results for 
Search instead for 
Did you mean: 

How to LOCK Bol Simple Object

Former Member
0 Kudos

Hiii,

for editing an assignment block, I need to lock my simple object. The problem is, I cann't not lock my entity, I have created a simple bol object as root object. My event handlerI has the following code:

METHOD eh_onedit.

  DATA lr_entity TYPE REF TO cl_crm_bol_entity.

  lr_entity ?= me->typed_context->zbudget->collection_wrapper->get_current( ).
  CHECK lr_entity IS BOUND.
  lr_entity ?= me->typed_context->zbudget->collection_wrapper->get_current( ).
  IF lr_entity->is_locked( ) = abap_false.
    IF lr_entity->lock( ) = abap_true.
      me->view_group_context->set_view_editable( me ).
    ENDIF.
  ELSE.
    me->view_group_context->set_view_editable( me ).
  ENDIF.

ENDMETHOD.

I tried to lock my bol entity with

lr_entity->lock( )

but without success.

Has anybody an idea, how to lock my bol entity to make some checks like is_changeable in DO_PREPARE_OUTPUT before editing my assignment block?

Thanks in advance.

greetings,

John

Accepted Solutions (1)

Accepted Solutions (1)

arunprakash_karuppanan
Active Contributor
0 Kudos

Hi,

I assume that when you created the simple object, you made an entry in CRMV_TBLOBJ_MAP. Did you specify a lock object there? If not, create a lock object for your table(SE11) and specify it.

Regards,

Arun Prakash

Former Member
0 Kudos

solved

Answers (2)

Answers (2)

Former Member
0 Kudos

Had the same issue for a custom Simple Object created.
Created a lock object as mentioned above.

Used the DEQUEUE* FM to unlock the entity which was locked in separate task and then locked it.

Former Member
0 Kudos

Hi John,

the flag "locked" within the Bol-Entity will be set via lr_entity->switch_to_change_mode( ).

Also the Flag "changeable" will be set while doing this.

This lock can be released with commit/rollback.

I hope this helps.

Regards

Dennis