DATA: lr_desc_object TYPE REF TO if_bol_bo_property_access,
lr_data_collection TYPE REF TO if_bol_bo_col,
lr_nav TYPE REF TO if_crm_ui_navigation_service,
lr_entity TYPE REF TO cl_crm_bol_entity,
lr_core TYPE REF TO cl_crm_bol_core,
lv_guid TYPE crm_mktgs_guid.
* Pass the GUID of the Object to be navigated
lv_guid = '467185D10C2E1E58E10000000A42145A'.
* Get the BOL Core Instance
lr_core ?= cl_crm_bol_core=>get_instance( ).
* Get the Root entity
lr_entity ?= lr_core->get_root_entity( iv_object_name = 'Trade'
iv_object_guid = lv_guid ).
CHECK lr_entity IS BOUND.
* Create UI based Entity
CALL METHOD cl_crm_ui_descriptor_obj_srv=>CREATE_entity_BASED
EXPORTING
ir_entity = lr_entity
iv_ui_object_type = 'TPM_TRADEPROMOTION'
iv_ui_object_action = 'B' "display
RECEIVING
rr_result = lr_desc_object.
* Create a BOL collection to be passed to the inbound plug of
* the Called component
CREATE OBJECT lr_data_collection
TYPE
cl_crm_bol_bo_col.
* Add the UI Descriptor the BOL Collection
lr_data_collection->add( lr_desc_object ).
* Get Instance of Navigation Service
lr_nav = cl_crm_ui_navigation_service=>get_instance( ).
* Navigate to Target Component
IF lr_nav->is_dynamic_nav_supported( lr_desc_object ) = abap_true.
lr_nav->navigate_dynamically( lr_data_collection ).
ENDIF.
Post a Comment