Quantcast
Channel: ABAP Development
Viewing all articles
Browse latest Browse all 948

Shortcuts that can make an ABAP'er life easier

$
0
0

Introduction

 

ABAP is quite different from many contemporary programming languages in several ways. Some aspects of ABAP would make us wonder why is it made this complex while some aspects are so awesome and more comfortable for a programmer than any other language can provide.

 

Two of those things that I find so cool are:

  • Its ingenuous IDE (ABAP Editor) and
  • Its cool Debugger

 

Eventhough the SAP IDE does not support some of the features which more prominent IDE's like Eclipse etc have, I find it so comfortable to code in ABAP Editor compared to others. The reason is because of the below shortcuts and customizations available with it. I am listing the few which I use constantly and without which I cannot think of coding ABAP.

 

Most of the programmers even with a little bit of ABAP experience would have come accross the details listed here. If you have, please ignore and if you haven't then the stage is yours..

 

Shortcut

What it does

Ctrl + D

Duplicate any line.

eg. i_vbap TYPE STANDARD TABLE OF vbap + Ctrl-D = i_vbap TYPE STANDARD TABLE OF vbap
i_vbap TYPE STANDARD TABLE OF vbap

Ctrl + /

Jump to the "command field" where we enter t-codes. This comes really handy and saves a jump from keyboard to mouse and back to keyboard just to click on the box.

Ctrl + J

Convert to Proper case where the first letter of every word becomes a capital letter. This is pretty useful when writing comments.

eg.  * this is a comment which will give absolutely no useful information will be changed to
* This Is A Comment Which Will Give Absolutely No Useful Information

Ctrl + I  &
Ctrl + Shift + I

Incremental search. This is a little improved 'Find' (Ctrl + F) function which searches as soon as you type. Useful for impatient people. Add shift to search backwards.

Ctrl + K

Toggle between Upper case and Lower Case.

Alt + Selection

This is useful in situation where you need to select only the field names of a particular table.

eg.

caufv-aufnr,

caufv-werks,

caufv-objnr,

caufv-plnbez,

caufv-gamng,

caufv-gasmg,

caufv-gmein,

caufv-plnnr,

caufv-plnal,

caufv-dispo,

caufv-fevor,

caufv-cy_seqnr ,

caufv-aufpl,

caufv-gstrp,

caufv-gltrp,

caufv-gstrs,

caufv-gltrs,

caufv-gstri,

caufv-gltri,

 

In these values, u can select only the field names by pressing Alt key and get the clipboard filled like this.

 

aufnr,

werks,

objnr,

plnbez,

gamng,

gasmg,

gmein,

plnnr,

plnal,

dispo,

fevor,

cy_seqnr ,

aufpl,

gstrp,

gltrp,

gstrs,

gltrs,

gstri,

gltri,

Tab & Shift tab

Increase and Decrease Intend

Ctrl + O

Goto a particular line in the program

Ctrl + Shift + S

Save your program in Desktop in .abap format. I came know about .abap only after learning this short cut.

Ctrl + Selection

When you do a selection with **** + -> or <- hold on to Ctrl to jump every word in that direction.

Ctrl + . & Ctrl + ,

Comment and Un-Comment selected lines.

Ctrl+Alt+T

Swaps current line with the Upper Line.
eg. INCLUDE ZTEST_ABAP_HTTP_CLIENT_TOP.
     INCLUDE ZTEST_ABAP_HTTP_CLIENT_C01. becomes


INCLUDE ZTEST_ABAP_HTTP_CLIENT_C01.
INCLUDE ZTEST_ABAP_HTTP_CLIENT_TOP.

Ctrl+Shift+L/XDeletes the whole line

 

More Editor Tools:

 

Apart from this, there are a few other things that can be set in Editor options

 

 

like,

 

Code Templates

 


 

 

Here I use a template for the text. This could be a text that is used for marking modifications or Defenition and implementation of local classes etc.


  * Begin of Insertion <SID>K12345 <username>
* End of Insertion   <SID>K12345  <username>

 

i.e when I press i* in the editor, it will prompt for code completion..

 


 

When I press Tab for completion, it pops up for TR Number…

 

 

The TR number that we give will be added in the comment.


Variable Name Suggestions

This is just a small setting but it will save you from Copy pasting or re-typing small words.

 

When you check this box, it will suggest even for variable names like…

 

Particularly useful for longer variable names.

 

 

Conclusion

 

Apart from the editor and debugger functions, the navigation and where used-list  are other funtionalities which we use more often. Especially the code maintenance and support activities are comparitively less hectic just because these features.

 

Another cool way to extend its core editor functionality for customizations could be by providing API's even for the application programmers to code and customize the editor features. It will also add to the creativity aspect on SAP side since any third programmer could come with an awesome idea as an editor extension.

 

As far as I have explored, I havent found any BADI or classes which can be used to perform editor functions. May be I have to look more or wait...



Viewing all articles
Browse latest Browse all 948

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>