cancel
Showing results for 
Search instead for 
Did you mean: 

How to LOCK Bol Simple Object

Former Member
0 Kudos
551

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

View Entire Topic
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