Hi Experts
I am trying to change a custom field in the SERVICE_H structure. The issue that i am facing is, the value is updated to the database but on the UI, the value does not appear i.e. the value for the field vanishes from the UI.
I have used the following code to change the field. Please let me know hwy this is not working whereas in a ideal situation, it is supposed to work properly.
DATA: lr_transaction TYPE REF TO if_bol_transaction_context,
lr_core TYPE REF TO cl_crm_bol_core,
lr_root_ent TYPE REF TO cl_crm_bol_entity,
lr_header_ent TYPE REF TO cl_crm_bol_entity,
lr_service_ent TYPE REF TO cl_crm_bol_entity.
* Get the guid
lr_comp ?= me->comp_controller.
IF lr_comp IS BOUND.
lr_adminh ?= lr_comp->typed_context->btadminh->collection_wrapper->get_current( ).
IF lr_adminh IS BOUND.
lv_guid = lr_adminh->get_property_as_string( 'GUID' ).
ENDIF.
ENDIF.
lr_core = cl_crm_bol_core=>get_instance( ).
IF lr_core IS BOUND.
lr_root_ent = lr_core->get_root_entity( iv_object_name = 'BTOrder' iv_object_guid = lv_guid ).
IF lr_root_ent IS BOUND.
lr_header_ent = lr_root_ent->get_related_entity( 'BTOrderHeader' ).
IF lr_header_ent IS BOUND.
lr_service_ent = lr_header_ent->get_related_entity( 'BTHeaderServiceExt' ).
IF lr_service_ent IS BOUND.
lr_service_ent->lock( ).
IF lr_service_ent IS BOUND.
lr_service_ent->if_bol_bo_property_access~set_property( iv_attr_name = 'ZZTICKSOUR' iv_value = 'E-Mail' ).
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
lr_core->modify( ).
lr_transaction = lr_root_ent->get_transaction( ).
IF lr_transaction IS BOUND.
IF lr_transaction->save( ) = abap_true.
lr_transaction->commit( ).
ELSE.
lr_transaction->rollback( ).
ENDIF.
ENDIF.
By using this code, the transaction is getting committed and the value for the field ZZTICKSOUR is getting saved in the database but the value vanishes from the UI. On the UI, this field is empty.
I have written this code in the event EH_ON_SAVE which is triggered on saving the ticket and after my code i have called SUPER.
Please help me solve this problem.
Thanks and regards
Preeti Viswanath