!--a11y-->
Object-Based Navigation (OBN) 
The structure of SAP Enterprise Portal content is based on roles. You can browse through the user-specific navigation structures using the top-level navigation and the detailed navigation. Portal navigation allows you to navigate between different iViews or pages in any application running as a portal content (that is, any page or iView).
In many
cases it is sufficient to use either relative or absolute navigation to
navigate to a specific iView or page. However, sometimes more flexibility is
required. For this purpose, you have
Object-Based
Navigation, which allows you to define navigation steps at a higher
semantic level. Instead of defining a concrete target URL, you call a
particular operation of a particular
business-object.
You configure in the portal which concrete iView (or which page) is to be used for executing this operation. This configuration can be role-specific or user-specific. The Web Dynpro application itself passes on solely the name of the business object and the operations linked to it.
In Web Dynpro for ABAP, the integration of object-based navigation is very similar to the integration of portal eventing. To trigger the navigation itself, the Web Dynpro Framework provides a service that can be called from the application. This service, like Portal Eventing, is part of the portal manager.
You can
activate object-based navigation of the portal in Web Dynpro ABAP by calling
the method NAVIGATE_TO_OBJECT of the portal manager (interface
IF_WD_PORTAL_INTEGRATION).
You can generate an appropriate template using the
Web Dynpro Code
Wizard, in which
you then enter values.
data lr_componentcontroller type ref to ig_componentcontroller . data l_api_componentcontroller type ref to if_wd_component. data lr_port_manager type ref to if_wd_portal_integration.
lr_componentcontroller = wd_this->get_componentcontroller_ctr( ). l_api_componentcontroller = lr_componentcontroller->wd_get_api( ). lr_port_manager = l_api_componentcontroller->get_portal_manager( ).
call method lr_port_manager->navigate_to_object exporting system = navigation_data-system object_type = navigation_data-object operation = navigation_data-operation object_value_name = navigation_data-object_value_name object_value = navigation_data-object_value business_parameters = bus_parameter_list forward_obn_metadata = navigation_data-forward_obn_metadata.
|
Only two parameters are required for the navigation:
· SYSTEM
Specify the system (or the system alias) the business object is assigned to.
· OBJECT_TYPE
Specify the business object you are using.
All other parameters are optional.
· OBJECT_VALUE
Usually there are many different instances of a business object – for example, for the business object Customer. You use this parameter to specify which specific customer (for instance, use the customer number) you want to use for the object-based navigation step.
· OPERATION
You use this parameter to specify which operation is to be used for the object-based navigation step.
· OBEJCT_VALUE_NAME
The specified object value is transferred as a URL parameter to the OBN step. The standard name of this parameter is ObjectValue. You can change this name if you want.
· BUSINESS_PARAMETERS
As well as specifying the object value you can define other parameters that are to be forwarded by the OBN step. An example of a parameter string you could define is: Mode=Edit&ShowHeader=false.
These parameters can be used by the target of the OBN if the operation of the business object has been prepared accordingly (see below under the section Maintaining the Target Application in the Portal.
· FORWARD_OBN_METADATA
Sometimes it is useful for the OBN target to receive more details about the current navigation step. For instance, if you implement an application that serves for implementing different operations performed on a business object, the application must know which operation was triggered by the OBN step. Therefore, you can pass on the following parameters:
¡ obn.system
The system the business object is assigned to.
¡ obn.bo_type
The business object itself
¡ obn.operation
The respective operation If the default operation is used, the value is _default_.
The target application is maintained in the portal for the respective operation of the business object. This is usually done in by the portal administrator.
To be able to transport the business parameters correctly from a Web Dynpro ABAP application to the target application, the following JavaScript must be stored at the target application under Object-Based Navigation:
return 'DynamicParameter=' + objValue;
You can find an example in the system in the Web Dynpro application, WDR_TEST_PORTAL_NAV_OBN.
Execution of
the navigation is thus dependent on the customizing for the role settings in
the portal. For example, the user of a role could have the authorization for
displaying and editing the content of a page, while the users of another role
might only be allowed to display the content. If a user triggers object-based
navigation, but does not belong to a role that has authorization for the
respective operation, an appropriate error message will appear. So as to make
the user interface as user-friendly as possible, it is a good idea –
from the very start – not to provide this operation for the user in
question. For this purpose, however, the information for the authorization of
the respective operation must be got by the portal. This can be done with the
help of a Web service that is called from the Web Dynpro ABAP application
using the class
CL_WDR_PORTAL_OBNWEB_SERVICE.