Skip to Content

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:

/wp-content/uploads/2013/05/cc1_223172.png

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:

/wp-content/uploads/2013/05/cc2_223174.png       

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:

/wp-content/uploads/2013/05/cc3_223178.png

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,

Thomas.

   

To report this post you need to login first.

10 Comments

You must be Logged on to comment or reply to a post.

    1. Florian Henninger

      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.

      Regards Florian

      (0) 
  1. Former Member

    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.

    (0) 
  2. Bruno Esperança

    Thanks Thomas.

    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?

    Thanks.

    Best regards,

    Bruno

    (0) 

Leave a Reply