Quantcast
Channel: Web Dynpro ABAP
Viewing all articles
Browse latest Browse all 141

Navigation from one component view to other componet view without adding Used Components

$
0
0

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.

1.png

 

Embed the View into Window.Activate whole component.

2.png

 

Source Component :

 

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

3.png

 

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

3.1.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
        ).

 

5.png

 

Embed this View into Window. Activate whole component.

6.png

 

Create the Webdynpro Application by following

 

7.png

 

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

 

8.png

 

9.png


Viewing all articles
Browse latest Browse all 141

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>