Monday, 20 June 2016

Enhancements in Web Dynpro ABAP- Part I

This document will help you to understand the concept of the Enhancement implementation in standard web Dynpro ABAP Component.

Basically there is no option to enhance the Web Dynpro ABAP component through BADI or User Exit, hence sap has provided a way to do that called “Enhancement Implementation”.

Using Enhancement Implementation we can do the following enhancements.
  • Enhancement of Component
    • Creating New view
    • Creating New window
    • Creating New Controller
    • Creating New Application
  • Enhancement of Window
    • Enhancing Embed views / Adding new views
    • Enhancing navigation link / Adding New links
  • Enhancement of View
    • Enhancing UI elements / Adding New UI elements
    • Enhancing Plugs / Adding New Plugs
  • Enhancement of Controller
    • Enhancing standard methods & Actions / Adding New methods & Actions
    • Enhancing standard Context / Adding New Context
    • Enhancing standard Attributes / Adding New Attributes
  • Deleting the Enhancement Implementation
And in this part we will be seeing about Enhancement of View and Window Controller.

Enhancement Implementation for View:


To create the enhancement implementation for view follow the steps.

1. Open the Web Dynpro Component using SE80.

2. Open the desired View to Enhance, in this given example I will take Standard Test component WDR_TEST_BG_BLEND.

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

3. Select the view and click on the Enhance button to enhance it and please provide Enhancement name in the next popup.

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

4. Now to view will be converted to Change mode as like this.

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

So now you will get an option to add new UI elements and remove the existing UI elements under the enhancement option that you have created.

Now I am going to add a new text view under the root container and give some text to that.

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

Save the changes and activate the whole component along with your enhancement implementation and run the application.

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

Enhancement implementation for Window:


Here we are going to see about enhancing the Window and adding the new view,

In this example I am going to create a new view and call that view inside another view using view container and enhancing the window controller.

Enhance the View 1 and add the view container (VC_MAIN) at last to bind another view.

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

To add new view into the standard web Dynpro abap component right click on the view and select the option create as enhancement.

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

Then it will be asking for the enhancement implementation, then select the implementation that we have created.

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

After the selection of enhancement it will be like the process of normal view creation.

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

Enhance the window using same enhancement implementation, and bind the view for view container that we created.

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP

Activate the whole component along with the enhancement implementation and execute the application.

SAP Module, SAP All Modules, SAP Tutorials and Materials, SAP UI Web Dynpro ABAP