cancel
Showing results for 
Search instead for 
Did you mean: 

Navigate_dynamically method for navigate to Zcomponent

dhruv_mehta
Active Contributor
0 Kudos
324

Hi Experts,

I am not able to understand Cross component dynamic navigation using Navigation Descriptor class's navigate_dynamically.

I have gone through web ui navigation guide : scn.sap.com/docs/DOC-27478

which is fantastic i have used all of his methods to navigate in different scenarios.

But i am stuck in a small issue. I have two Z component want to navigate from Z component1 to Z component2.

Which approach do i need to take , another point is none of them are each others componet usage both are different component.

plz suggets.

Accepted Solutions (1)

Accepted Solutions (1)

sumeet_gehlot
Contributor
0 Kudos

Hi,

Navigation descriptor is the best way to navigate when it comes to cross comp nav.

Please check my thread.

http://scn.sap.com/thread/3472555

http://scn.sap.com/thread/1704714

If you are want to know specific to navigation descriptor object.

1. First thing need to do to expose the component2(main window) visible outside the component.

Go to runtime repository editor of ZCOMP2.

Edit mode

Right click on ComponentInterface ->

Add Interface View -> Window that should be visible outside.

2. To navigate to Component2 from Component1 , we need to do customizing in spro.

In SPRO go to:

Customer Relationship Management->UI Framework->Technical Role Definition->Define Work Area Component Repository which basically to create a new Target id.

Make a new entry:

Component Name: ZCOMP2

Window Name: ZCOMP2/MainWindow

Define Inbound-Plug:

Target ID       ZCOMP2

Inbound Plug    DEFAULT

Object Type     ZCOMP2 (optional)

Object Action: Display(for example)

3. After that go to your called outbound plug (called by the action) whether it can be display , create or edit.

    data: lr_window     type ref to cl_bsp_wd_window,
        lr_descriptor type ref to if_bol_bo_property_access,
        lr_nav_srv    type ref to if_crm_ui_navigation_service.

*Create descriptor
  call method cl_crm_ui_descriptor_obj_srv=>create_ui_object_based
    exporting
      iv_ui_object_type   = 'ZCOMP2'
      iv_ui_object_action = 'B'
      iv_component        = 'ZCOMP2'
    receiving
      rr_result           = lr_descriptor.

*if navigation is supported add descriptor object to the collection
  lr_nav_srv = cl_crm_ui_navigation_service=>get_instance( me ).
  if lr_nav_srv->is_dynamic_nav_supported( ir_descriptor_object = lr_descriptor ) eq abap_true.
    iv_data_collection->insert( iv_bo = lr_descriptor iv_index = 1 ).
  else.
    return.
  endif.

  lr_nav_srv->navigate_dynamically( iv_data_collection ).
  lr_window = me->view_manager->get_window_controller( ).
  lr_window->call_outbound_plug( iv_outbound_plug = 'DEFAULT' iv_data_collection =iv_data_collection ).

*****************************************************************************************************

Standard Outbound Mapping you can check in spro navigation bar profile generic outbound mappings where you can customize and and maintain targets specific to your requirement.

Customer Relationship Management->Technical Role Definition->Define Navigation Bar Profile->

Select Profile and go to Define Generic Outbound Plug Mappings

here you can define your own navigation     

Object_type

Object Action

TargetID etc.

and then use the above code for calling navigation descriptor object.

Regards,

Sumeet

Answers (0)