The concept of a selection screen variant is something that most SAP users have come to expect, yet this feature is unavailable in standard Web Dynpro. Below is the next in a series of posts detailing how to bring this necessary feature back to Web Dynpro. Start here to see the full requirements.
The MAIN view has a very simple layout. Drop three Web Dynpro buttons on the view, named as shown below.
All of the real work in the MAIN view happens in the Methods.
The flow is essentially the same for each button on the Layout, with some minor differences between them.
- Each button is assigned an action: ONACTIONBTN_GET_CLICK, ONACTIONBTN_SAVE_CLICK, and ONACTIONBTN_DELETE_CLICK.
- The button click event then creates an instance of a window: W_GET_VARIANT (for Get and Delete) or W_SAVE_VARIANT (for Save). The [OK] button of the window is assigned to another event: ONACTIONGET_OK, ONACTIONSAVE_OK, and ONACTIONDELETE_OK.
- In the case of the Save and Delete operations, a confirmation window may be displayed in which a second [OK] button is tied to an event: ONACTIONSAVE_CONFIRM and ONACTIONDELETE_CONFIRM.
- Following all the user interaction and validation the requested operation is executed at the Component Controller level.
In the next post, I’ll detail my implementation of the Get Variant process flow.