Skip to Content

This blog explains how to navigate from one component view to other component view without adding Used Components.

Scenario: Source component contains View with LinkToAction UI element, on click of this Link navigates to Destination component View without adding Used Component in the Source Component.This is can be achieved using Dynamic Navigation by following interface: IF_WD_NAVIGATION_SERVICES and method: do_dynamic_navigation.

Prerequisites: Should have basic knowledge on Web Dynpro ABAP

Create Two Web Dynpro Component by following

Destination Component :

Create Web Dynpro with View and Window. 

Insert Caption UI Element in the View.

/wp-content/uploads/2013/01/1_172024.png

Embed the View into Window.Activate whole component.

/wp-content/uploads/2013/01/2_172061.png

Source Component :

Create Web Dynpro with View and Window. See below there is no Used Component,

/wp-content/uploads/2013/01/3_172062.png

Insert LinkToAction UI Element in the View and Create Action write the below code assign this action to LinkToAction UI Element.

/wp-content/uploads/2013/01/3_1_172115.png

Code:

  data : lv_view_api type ref to if_wd_view_controller,
         lv_nav_serv type  ref to if_wd_navigation_services.

  lv_view_api = wd_this->wd_get_api( ).
  lv_nav_serv  ?= lv_view_api.

lv_nav_serv->do_dynamic_navigation(
     source_window_name        = ‘W_COMP2’
     source_vusage_name        = ‘V_COMP2_USAGE_1’
     source_plug_name          = ‘DEFAULT’
*     PLUG_PARAMETERS           = PLUG_PARAMETERS
     target_component_name     = ‘ZTEST_COMP1’
     target_component_usage    = ‘ZTEST_COMP1’
     target_view_name          = ‘W_COMP1’
     target_plug_name          = ‘DEFAULT’
*     TARGET_EMBEDDING_POSITION = TARGET_EMBEDDING_POSITION
        ).

/wp-content/uploads/2013/01/5_172098.png

Embed this View into Window. Activate whole component.

/wp-content/uploads/2013/01/6_172099.png

Create the Webdynpro Application by following

/wp-content/uploads/2013/01/7_172114.png

Demo : Select the above application Right click and Test. When you clicks on below link it navigates to Destination Components View.

/wp-content/uploads/2013/01/8_172104.png

/wp-content/uploads/2013/01/9_172105.png

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. saravanakumar mac

    Code for dynamic navigation one component to another component in sap Webdynpro ABAP.

    DATA : lv_view_api TYPE REF TO if_wd_view_controller,

                lv_nav_serv TYPE  REF TO if_wd_navigation_services.

                lv_view_api = wd_this->wd_get_api( ).

                Iv_nav_serv  ?= lv_view_api.

                lv_nav_serv->do_dynamic_navigation(

               source_window_name        = ‘ZCRM_WD_INV_MAIN’     ” Ur window name in COMP A

               source_vusage_name        = ‘V_SCREENING_USAGE_1’    ” which view has mappedwith ur window u can see there view usage name in property.

               source_plug_name          = ‘TO_ONLINE’                               ” Outbound plug name in view

    **     PLUG_PARAMETERS           = PLUG_PARAMETERS

              target_component_name     = ‘ZCRM_INV_LIC_REG’             ” navigating to which component COMP B

              target_component_usage    = ‘ZCRM_INV_LIC_REG’             ” navigating to which component COMP B

              target_view_name          = ‘ZCRM_WD_INV_REG’                  ” Here window name

              target_plug_name          = ‘FROM_FAST_TRACK’                   ” That window inbound plug name

    *     TARGET_EMBEDDING_POSITION = TARGET_EMBEDDING_POSITION

                 ).

       ENDIF.

    (0) 

Leave a Reply