Beruflich Dokumente
Kultur Dokumente
The design of contexts is very important for the performance of large Web Dynpro ABAP applications. A large number of context nodes and attributes will reduce performance and increase memory requirement at runtime. Since a range of UI element properties provide the binding to a context attribute, the number of context attributes can exceed the number of UI elements many times over. To prevent the implementation of large numbers of context attributes, as an alternative, the properties of the context attribute to which the primary property of the UI element is bound can be used to bind the UI element properties. The primary property is especially important for a UI element. Other properties of the UI element can be dependent on the value of the context attribute to which the primary property is bound. Provided the UI element is available, the primary property is always the same, for example:
The property value for the UI element InputField The property text for the UI element TextView The property checked for the UI element CheckBox Some UI element properties can be bound directly to the context attribute of the associated primary property, which means a new context attribute does not have to be especially created. The Web Dynpro ABAP framework enables the following UI element properties to be bound in this way:
required (not relevant in WD ALV usage) read_only visible enabled To use attribute properties in the WD ALV component, the DATA node mapped or propagated to the component has to be supplied with an internal table containing the properties for that specific DATA node. The internal table must be of type WDR_CONTEXT_PROP_FOR_NODE_TAB. The rows of that table must be of structure type WDR_CONTEXT_NODE_PROP_FOR_NODE. All attribute properties are of type WDY_BOOLEAN. The following example shows how the attribute properties are set up for a DATA node mapped to a WD ALV instance:
l_elements type i.
l_elements = lr_node->get_element_count( ).
do l_elements times. add 1 to l_element. clear ls_attribute_properties. ls_attribute_properties-element_index = l_element. do 3 times. case sy-index. when 1. ls_attribute_properties-attribute_name = 'CARRID'. when 2. ls_attribute_properties-attribute_name = 'CONNID'. when 3. ls_attribute_properties-attribute_name = 'FLDATE'. endcase. ls_attribute_properties-visible = abap_true.
Property
Type
Description
read_only
WDY_BOOLEAN
Controls the read only state of a table cell. ABAP_TRUE if the cell should be readonly, ABAP_FALSE if it should be editable.
visible
WDY_BOOLEAN
Controls the visibility of a table cell. ABAP_TRUE if the cell should be visible, ABAP_FALSE if it should be invisible.
enabled
WDY_BOOLEAN
Controls the enabled state of a table cell. ABAP_TRUE if the cell should be enabled, ABAP_FALSE if it should be disabled.
The following code snippet shows how the bindings for all three properties are set up for a specific column editor.
lr_input_field->set_visible_fieldname( |{ ls_column-id }:{ 'VISIBLE' }| ). lr_input_field->set_enabled_fieldname( |{ ls_column-id }:{ 'ENABLED' }| ). lr_input_field->set_read_only_fieldname( |{ ls_column-id }:{ 'READ_ONLY' }| ).
Important Note: If using attribute properties, it is also mandatory to provide the SALV_WD_TABLE_INDEX attribute (type SYTABIX) as additional attribute in the DATA node. For further bakcground information regarding the attribute properties feature in the Web Dynpro ABAP Framework see also the official Web Dynpro ABAP developer documentation. The application SALV_WD_TEST_TABLE_ATTRPR, which is officially released together with the actual WD ALV component implementation also shows the usage of attribute properties in a concrete sample application environment. Table of Contents
The following code snippet exemplarily outlines the creation of an application function and its editor in shape of a ToggleButton and the subsequent binding for its checked property.
lr_toggle_button
create object lr_toggle_button exporting checked_elementname = 'CHECKED'. lr_toggle_button->set_text( 'MYTOGGLEBUTTON' ). lr_toggle_button->set_image_source( 'ICON_FLIGHT' ). lr_toggle_button->set_checked_image_source( 'ICON_FLIGHT' ). lr_function->set_editor( lr_toggle_button ).
Furthermore the application SALV_WD_TEST_TABLE_TOOLBR, which is officially released together with the actual WD ALV component implementation also shows the correct definition and handling of the FUNCTION_ELEMENTS node in a concrete sample application environment. Table of Contents
Value
Description
Hides all data rows. The result rows of sub total level 1 and higher remain visible.
Hides the result rows of the sub totals level 1. Ony the result rows for sub total level 2 and higher (if applicable) remain visible.
Collapses all total and sub total nodes. Only the total rows and sub totals of level 1 remain visible.
Please note that this approach only works, if the method IF_SALV_WD_FIELD_SETTINGS~SET_GROUP_AGGR_COLLAPSED has been set to ABAP_FALSE, which is the default in an WD ALV Configuration Model. Note: Subtotal levels are displayed graphically in the results row in the output: The lowest subtotal level 1 is represented by a bullet point beside the result, the next-highest is represented by two bullet points, and so on. By clicking on one of these symbols, the user displays or hides the entries that were used to create these results. This ability to display the data records of a single result is not available via the WD ALV Configuration Model. You always display or hide entire subtotal levels with all entries. This is known as a homogenous drilldown. Table of Contents
This means that the differentation between validating and non validating actions is currently not supported and can therefore not be specified via the WD ALV Configuration Model. The concept might be supported in future releases, but so far there are not definitive plans in that direction. Table of Contents
By default, if a view is saved, the specific WD ALV component instance is automatically associated to a so called configuration key. This key is used to uniquely identify the personalization data in shape of the stored views, which have been persisted for that WD ALV instance. The key is composed of the following components:
USAGE PATH: The location of the current application in the Web Dynpro application hierarchy. ALV_COMPONENT_USAGE: The name of the component used in the embedding application component. To now use that personalization data across the borders of a single Web Dynpro application component or Web Dynpro View, a different approach has to be pursued. Therefore a stable configuration key has to be provided. This is necessary to achieve that the key is not generated automatically on-the-fly by the WD ALV component itself. For this purpose the WD ALV component provides a dedicated Personalization API. This API is part of the public SALV_WD_TABLE component interface. The relevant method is called GET_CONFIG_API. This API method is leveraged to specify an application specific configuration key. The key must fulfill the following conditions:
It identifies the application in which the WD ALV output is displayed. The field USAGE_PATH from _S_PARAM_OUT_ can be used for this purpose. It identifies the ALV output within the application. If multiple ALV outputs are displayed in the application, it must be possible to distinguish them from one another. To do this, the field ALV_COMPONENT_USAGE can be used, which returns the component usage for the individual WD ALV output. It identifies the structure that is displayed in the ALV output with SET_DATA or via reverse context mapping and bind_table. To do this a free identifier in shape of any unique character string can be used for instance. If these three components are connected to one another, a key that identifies a structure sufficiently can be generated. This way, a view can be assigned uniquely. The following example shows the steps in an example method SET_ALV_CONFIG_ID, that are required for generating and assigning the configuration key.
lr_node own_key
OWN_KEY = 'ALV1'.
[ ... ]
*... Create configuration key consisting of usage path, component usage, own key data: ls_param_out type if_salv_wd_table=>s_type_param_config_out, ls_param_in l_key l_key_32 type if_salv_wd_table=>s_type_param_config_in, type string, type string.
*... Hash configuration key to unique key of 32 chars length try. l_key_32 = cl_rsmds_hash_utilities=>to_hash_c32( l_key ). catch cx_rsmds_input_invalid cx_rsmds_input_invalid_type. endtry.
[ ... ]
[...] endmethod.