Professional Documents
Culture Documents
Summary
This document is aimed at understanding navigation concepts in CRM WebUI. It covers the
various scenarios of navigation.
Author Bio
Table of Contents
Concept of navigation
1. Outbound plug (OP)
2. Inbound plug (IP)
3. Navigational link
4. Runtime repository editor
1. Navigation between views within one component
2. Navigation from view of an outer component to view of the inner component
3. Navigation from view of an inner component to view of the outer component
4. Navigation using Work Area Component Repository
5. Navigation using Navigation descriptor
6. Related Content
Navigation from one view / window to another involves the following elements:-
• Outbound plug
• Inbound plug
• Navigational link
• Runtime repository editor
Navigational link
The navigational link is an element of the runtime repository. It provides the mapping
between source and destination. It typically consists of the following:-
• Navigational link Id
• Source (view / window)
• Outbound plug
• Destination (view / window)
• Inbound plug
a) Create a component with two views “view1” and “view2” each with a
context node (BuilHeader).
Create view configuration for both view1 and view2 and add fields to the configuration.
c) Create an event handler for the button and an outbound plug for view1.
e) In the Runtime repository add both the views to the Window “MainWindow”. Assign “view1” as
default.
f) In the Runtime repository add Navigational link “ToPage2”. Specify the source and target views
and the corresponding outbound and inbound plugs.
h) Handle the event for button click i.e. call the Outbound plug from the event handler for button.
Sample code:-
METHOD eh_onbtn1.
ENDMETHOD.
i) In order to navigate from View1 to View2, we will call the navigational link from the outbound plug.
Sample code:-
a) Create a component (i.e. outer component) with view “view1” and a context
node (BuilHeader).
Create a component (i.e. inner component) with view “view2” and a context
node (BuilHeader).
Create view configuration for both view1 and view2 and add fields to the configuration.
c) Create a button in view1 (Outer component). For sample code refer to point b) in Navigation
between views within one component.
d) Create an event handler for the button and an outbound plug for “view1” (Outer component).
Create outbound plug for “MainWindow” (Outer component).
f) In the runtime repository create Component interface (Inner Component). Specify the inbound and outbound
plugs created and add the context BuilHeader.
h) Assign the Interface view from Usage (created above) to the MainWindow of Outer component.
i) Create navigational link in the runtime repository (Outer Component) to specify source as
“view1” and destination as “view2”.
j) Handle the event for button click i.e. call the Outbound plug of “view1” from event handler for
button.
Sample code:-
Sample code:-
Sample code:-
Sample code:-
METHOD ip_frompage1.
TRY.
lr_view ?= get_subcontroller_by_viewname( 'ZNAV_SCN2_INNER/view2' ).
CATCH cx_sy_move_cast_error.
ENDTRY.
a) Create a component (i.e. Search component) with view “view1” and a context node
(BuilHeader).
Create a component (i.e. Header component) with view “view2” and a context
node (BuilHeader).
Create a component (i.e. Main Component). Both the above components would be
included in the Main component.
Create view configuration for both view1 and view2 and add fields to the configuration.
For sample code refer to point b) in Navigation between views within one component.
d) Create an event handler for the button and an outbound plug for “view1” (Outer component).
Specify the inbound and outbound plugs created and add the context BuilHeader.
Specify the inbound and outbound plugs created and add the context BuilHeader.
h) In the runtime repository of Main Component, create Component usage for Search and Header component.
Also, include the Inbound and Outbound plugs respectively.
i) Assign the Interface view from Usage (created above) to the MainWindow of Main Component.
j) Delegate the outbound plug of Interface window (Component usage SEARCH) to MainWindow outbound
plug.
k) Create navigational link in the runtime repository (Main Component) to specify source as “MainWindow”
of Main Component and destination as
l) Handle the event for button click i.e. call the Outbound plug of “view1” from event handler for
button.
Sample code:-
Sample code:-
Sample code:-
Sample code:-
Sample code:-
METHOD ip_frompage1.
TRY.
lr_view ?= get_subcontroller_by_viewname( 'ZNAV_SCN3_HDR/view2' ).
CATCH cx_sy_move_cast_error.
ENDTRY.
lr_view->ip_frompage1( ).ENDMETHOD.
a) Create a component (i.e. Custom component) with view “view1” and a context node
(BuilHeader).
Create view configuration for view1 and add fields to the configuration.
Create a button for navigating back to Identification screen (For sample code refer to point
b) in Navigation between views within one component).
Assign this component such that it loads on clicking the work center link in navigation bar as follows:-
b) Create an event handler for the button and an outbound plug for
“view1” (Custom component).
c) Create Component Interface for the Custom component (This would be used in the next step).
d) Create an entry for the Custom component in Work Area Component Repository.
e) Create an entry for outbound plug. The outbound plug name should correspond to the name specified in
Outbound plug of Window in Custom
component (Step b)
Source ID can be any free text. However, it has to be unique (i.e. cannot be used more than once).
For the appropriate Navigation bar profile define the Generic OP Mapping.
The Generic OP mapping can contain either of the following that defines the navigation
target:-
- TargetID
- Logical link
Sample code:-
Sample code:-
lr_core = cl_crm_bol_core=>get_instance( ).
iv_object_guid = lv_activity_guid ).
iv_set_focus = abap_true ).
Assumption:- The BOL entity for Activity has already been fetched in variable “lr_activity”
cl_crm_ui_descriptor_obj_srv=>create_ui_object_based(
iv_ui_object_action = lc_action
iv_index = 1 ).
g) Register the current page in history so that we can navigate back to it.
h) Call outbound plug for navigation and pass the navigation collection.
op_toactivity( lr_coll_for_navigate ).
i) Get instance of the navigation service and navigate to the component dynamically along with collection.
lr_nav_serv = cl_crm_ui_navigation_service=>get_instance( ).