IF_WD_RR_VIEW_CNT_ASSIGNMENT
Interface IF_WD_RR_VIEW_CNT_ASSIGNMENT belongs to the API for the Web Dynpro Runtime Repository.
Interface IF_WD_RR_VIEW_CNT_ASSIGNMENT allows access to the metadata for a Web Dynpro view container. A view container is a special area in a view, where another view can be embedded.
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 (see interface IF_WD_RR_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.
View VIEW_MAIN is embedded into window WINDOW_MAIN in a Web Dynpro component. The embedding position of the view in the window is expressed by view usage USAGE_VIEW_MAIN. The view container assignment of view VIEW_MAIN is accessed, for example, in a method of the component controller as follows:
|
data:
data: l_cmp_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_view_cnt_assignments type wdrr_vca_objects.
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' ).
l_view_cnt_assignemtns = l_view_usage->get_view_cnt_assignemtns( ). |
This method embeds the specified view into the container.
Result
Name |
Description |
RESULT( reference to IF_WD_RR_VIEW_USAGE) |
Created view usage |
Parameter
Name |
Description |
NAME (Type STRING) |
Name of the view usage |
USED_VIEW_NAME (type STRING) |
Name of the view to be embedded |
COMPONENT_USAGE_NAME (type STRING) |
Name of the component usage of the component to which the view to be embedded belongs This parameter is optional and must only be specified if the view belongs to an embedded component. |
This method deletes the specified view usage.
As a prerequisite for this, the view usage to be deleted must have been created dynamically (for example using methods IF_WD_RR_VIEW_CNT_ASSIGNMENT~CREATE_EMBEDDED_VIEW_USAGE, IF_WD_NAVIGATION_SERVICES_NEW~PREPARE_DYNAMIC_NAVIGATION or IF_WD_NAVIGATION_SERVICES_NEW~DO_DYNAMIC_NAVIGATION). A statically created view usage – created using ABAP Workbench - cannot be deleted.
Result
Name |
Description |
SUBRC (Typ I) |
This parameter has value 0 if the view usage has been deleted successfully. |
Parameter
Name |
Description |
NAME (Type STRING) |
Name of the view usage |
Exception
Attempting to delete a view embedding that was created with ABAP Workbench triggers exception CX_WDR_RR_EXCEPTION. |
This method returns the description object for the view container belonging to this view container assignment.
The following relationship exists between a view container assignment and the view container that belongs to it:
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 multiply 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 view containers CONTAINER_01 and CONTAINER_02. There is now exactly one view container assignment per view usage and view container.
Result
Name |
Description |
RESULT (Type STRING) |
Name of the associated view container |
This method returns the description object for the view usage of the default view embedded into this view container.
Result
Name |
Description |
RESULT( reference to IF_WD_RR_VIEW_USAGE) |
View usage of the view usage embedded in this view container |
This method returns the description objects for the view usages of all views embedded into this view container.
Result
Name |
Description |
RESULT (type WDRR_VIEW_USAGE_OBJECTS) |
Table of the view usages of all views embedded into this view container. |
This method returns the description object for the view usage of one of the views embedded into this view container.
Result
Name |
Description |
RESULT( reference to IF_WD_RR_VIEW_USAGE) |
Description object of the view usage |
Parameter
Name |
Description |
NAME (Type STRING) |
Name of the view usage |
Exception
If view usage NAME does not exist, the system triggers exception CX_WDR_RR_EXCEPTION. |
This method returns the name of the view container assignment.
Result
Name |
Description |
RESULT (Type STRING) |
Name of the view container assignment |
This method returns the description object for the higher-level view usage.
Result
Name |
Description |
RESULT( reference to IF_WD_RR_VIEW_USAGE) |
Created view usage |
This method returns the description object for a view with the specified name – if it exists - that is embedded in this view container.
A view can only be embedded once into a view container. The result of this method is therefore unique.
Result
Name |
Description |
RESULT( reference to IF_WD_RR_VIEW_USAGE) |
Description object of the view usage of the view with name VIEW_NAME that is embedded in the view container. If no view with the name VIEW_NAME is embedded in the view container, this parameter is set to initial. No exceptions are triggered. |
Parameter
Name |
Description |
VIEW_NAME (type STRING) |
The name of the view that is embedded in the view container. |
COMPONENT_NAME (type STRING): |
The name of the view component. This parameter is optional and must only be specified if the view belongs to a different component than the window in which it is to be displayed. |
COMPONENT_USAGE_NAME (type STRING) |
The name of the component usage. This parameter is optional and must only be specified if the view belongs to a different component than the window in which it is to be displayed. |
This method specifies whether the view container belonging to this view container assignment was created dynamically.
Result
Name |
Description |
RESULT (type ABAP_BOOL) |
Specifies whether the associated view container was created dynamically. Possible values are: ● ABAP_TRUE: The view container was created dynamically. ● ABAP_FALSE: The view container was not created dynamically. |
This method specifies whether this view container assignment has already been deleted.
Result
Name |
Description |
RESULT (type ABAP_BOOL) |
Specifies whether the view container assignment has already been deleted. Possible values are: ● ABAP_TRUE: The view container assignment has already been deleted ● ABAP_FALSE: The view container assignment has not been deleted yet |
This method specifies whether this view container assignment was created dynamically.
Result
Name |
Description |
RESULT (type ABAP_BOOL) |
Specifies whether the view container assignment was created dynamically. Possible values are: ● ABAP_TRUE: The view container assignment was created dynamically ● ABAP_FALSE: The view container assignment was not created dynamically |
This method sets the specified view usage as default. This causes the view embedded under this view usage to be displayed as the default view in the container.
Parameter
Name |
Description |
VIEW_USAGE_NAME (type STRING) |
Name of the view usage |