Hi Elena,
I am giving ex code for steps which is mentioned by naveen.
Step1: Initially check the view is in editable mode.
data : lr_cuco type ref to custom controller class ,
lr_rootnode type ref to cl_crm_bol_entity.
lr_cuco ?= get_custom_controller( controller_id = 'your CuCo' ).
lr_rootnode ?= lr_cuco->typed_context->rootnode->collection_wrapper->get_current( ).
if lr_rootnode->lock( ) = abap_true.
Step2: If the view is in editable mode read the collection.
read your contract approval node.
lr_coll ?= me->typed_context->contract approl node->collection_wrapper.
lr_entity ?= lr_coll->get_first().
while lr_entity is bound.
Step3: Read each entity of the collection and check for the empty line (like Approval loop is initial and Approval status is initial). And delete that entity from the collection.
lr_entity->get_property_as_string( iv_attr_name = 'yourfieldname' ).
if yourfieldname is not initial.
lr_entity->get_next( ).
else.
lr_col->remove(lr_entity ).
lr_entity->get_next ( ).
endif.
endwhile.
try this logic this will work.
Thanks & Regards,
Srinivas.