A very powerful feature in Eclipse is the usage of code templates. Few months ago I already described in my blogInsert Code Patterns and Templates within Eclipse how to use it. Just start typing the name of the template and use code code completion to insert it into the editor. But often you have the situation that you already have some code that you want to surround with some code. I give you some examples:
The code templates in eclipse helps you to do that job very quickly as you will see in the following section:
Here I have a coded a very simple "Hello World" application in SAP style:
Perfectly working. Next step is a small enhancement in case there are no flights selected.
So I want to check the SY-SUBRC of the select statement and only if there are flights I want to display them in the ALV.
With Eclipse I do this by marking the code that I want to put into the IF/ENDIF clause and press CTRL-SPACE - the magic shortcut to open the template selection.
After selecting my template of choice the code is generated as you see here in the screenshot:
Also very helpful here is that the cursor is already positioned correctly so that I can directly go on with defining my expression.Try it out, this will really speed you up.
ONE MORE THING: In case you have additonal requirements concerning new templates you can also create your own templates via the templates view in eclipse. This I will explain in my next blog.
Regads,
Thomas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |