web ui navigation

40
: Welcome, Guest Login Register Getting Started Newsletters Store Top of Form Search for: Search the Community Search All of SAP Bottom of Form Solutions Services & Support About SCN Downloads Industries Training & Education Partnership Developer Center Lines of Business true

Upload: mamta-saboo-chakraborty

Post on 16-Apr-2015

128 views

Category:

Documents


4 download

DESCRIPTION

Web UI Navigation

TRANSCRIPT

Page 1: Web UI Navigation

:

Welcome, Guest

Login

Register

Getting Started

Newsletters

Store

Top of Form

Search for:

Search the Community

Search All of SAP

Bottom of Form

Solutions

Services & Support

About SCN

Downloads

Industries

Training & Education

Partnership

Developer Center

Lines of Business

University Alliances

Events & Webinars

true

Page 2: Web UI Navigation

Innovation

Home

Activity0

Communications

Actions0

BrowseMore

Content

People

Places

Recent Bookmarks

Top of Form

Bottom of Form

Top of Form

Bottom of Form

More documents in SAP CRM: Webclient UI - FrameworkWhere is place located?

All Places

Customer Relationship Management (SAP CRM)

SAP CRM: Webclient UI - Framework

Currently Being Moderated

WebUI Navigation guide

created by Ashish W on May 1, 2012 5:04 PM, last modified by Ashish W on May 1, 2012 9:47 PM

Version 2

2 document.restore [placeholder]

document.publish [placeholder] DOC-27478

Page 3: Web UI Navigation

inShare0

Summary

This document is aimed at understanding navigation concepts in CRM WebUI. It covers the various scenarios of navigation.

Author(s): Ashish Walke

Company: Deloitte Consulting India Pvt. Ltd.

Created on: 01 May 2012

Author Bio

Ashish Walke is a Consultant at Deloitte consulting. He has worked on multiple implementations in SAP CRM across versions.

Table of Contents

Concept of navigation

Outbound plug (OP)

Inbound plug (IP)

Navigational link

Runtime repository editor

Navigation between views within one component

Navigation from view of an outer component to view of the inner component

Navigation from view of an inner component to view of the outer component

Navigation using Work Area Component Repository

Navigation using Navigation descriptor

Related Content

Concept of navigation

Page 4: Web UI Navigation

Navigation from one view / window to another involves the following elements:-

Outbound plug

Inbound plug

Navigational link

Runtime repository editor

Outbound plug (OP)

The outbound plug is a method of the controller class of the navigation source. It is fired when moving away from the source (view / window).

Inbound plug (IP)

The inbound plug is a method of the controller class of the navigation source. It is fired when moving towards the destination (view / window).

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

Runtime repository editor

The runtime repository is an XML file. But since maintaining it is no so convenient the component workbench offers an editor that visualizes the xml coding and offers an easy maintenance of the different elements. The runtime repository editor allows the following:-

Creation of navigational links

Page 5: Web UI Navigation

Assignment of views to view sets

Assignment of view / view sets to window

Assignment of component set

Definition of component interface

Definition of component usages

Navigation between views within one component

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.

Page 6: Web UI Navigation

b) Create a button in view1 (code added to view1.htm).

c) Create an event handler for the button and an outbound plug for view1.

d) Create an inbound plug for view2.

Page 7: Web UI Navigation

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.

Page 9: Web UI Navigation

h) Handle the event for button click i.e. call the Outbound plug from the event handler for button.

Sample code:-

METHOD eh_onbtn1.

CALL METHOD op_topage2.

ENDMETHOD.

i) In order to navigate from View1 to View2, we will call the navigational link from the outbound plug.

Sample code:-

METHOD op_topage2.view_manager->navigate(source_rep_view = rep_viewoutbound_plug = 'ToPage2' ).ENDMETHOD.

Navigation from view of an outer component to view of the inner component

Page 10: Web UI Navigation

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.

b) Assign view1 and view2 to “MainWindow” in their respective components.

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

Page 11: Web UI Navigation

e) Create an inbound plug for “view2” and “MainWindow” (Inner component).

Page 12: Web UI Navigation

f) In the runtime repository create Component interface (Inner Component). Specify the inbound and outbound plugs created and add the context BuilHeader.

g) In the runtime repository create Component usage (Outer Component).

Page 13: Web UI Navigation

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”.

Page 14: Web UI Navigation

Specify values as below:-

Source = MainWindow of Outer component (OP = TOPAGE2)

Target = MainWindow of Inner component (IP = FROMPAGE1)

j) Handle the event for button click i.e. call the Outbound plug of “view1” from event handler for button.

Sample code:-

METHOD eh_onbtn1.CALL METHOD op_topage2.ENDMETHOD.

k) Following would be the navigation path from “view1” to “view2”.

Call OP of MainWindow (Outer) from OP of “view1”

Sample code:-

METHOD op_topage2.DATA: lr_window TYPE REF TO cl_bsp_wd_window.

Page 15: Web UI Navigation

lr_window = me->view_manager->get_window_controller( ).lr_window->call_outbound_plug( 'TOPAGE2' ).ENDMETHOD.

Call Navigational link from OP of MainWindow (Outer)

Sample code:-

METHOD op_topage2. me->view_manager->navigate( source_rep_view = me->rep_viewoutbound_plug = 'TOPAGE2').ENDMETHOD.

Call IP of “view2” from IP of MainWindow (Inner)

Sample code:-

METHOD ip_frompage1.

DATA : lr_view TYPE REF TO zl_znav_scn_view2_impl.

TRY.lr_view ?= get_subcontroller_by_viewname( 'ZNAV_SCN2_INNER/view2' ).CATCH cx_sy_move_cast_error.ENDTRY.

CHECK lr_view IS NOT INITIAL.lr_view->ip_frompage1( ).ENDMETHOD.

Navigation from view of an inner component to view of the outer component

a) Create a component (i.e. Search component) with view “view1” and a context node (BuilHeader).

Page 16: Web UI Navigation

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.

b) Assign view1 and view2 to “MainWindow” in their respective components.

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

Page 17: Web UI Navigation

e) Create an inbound plug for “view2” and “MainWindow” (Inner component).

Page 18: Web UI Navigation

f) In the runtime repository create Component interface (Search Component).

Specify the inbound and outbound plugs created and add the context BuilHeader.

Page 19: Web UI Navigation

g) In the runtime repository create Component interface (Header Component).

Specify the inbound and outbound plugs created and add the context BuilHeader.

Page 20: Web UI Navigation

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.

Also, include the inbound and outbound plugs in the MainWindow.

Page 21: Web UI Navigation

j) Delegate the outbound plug of Interface window (Component usage SEARCH) to MainWindow outbound plug.

Page 22: Web UI Navigation

k) Create navigational link in the runtime repository (Main Component) to specify source as “MainWindow” of Main Component and destination as

“InterfaceWindow” of Component usage HEADER.

Specify values as below:-

Source = MainWindow of Main component (OP = TOPAGE2)

Target = InterfaceWindow of Header component (IP = FROMPAGE1)

l) Handle the event for button click i.e. call the Outbound plug of “view1” from event handler for button.

Sample code:-

METHOD eh_onbtn1.CALL METHOD op_topage2.ENDMETHOD.

Page 23: Web UI Navigation

m) Following would be the navigation path from “view1” to “view2”.

Call OP of MainWindow (SEARCH) from OP of “view1”

Sample code:-

METHOD op_topage2.DATA: lr_window TYPE REF TO cl_bsp_wd_window.

lr_window = me->view_manager->get_window_controller( ).lr_window->call_outbound_plug( 'TOPAGE2' ).ENDMETHOD.

Fire outbound plug of MainWindow(MAIN) from MainWindow(SEARCH)

Sample code:-

METHOD op_topage2.fire_outbound_plug( iv_outbound_plug = 'TOPAGE2' ).ENDMETHOD.

