Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member186016
Active Contributor

ABAP Development Tools for Eclipse (version 2.7) enables you to develop Web Dynpro ABAP application faster. In the blog Developing Web Dynpro ABAP Applications using ABAP development tools (for Eclipse) I mentioned that you have context read, write and append template available.

You must be wondering where are all other code templates. They are coming in the next version of ABAP Development Tools as default. But if you miss them in ABAP Development Tool version 2.7, you can also create them yourself.

This video explains how you can create your own templates, which means you can define all Web Dynpro ABAP relevant code templates yourself. http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a09d95be-53f4-2f10-d191-9c7c4c457dee&override...

For your convenience, I have created and attached them as the xml (wda_templates.xml) file to this blog (Scroll down to find it). You can get all these templates in your development environment by executing following steps:

  • Download the XML file to your file system.
  • Start ABAP Development Tools.
  • Go to Windows->Preferences
  • Open Template preferences as shown in the image below:

  • Choose the button 'Import' and select the XML file
  • Press Apply and OK
  • You will now get the new template on the settings. They will also be available in the Implementation tab of Editors (as shown in the image below)

The great thing about templates is that you can create your own templates or even edit existing templates.

For example the template "generateMessage" has the following pattern inserted when triggered in Implementation tab.

"   getmessage manager

  DATA LO_API_CONTROLLER     TYPE REF TO IF_WD_CONTROLLER.

  DATA LO_MESSAGE_MANAGER    TYPE REF TO IF_WD_MESSAGE_MANAGER.

  LO_API_CONTROLLER ?= WD_THIS->WD_GET_API( ).

  CALL METHOD LO_API_CONTROLLER->GET_MESSAGE_MANAGER

    RECEIVING

      MESSAGE_MANAGER = LO_MESSAGE_MANAGER.

"   report message

  CALL METHOD LO_MESSAGE_MANAGER->${Method_Name}

You can go to Temlates preferences and edit it to something following (or something to your liking):

WD_THIS->WD_GET_API( )->GET_MESSAGE_MANAGER( )->${Method_Name}

Now, when you trigger the code templates, it works according to you. Have fun ! :smile: