Using Wildcards in Code Completion to insert code patterns
One of the most powerful features of source code editors is for sure the code completion.
In ABAP in Eclipse you use this for example also to insert code patterns into your source code.
I described this already in one of my last blogs: Insert Code Patterns and Templates within Eclipse.
Normally you just type the first characters of the method or function to insert the pattern into your code using SHIFT-ENTER:
But sometimes you don’t know the exact name of the function or method but only parts of it.
In the insert pattern dialog in SE80 you use the F4 help to find the object that you need.
But how can you do that in Eclipse?
It is quite simple. We also support wild cards in the code completion in ABAP in Eclipse.
So let’s assume you want to call on the ALV control a method to define the layout.
Here we go. Just use asterisks and press CTRL-SPACE to restrict the result of the code completion like here:
Or you are searching for a function that returns you information about classes. Wild cards also work for function modules as you see here in the example:
When choosing an item from the result list via SHIFT-ENTER the code pattern is generated into your code.
Another small but very helpful feature I guess.
Have fun and Regards,
This is not so intuitive in the beginning but quite powerful afterwards !
Has helped in my ABAP learning days 🙂
This is an awesome feature 😘 (Eclipse)
does not work in the abap trial version, unfortunately
Does work very well. What version do you download?
Tried it by using cl_alv_grid class and does exact what it should do...
So, check for updates.
Perhapse I was not specific enough. I am using 7.03 version available for download from here http://www.sdn.sap.com/irj/scn/nw-downloads . Is it expected that this functionality should be working on that version?
I'm not sure, if it works in that version.
Update your ABAP-Tools right out of eclipse with this link
SAP Development Tools for Eclipse - Kepler Software Repository
, then you get the tools to Version 1.90 and here, i'm pretty sure it works fine.
The last example "code-completion with signature and wildcards" ( CALL FUNCTION 'SEO*CLASS*GET*' ) does not work as described.
When there are still wildcards present the codecompletion will only add the complete function or method name - but the signature won't be added even though SHIFT-ENTER was requested.
But when the function/methodname is spelled partially or completly without wildcards ( like cl_gui_frontend_services=>gui the codecompletion will suggest gui_download and gui_upload ) when hitting SHIFT+ENTER it will add the method/function including the signature as expected.
Thanks for reporting.
Note 1962353 should solve this issue.
Not a small feature at all. Could actually even be a deal breaker for some 🙂
Quick question, what if you don't know the first letter of the function module, does it still work?
Yes, this works also if you use a wildcard in the very beginning.