In this post, you will learn about shortcuts that can be used while using SAPGUI code editor.
The most used shortcuts after copy-paste i.e. Ctrl + C
– Ctrl + V
are probably below 3.
- Pretty Printer
Shift + F1
- Check Syntax
Ctrl + F2
- Activate Object
Ctrl + F3
This is based on my experience and you may find some more useful and some not so much, but here is the list.
Ctrl + Mouse left click
(Select any text)
Press and hold Ctrl
, then click on any word, it will get selected.
![](https://discoveringabap.com/wp-content/uploads/2021/11/image-13.png?w=878)
For selecting the texts, there are few more options.
Key | Description |
---|---|
| Select from the cursor in any direction, one character at a time |
Shift + Ctrl + Arrow Keys | Select from the cursor in any direction one word at a time |
Shift + Mouse Left Click | Selects from cursor position to the mouse click position. This one is the fastest of all. |
Alt + Shift + Arrow Keys ORAlt + Shift + Mouse left click | This is a block selection. Such a cool feature that it is covered in another post. |
C
trl + D
(Duplicate any line)
Put the cursor anywhere on the line to be copied and go for Ctrl + D
and you will get below.
![](https://discoveringabap.com/wp-content/uploads/2021/11/image-14.png?w=880)
It is helpful while defining types and also in scenarios where you want to call a method multiple times with different parameters, say calling a method to set ALV column texts.
Change Case of the words
Ctrl + L
(Selected text to lower case ) and Ctrl + U
(Selected text to upper case)
Suppose your usual coding guidelines say that the key words should be upper case and non-key words should be lowercase. Here, you can go for Pretty Printer using Shift + F1
but that will not work if you are modifying an existing code and don’t want to change anything other than the code you added. Select LV_SOME_VAR, use Ctrl + L
then select type and use Ctrl + U
![](https://discoveringabap.com/wp-content/uploads/2021/11/image-15.png?w=854)
Ctrl + Shift + L
OR Ctrl + Shift + X
Delete a line
No more pressing backspace or delete button repetitively get get rid of a line. Put cursor on the line and use the keys.
![](https://discoveringabap.com/wp-content/uploads/2021/11/image-17.png?w=1024)
Then we have few which don’t need any explanation and you are probably already using these.
Key | Description |
---|---|
Tab | Increase indent |
Shift + Tab | Decrease indent |
Ctrl + F | Open a search dialog box |
Ctrl + H | Open a replace dialog box |
Ctrl + S | Save the code |
Ctrl + , | Comment the line (to be precise it adds a * at the begin of the line) |
Ctrl + . | Un-comment the line (to be precise it removes a * at the begin of the line) |
Comment and un-comment are very useful when working with group of lines. Below is an uncomment example.
![](https://discoveringabap.com/wp-content/uploads/2021/11/image-16.png?w=1024)
Code Completion
Ctrl + Space
shows field names or a structure, methods/attributes of a class and so on. Select the one that you want using mouse or arrow keys and press Tab.
Tab
is also used when a key word is suggested and you want to use it, so this is no different.
![](https://discoveringabap.com/wp-content/uploads/2021/11/image-18.png?w=1024)
Contrary to other posts in this series, this post does not have details on Eclipse shortcuts. Those are covered in a separate post – Working With Eclipse [5] : Keyboard Shortcuts for ABAP Development in Eclipse.
To know more about such cool features visit ABAP editor page.
If you like the content, please subscribe…