Show TOC

DEMO_CONTEXT_CHANGELocate this document in the navigation structure

Definition

The demo application DEMO_CONTEXT_CHANGE shows you how to handle the change log functions in context nodes . When you start the Web Dynpro application, a browser window consisting of three sections appears. The top section of the view shows you a table and an input screen. You can display any changes you make in the top sections in the table at the bottom of the view.

Use

There are four buttons below the two editable UI elements.

  1. Enter

  2. Display and Reset Changes

  3. Activate Changes

  4. Deactivate Changes

To demonstrate the change log functions, choose Activate Changes . This triggers the event ENABLE . The handler method of this event calls the method ENABLE_CHANGES in the component controller. The method ENABLE_CHANGES calls the change log functions in the interface IF_WD_CONTEXT (see the documentation link above). The context of the component controller is now ready to record changes. You can now select a different row in the top table of the view and choose Enter . If you then choose Display and Reset Changes , the change is displayed in the context in the bottom table.

You can change values in the input screen in the same way. When you choose Enter and Display and Reset Changes again, all changed attributes are displayed with their new and old values in the table. To disable the change log functions, choose Deactivate Changes .

The implementation in the example is very simple; the context nodes CARR and BOOK were created in the component controller and copied and mapped to the view controller. The view controller context also contains the node CHANGES , in which you can retain all changes for display. This context node maps the structure of the internal change log table. The event handler method ONACTIONGET_CHANGES of the Display and Reset Changes button is used to fill the node. To enable this, the interface IF_WD_CONTEXT provides the method GET_CONTEXT_CHANGE_LOG .

Note

The context node CHANGES is for demonstration purposes only and was designed only to make the content of the internal table visible on the interface. This node is not generally required in a real application.

Note

More information is available in Programming Manual for Web Dynpro ABAP