If you’ve worked with other IDE’s outside of the SAP GUI/workbench, such as Visual Studio, you may be familiar with the concept of code hinting or code auto completion. Essentially, it’s like an auto-suggest feature like you’d see while writing a text message, except you can use it while you code to easily look up types, variable names, and more depending on what program you’re using to write your code.
But what does the ABAP workbench offer us in terms of on-the-fly code assistance?
Obviously we have access to Search Help with various function keys, you have the Pattern wizard, and you can always pull up SE11 or SE37 in another window to try and reference whatever you’re after. But that’s not exactly convenient, nor is it fast. Gee, wouldn’t it be nice to have a way to quickly reference a field in a structure, or tee up a fully built out method call, all by simply hitting a few keys on your keyboard in real time?
Bring in the CTRL Key!
The CTRL key in Workbench is the gateway to saving you a ton of time and hassle, and making you a much more efficient ABAP developer. Combined with other keys, you can do things such as dynamically suggest fields, structures, and types, while programming, and even build out fully-stubbed and ready-to-go function and method calls with no clicking required! Below, I’ll quickly go through some of the most useful ones:
Suggest fields / data types
In the example below, I use CTRL+SPACE key to suggest the data element I’m looking for, followed by the ENTER key to autocomplete my selection, and then use it again to show me the fields of the structure, along with their data type. All without a single click of the mouse or breaking my concentration by leaving the window!
Stub out method / function calls
Similar to the above, except this time I have a class I’ve created, and I’m trying to call one of the methods inside of it. I use CTRL+SPACE and the ENTER key to quickly access my class and find the method I want. Then, after it autocompletes the class method name, I hit CTRL+SPACE a second time, and immediately hit ENTER, and it stubs out the entire method call, complete with helpful comments pulled from the methods parameter setup!
So there you have it folks. You’d think this would be common knowledge and one of the first things people entering an IDE would expect to see in some form or another, but it’s staggering just how many ABAP folks (senior, even) that I’ve talked to that didn’t know about this little gem of info. If this tip changed your life, or if you know of even more neat things you can do with the GUI’s inline code hinting, leave a comment below and share the wealth!