Sunday, November 16, 2008

Adding new template in the ABAP editor

The editor has a very useful time saving feature that allows insertion of templates based on key words. Say you want to write a procedure HELLO_WORLD. For this you would write a form

**********************************************************************
* Perform HELLO_WORLD
**********************************************************************
PERFORM HELLO_WORLD.
PERFORM.


That’s writing 5 lines of code by hand. To automate this part go to the ABAP editor settings



image



then Code Templates



image



and enter template for perform with this



**********************************************************************
* Perform %Variable name%
**********************************************************************
PERFORM |%Variable name%.
%SurroundedText%
PERFORM.




In the editor when you write PERFORM and hit a tab once the template key highlight comes up you should get a pop up for your variable



image



This will write the code as above