Skip to Content
avatar image
Former Member

How to LOCK Bol Simple Object

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jun 29, 2010 at 05:10 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 29, 2010 at 07:30 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 27, 2016 at 11:32 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded