Thursday 29 December 2016

Enhancements in Web Dynpro ABAP-Part II

In part I , we have seen about enhancing the view and window of the standard web Dynpro ABAP component, in this Part we will be seeing about Enhancement of controller and deleting an Enhancement.

Enhancement of controller:


Enhancement of controller consist of enhancements of Context Nodes, Attributes, methods and actions.

Context Node Enhancement:


Each controller will be having the context assigned to it, Context nodes/attributes can be enhanced or new nodes/Attributes can be assigned to the context.

There will be two kinds of nodes,
  • Nodes without Dictionary structure mapping
  • Nodes with Dictionary structure mapping
IF the node is without DD mapping then you can add the attributes to it by right click on it -> create – > attribute.

Before to this step enable the enhancement implementation.

SAP UI  Web Dynpro ABAP, SAP Guides, SAP All Modules, SAP Tutorials and Materials, SAP Live, SAP Learning

SAP UI  Web Dynpro ABAP, SAP Guides, SAP All Modules, SAP Tutorials and Materials, SAP Live, SAP Learning

IF the node is with DD mapping then you can add the attributes to it by right click on it -> create using wizard- > attributes from components of structure. 

SAP UI  Web Dynpro ABAP, SAP Guides, SAP All Modules, SAP Tutorials and Materials, SAP Live, SAP Learning

Similarly you can add new nodes or attributes also to the same context by right click on the root context.

SAP UI  Web Dynpro ABAP, SAP Guides, SAP All Modules, SAP Tutorials and Materials, SAP Live, SAP Learning

Attribute Enhancement:


To enhance the attributes tab go to the required controller, and enable the enhancement implementation.

SAP UI  Web Dynpro ABAP, SAP Guides, SAP All Modules, SAP Tutorials and Materials, SAP Live, SAP Learning

Then the attributes tab will be enabled with Edit mode hence whatever the new additions are required or Existing attribute Edit( Except standard WD attribute) we can do here.

SAP UI  Web Dynpro ABAP, SAP Guides, SAP All Modules, SAP Tutorials and Materials, SAP Live, SAP Learning

Enhancements of method and actions:


There will be two possible things we can do in methods, Enhancing the existing method or adding new method

First enable enhancement implementation for the methods tab.

Then the tab will be converted into Edit mode hence we can add new methods here like normal Edit.

Enhancement of the existing methods can be done in any of the following 3 ways.
  • Pre Exit
  • Post Exit
  • Overwrite Exit
SAP UI  Web Dynpro ABAP, SAP Guides, SAP All Modules, SAP Tutorials and Materials, SAP Live, SAP Learning

We are not going to change the code of the existing method, instead we will select the Exit option & a new method will be created there we can write our business logic’s.

Pre Exit:


This method will be called before the execution of actual method, this will be called by wd_this reference by the controller and later actual method will be called.

Post Exit:


This is just an opposite of Pre Exit, this method will be called after the execution of actual method with wd_this reference by the controller.

Overwrite Exit:


Overwrite method will replace the execution of actual method hence in this case actual method will not even get called.

Similarly if you wants to delete the newly created methods you can use the delete options which will be available just above to the methods.

SAP UI  Web Dynpro ABAP, SAP Guides, SAP All Modules, SAP Tutorials and Materials, SAP Live, SAP Learning

Deleting Enhancement Implementation


To delete the Enhancement implementation, follow these steps
  • Go to transaction SE80
  • Select the package which you have saved the Enhancement object
  • Select the implementation and delete it like it showed here.
SAP UI  Web Dynpro ABAP, SAP Guides, SAP All Modules, SAP Tutorials and Materials, SAP Live, SAP Learning

SAP UI  Web Dynpro ABAP, SAP Guides, SAP All Modules, SAP Tutorials and Materials, SAP Live, SAP Learning
SAP Online Guides, Tutorials, Materials and Certifications.

Related Posts

1 comment: