Hi all,
I want to find out which instance/ibase is currently set in a serviceticket. I am in the component "ICCMP_BTPARTNER" in the view "PARTNERTABLE".
I thought I might get the instance of the serviceticket in the global data context in GDC_CURRENTIBASE or GDC_CURRENTSERVICETICKET. But the CURRENTIBASE is initial and in SERVICETICKET the only information I get is the CRM_GUID.
I tried something like this...
CLEAR: lr_gdc.
TRY.
lr_gdc ?= cl_crm_ui_data_context_srv=>get_instance( iv_controller = me ).
CATCH cx_root.
ENDTRY.
CHECK lr_gdc IS BOUND.
CALL METHOD lr_gdc->get_entity
EXPORTING
name = if_iccmp_global_data_cont_con=>gdc_currentibase
RECEIVING
value = lr_serviceticket.
CHECK lr_ibase IS BOUND.
So, does anyone know how to get the current instance of a serviceticket in any other components view (here ICCMP_BTPARTNER/PartnerTable)?
Thanks for your help.
Best regards.
Ben
Done.
DATA: lr_gdc TYPE REF TO if_crm_ui_data_context.
DATA: lr_serviceticket TYPE REF TO if_bol_bo_property_access.
DATA: lr_entity TYPE REF TO cl_crm_bol_entity.
DATA: lv_instance TYPE ib_instance.
CLEAR: lr_gdc.
TRY.
lr_gdc ?= cl_crm_ui_data_context_srv=>get_instance( iv_controller = me ).
CATCH cx_root.
ENDTRY.
CHECK lr_gdc IS BOUND.
CALL METHOD lr_gdc->get_entity
EXPORTING
name = if_iccmp_global_data_cont_con=>gdc_currentserviceticket
RECEIVING
value = lr_serviceticket.
CHECK lr_serviceticket IS BOUND.
CLEAR: lr_entity.
lr_entity ?= lr_serviceticket.
CHECK lr_entity IS BOUND.
CLEAR: lv_instance.
TRY.
lr_entity = lr_entity->get_related_entity( 'BTOrderHeader' ).
CHECK lr_entity IS BOUND.
lr_entity = lr_entity->get_related_entity( iv_relation_name = 'BTHeaderBOSSet' ).
CHECK lr_entity IS BOUND.
lr_entity = lr_entity->get_related_entity( iv_relation_name = 'BTRefObjSet_A' ).
CHECK lr_entity IS BOUND.
lr_entity = lr_entity->get_related_entity( iv_relation_name = 'BTRefObjectComponentsAll' ).
CHECK lr_entity IS BOUND.
lv_instance = lr_entity->if_bol_bo_property_access~get_property_as_string( 'IB_INSTANCE' ).
CATCH cx_crm_genil_model_error cx_root.
ENDTRY.
Add a comment