Call Navigational link from OP of MainWindow (MAIN)

Sample code:-

METHOD op_topage2. me->view_manager->navigate( source_rep_view = me->rep_viewoutbound_plug = 'TOPAGE2').ENDMETHOD.

Page 24: Web UI Navigation

Call IP of “view2” from IP of MainWindow (Inner)

Sample code:-

METHOD ip_frompage1.

DATA : lr_view TYPE REF TO zl_znav_scn_view20_impl.

TRY.lr_view ?= get_subcontroller_by_viewname( 'ZNAV_SCN3_HDR/view2' ).CATCH cx_sy_move_cast_error.ENDTRY.

CHECK lr_view IS NOT INITIAL.

lr_view->ip_frompage1( ).ENDMETHOD.

Navigation using Work Area Component Repository

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:-

Page 25: Web UI Navigation

b) Create an event handler for the button and an outbound plug for “view1” (Custom component).

Create outbound plug for “MainWindow” (Custom component).

c) Create Component Interface for the Custom component (This would be used in the next step).

Page 26: Web UI Navigation

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

Page 27: Web UI Navigation

f) Define Object Type which determines the navigation target.

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

g) Following would be the navigation path from “Custom component” to “Identification screen”.

Page 28: Web UI Navigation

Call OP of MainWindow from OP of “view1”

Sample code:-

METHOD op_backtoident.DATA: lr_window TYPE REF TO cl_bsp_wd_window.

lr_window = me->view_manager->get_window_controller( ).lr_window->call_outbound_plug( 'BACKTOIDENT' ).ENDMETHOD.

Fire outbound plug of WorkArea Component repository from MainWindow

Sample code:-

METHOD op_topage2.fire_outbound_plug( iv_outbound_plug = 'BACKTOIDENT' ).ENDMETHOD.

Navigation using Navigation descriptor

Page 29: Web UI Navigation

a) Get instance of the BOL core and Activity root object.

lr_core = cl_crm_bol_core=>get_instance( ).

lr_activity = lr_core->get_root_entity( iv_object_name = 'BTOrder'

iv_object_guid = lv_activity_guid ).

CHECK lr_activity IS BOUND.

Assumption:- Activity GUID has been fetched in variable “lv_activity_guid”

b) Create an object for navigation.

CREATE OBJECT lr_coll_for_navigate TYPE cl_crm_bol_bo_col.

c) Add the Activity entity to the navigation collection.

lr_coll_for_navigate->add( iv_entity = lr_activity

iv_set_focus = abap_true ).

d) Get Activity object type.

lv_object_type = cl_crm_uiu_ibase_tool=>get_bt_ui_object_type( lr_activity ).

Assumption:- The BOL entity for Activity has already been fetched in variable “lr_activity”

e) Create the navigation descriptor.

cl_crm_ui_descriptor_obj_srv=>create_ui_object_based(

EXPORTING iv_ui_object_type = lv_object_type

iv_ui_object_action = lc_action

RECEIVING rr_result = lr_nav_descr ).

Page 30: Web UI Navigation

CHECK lr_nav_descr IS NOT INITIAL.

f) Insert the navigation descriptor in navigation collection at position 1.

lr_coll_for_navigate->insert( iv_bo = lr_nav_descr

iv_index = 1 ).

g) Register the current page in history so that we can navigate back to it.

RAISE EVENT history_trigger .

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.

DATA: lr_nav_serv TYPE REF TO if_crm_ui_navigation_service.

lr_nav_serv = cl_crm_ui_navigation_service=>get_instance( ).

lr_nav_serv->navigate_dynamically( iv_data_collection = iv_data_collection ).

Topics:Customer Relationship Management

8878 Views Tags: none (add)web, navigation, ui, crm

Average User Rating

4.8947

(19 ratings)

inShare0

Comments

20 Comments

Hariharan ThyagarajanMay 1, 2012 10:01 PM

Nicely represented. Good work.

Like (0)

172

