Hello David Quílez Muñoz,
Locking mechanism is standard delivered functionality.
correct me if i am wrong, i guess you have added few value attributes on Opportunity UI and when you are saving the opportunity, expect these value attributes rest all are coming in non editable mode.
btadminh is the Root context node for opportunity.
in your GET_I method of that attribute which is coming in editable mode, place the following code.
DATA: lr_entity TYPE REF TO cl_crm_bol_entity.
lr_entity ?= owner->typed_context->btadminh->collection_wrapper->get_current( ).
IF lr_entity IS BOUND.
IF lr_entity->is_locked( ) EQ abap_false.
rv_disabled = 'TRUE'.
ENDIF.
ENDIF.
Declare a variable "owner" in your context node class (For Ex: z****CN00 ) for accessing the context node collection in your getter methods.
Owner should be of type controller class. i.e z***_IMPL...
This above code will check for root node is locked or not and if Yes then set your field property as rv_disabled = 'TRUE'.
Let me know if you are facing any issues more. Try pasting screens of your screen.
Cheers !
Nikhil Kulkarni