Show TOC

DEMO_VALUE_HELPLocate this document in the navigation structure

Use

The package SWDP_DEMO in your system contains the Web Dynpro component DEMO_VALUE_HELP. This demo component demonstrates various value help technologies. This example deliberately excludes any subsequent business logic.

Setting the Value Help Mode in the Component DEMO_VALUE_HELP

The component DEMO_VALUE_HELP is the main component in this example. Your view V1 contains a range of InputFields for finding flight data records. Each InputField is bound to an attribute of the view context node SFLIGHT, but a different value help mode is activated for each of the attributes.

  • For the attribute CONNID, the value help mode Freely Programmed is selected.

  • For the attribute CARRID, the value help mode Dictionary Search Help is selected.

  • For the attribute FLDATE, the value help mode Object Value Selector is selected.

Dictionary Search Help

The ABAP Dictionary search help is integrated completely into Web Dynpro runtime and requires no further implementation.

Freely Programmed Input Help

A freely programmed value help is always implemented using a second component created by the application developer. The developer has all design features of the Web Dynpro Framework at his or her disposal. The usage of this component must be entered in the main component. The declaration of the required usages is entered on the Properties tab page of the component DEMO_VALUE_HELP and also on the Properties tab page of the view V1.

Freely Programmed Value Help Component FREE_VALUE_HELP

The database table SPFLI contains all existing flight connections, with each connection number ( CONNID) entered precisely once. This makes this table suitable as a value help table for the search screen of the flight table SFLIGHT. The view of the free value help component FREE_VALUE_HELP contains, therefore, a selection of attributes of the connections table SPFLI, displayed in a table format.

Figure 1: Value Help with Freely Programmed Component

Implementation of the Interface IWD_VALUE_HELP

The component FREE_VALUE_HELP itself implements the Web Dynpro interface IWD_VALUE_HELP, which is predefined on the system side.

When implementing this interface, the Interface Controller of the component enhances the component with the two events VH_WINDOW_CLOSED and VH_WINDOW_OPENED. Using these two events, the main component can be informed of the events in the value help component, for example, to set clean up processes in motion. However, these events are not triggered iIn the example.

The interfaces also implements an interface view in the component FREE_VALUE_HELP. The value help view V2 must be embedded in the window for this interface view.

Figure 2: Window of the Interface IWD_VALUE_HELP

Implementation of "Close" for the Value Help Dialog Box After Selecting an Entry

In the example above, the value help window includes an Apply Values button. The action DATA_SELECTED is linked to this button. The event handler method of this action triggers the follow-on event VH_DATA_SELECTED, which is handled by the view controller of the component DEMO_VALUE_HELP. The method CLOSE_WINDOW( ) in the interface IF_WD_VALUE_HELP_LISTENER is also called. This interface is passed automatically to the value help component after the component is created (using the method SET_VALUE_HELP_LISTENER). Calling the CLOSE_WINDOW( ) method closes the value help window after the Apply Values button is chosen.

Implementation of the Title of the Value Help Window

The assistance class CL_ASSIST_FREE_VALUE_HELP is used to create a text element (see below) for the title of the value help window. This text element is passed to the value help component by the method WDDOONOPEN in the window controller.

OVS Value Help

The final example in the demo application adds an OVS Value Help to the input field for the context attribute FLDATE. Two main steps are necessary in the application component:

  • Configure a usage of the system component WDR_OVS for the application component, its view, and the appropriate context attribute.

  • Program the event handler for the OVS event in the view controller of the application component.

The system component WDR_OVS provides all required elements, such as the value help view and the event OVS. When you create the event handler method for the OVS event, a source code template is generated automatically. You can use this template as part of your programming. A BAPI is used to retrieve the required data for the value help.

The assistance class WD_ASSIST_VALUE_HELP of the example component DEMO_VALUE_HELP includes some additional text elements that you can use as labels in the value help component.

To edit the text elements, go to class builder and choose Start of the navigation path Goto Next navigation step Text Elements End of the navigation path.