Page 31: Web UI Navigation

Vishal DubeyMay 4, 2012 11:29 AM

Great Job...

Like (0)

Sivaram PushpalaMay 4, 2012 12:25 PM

Good content

Like (0)

Azaz Ali ShaikMay 9, 2012 10:05 AM

very nice explanation of navigation...

Like (0)

Vishal KesarMay 11, 2012 12:06 AM

Excellent Blog Ashish!!

It should serve as FAQ doc for all people asking questions about different types of navigations in CRM UI.

Like (0)

avadh choukseyMay 14, 2012 7:18 AM

Hey Ashish,

Clearly understandable article.

Extremely helpful for beginners .

Like (0)

Page 32: Web UI Navigation

Nilesh KumbharMay 14, 2012 9:26 PM

Very Helpful.

Thanks Ashish.

Like (0)

Avik ChakrabartiMay 14, 2012 9:28 PM

Nice work Ashish!!!

Like (0)

Vinay PrasadMay 15, 2012 11:24 AM

Thanks for this document...great content

Like (0)

magana priyaMay 15, 2012 2:01 PM

Hi Ashish, Clear Picture about navigation...Thanks alot for such valuable Document...

Like (0)

Suchita PhulkarMay 19, 2012 11:08 PM

Very nice work ashish !! Keep it up and all the Best.

Thanks & Regards

suchita

Like (0)

Page 33: Web UI Navigation

Mahesh JagannathMay 20, 2012 12:10 PM

Thank Ashish for this very good document!!

Regards,

Mahesh

Like (0)

karthik kumarJun 7, 2012 1:27 PM

Very nice one to learn navigation from A-Z..

Thanks and Regards,

Karthik.

Like (0)

Nikhil Prateek KulkarniJun 25, 2012 10:08 AM

Excellent :-)

Like (0)

VIJAYAKUMAR GAug 20, 2012 2:35 PM

Single location for all types of navigation.. That's excellent job. Thanks for posting..

Like (0)

Krishnakumar RamamoorthyAug 29, 2012 8:09 AM

Great job Aashish, very well done!

Page 34: Web UI Navigation

Like (0)

Dhruvin MehtaSep 25, 2012 9:17 AM

Amazing is the Word!

Exactlly what i was looking for! a Great Help in Practical Approches!

I was just thinking it would be awsme if you also Provide how we pass data in Navigation!

although this is one of the best Step by Step available in SDN!!

Keep it up!! Thanks a lot again Ashish!!!

Like (0)

Savaridasan PSep 27, 2012 6:45 AM

Nice blog...so resoureful Ashish Thank U

Like (0)

juergen baurNov 12, 2012 4:47 PM

Good job - thank you very much!

br

Jürgen

Like (0)

D PNov 22, 2012 9:43 AM

Hi,

Its a very nice blog. Could you also post on how to bypass the existing default work center and open a new workcenter through coding.

Page 35: Web UI Navigation

For eg. Work center 1 is a default work center configured for a business role xyz.

For the same business role, as soon as the user logs in, Work center 2 should be displayed instead of Workcenter 1 based on some validations.

How can we achieve this navigation. This is the one of the requirements in my proj.

It would be great if you could suggest a way.

Thanks

DP

Like (0)

Top of Form

Name

Email Address

Website Address

Bottom of Form

Top of Form

Name (Required)

Email Address (Required, will not be published)

Website Address

Add Comment

Page 37: Web UI Navigation

Incoming Links

how ot Access component 1 in component 2

Re: when ever click on confirm button in view, then how to navigate window( complaint window)

Re: Outbound & Inbound

Re: How to navigate a viewset crossing component

Re: Dump while navigating in Outbound Plug

Re: hyperlink issue on web UI

Follow SCN

Site Index

Contact Us

SAP Help Portal

Privacy

Terms of Use

Legal Disclosure

Copyright

Jive Software Version: 5.0.1.1 , revision: 201110261520.2c99f0c.release_jive_sbs_5_0_1_1