Show TOC Start of Content Area

Background documentation IF_WD_RR_VIEW_USAGE  Locate the document in its SAP Library structure

The IF_WD_RR_VIEW_USAGE interface belongs to the API for the Web Dynpro runtime repository.

The IF_WD_RR_VIEW_USAGE interface allows access to the metadata for a view embedding. A view can be embedded either directly into a Web Dynpro window or into a view container in another view. In both cases, the view’s embedding position is assigned to a description object known as a view usage. If the embedded view also contains view containers – that is, areas in which views are embedded – the view usage aggregates view container assignments to this view  (see IF_WD_RR_VIEW_CNT_ASSIGNMENT).

Use

The VIEW_MAIN view is embedded into the WINDOW_MAIN window in a Web Dynpro component. The embedding position of the view in the window is expressed by the  USAGE_VIEW_MAIN view usage. Access to this view usage is made in a component controller method as follows:

data:

l_component_api        type ref to if_wd_component,

l_window_info type ref to if_wd_rr_window,

l_view_usage           type ref to if_wd_rr_view_usage.

 

l_component_api        = wd_this->wd_get_api( ).

l_component_info       = l_component_api->get_component_info( ).

l_window_info = l_component_api->get_window_info(

                           window_name = 'WINDOW_MAIN' ).

l_view_usage = l_window_info->get_view_usage(

                            name = 'USAGE_VIEW_MAIN' ).

Methods

GET_NAME

This method returns the name of the view usage.

GET_EMB_VIEW_CNT_ASSIGNMENT

If the view that belongs to this view usage is embedded into another view, this method returns the higher-level view container assignment (see IF_WD_RR_VIW_CNT_ASSIGNMENT). If, on the other hand, the view is embedded directly in the window, the return value is initial.

GET_COMPONENT_USAGE

If the view that this view usage is assigned to belongs to a used component, this method returns the description object of the assigned component usage. Otherwise, the return value is initial.

GET_VIEW

This method returns the description object for the view that is assigned to this view usage.

GET_WINDOW

This method returns the description object for the window that belongs to this view usage (the window in which the view that belongs to this view usage is embedded).

GET_VCA_FOR_CONTAINER

This method returns the view container assignment belonging to a view container. The following relationship exists between a view container and a view container assignment:

A view container is a special area in a view, where other views can be embedded. In a Web Dynpro window, a view can be embedded either into multiple view containers or directly into the window. If a view that has been embedded into multiple view containers contains view containers of its own, there is one view container assignment per embedding and per view container in order to uniquely designate the embedding position.

Example

View VIEW_01 is embedded three times at different positions in window WINDOW. The embedding positions are expressed by view usages (see IF_WD_RR_VIEW_USAGE) - VIEW_01_USAGE_1, VIEW_01_USAGE_2 and VIEW_01_USAGE_3. The view contains the view containers CONTAINER_01 and CONTAINER_02. There is now exactly one view container assignment per view usage and view container.

GET_VIEW_CNT_ASSIGNMENTS

This method returns all view container assignments aggregated to this view usage.

GET_VIEW_CNT_ASSIGNMENT

This method returns the view container assignment of the specified name aggregated by this view usage.

If this view usage does not aggregate a view container assignment with the specified name, exception CX_WDR_RR_EXCEPTION is triggered.

CREATE_VIEW_CNT_ASSIGNMENT

This method creates a view container assignment aggregated to this view usage.

DELETE_VIEW_CNT_ASSIGNMENT

This method deletes a dynamically created view container assignment with the name provided.

A prerequisite is that a view container assignment aggregated to this view usage and of the specified name was generated dynamically (for example, with the method IF_WD_RR _VIEW_USAGE~CREATE_VIEW_CNT_ASSIGNMENT, IF_WD_NAVIGATION_SERVICES_NEW~PREPARE_DYNAMIC_NAVIGATION, or IF_WD_NAVIGATION_SERVICES_NEW~DO_DYNAMIC_NAVIGATION ).

Attempting to delete a view container assignment that was not created dynamically but using ABAP Workbench triggers exception CX_WDR_RR_EXCEPTION.

CREATE_NAVIGATION_TARGET

The IF_WD_RR_VIEW_USAGE~CREATE_NAVIGATION_TARGET method creates a temporary navigation target. If a navigation target already exists for the combination SOURCE_PLUG_NAME, TARGET_PLUG_NAME and TARGET_VIEW_USAGE_NAME, the method call has no effect. In this case, the return value is initial. If a navigation target with the same name already exists, exception CX_WDR_RR_EXCEPTION=>TARGET_ALREADY_EXISTING is triggered.

DELETE_NAVIGATION_TARGET

This method deletes a dynamically created navigation target with the name provided. If no relevant navigation target exists, the method call has no effect.

As a prerequisite for this, the navigation target to be deleted must have been created dynamically before hand (for example using the method IF_WD_RR_VIEW_USAGE~CREATE_NAVIGATI ON_TARGET , IF_WD_NAVIGATION_SERVICES_NEW~PREPARE_DYNAMIC_NAVIGATION, or IF_WD_NAVIGATION_SERVICES_NEW~DO_DYNAMIC_NAVIGATION ).

Attempting to delete a navigation target assignment that was not created dynamically but using ABAP Workbench triggers exception CX_WDR_RR_EXCEPTION.

DELETE_ALL_NAVIGATION_TARGETS

This method deletes all dynamically created navigation targets for the specified outbound plug.

IS_DYNAMIC

This method can be used to determined whether this view usage was generated dynamically or using ABAP Workbench.

IS_DIRTY

This method can be used to determine whether or not this view usage was already deleted.

 

 

End of Content Area