Skip to Content
Technical Articles

How can we create Code Templates in SAP HANA Studio to Generate code Smartly?

Introduction

This Blog will help in saving Code Templates that you can use in any ABAP Program.

Code Templates can be used for the following

  1. Generate ALV Grid of Report
  2. Sending email to External Email
  3. Upload File from Presentation Server.
  4. Download File to Presentation Server
  5. Upload File from Application Server.
  6. Download File to Application Server
  7. Flower Box

Above are a few examples. Please note that this concept is not eliminating creation of reusable Function Module and Class as this will also help then in using those Classes. I have saved a lot of time using this concept and it is a Hidden Treasure for ABAPers. One greatest advantage in SAP HANA Studio is that you can have some dynamic variables that helps us to create Dynamic Flower Box and other features you can think of.

Check below Blog for Code Template creation in SAP GUI.

https://blogs.sap.com/2020/10/05/how-can-we-create-code-templates-in-abap-editor-se38-se80-the-google-way/

Check below Blog for enabling Code Hints for Non Keywords

https://blogs.sap.com/2020/09/30/how-can-we-enable-code-hints-for-non-keywords-in-abap-editor-se38-se80-the-google-way/

 

Solution

This solution is available in SAP HANA Studio

First we need to open the SAP HANA Studio and you create a Zprogram

Now Right Click and Select Preferences

Select ABAP Templates-> New

Create the Template and Provide your code as explained below and click OK and Apply and Close

 

Now start typing the Template name and Press CTRL+Spacebar in Keyboard

 

Wala the Code has been generated

 

Conclusion

You can use this in the SAP HANA Studio.

 

Check below for video version

 

Be the first to leave a comment
You must be Logged on to comment or reply to a post.