Skip to Content

A famous feature in the ABAP workbench editor is to insert code patterns into your source code.

I mean the magic behind this button in the editor toolbar:

 

Pattern.png

 

And with ABAP in Eclipse this feature is gone 😯

–> NO WAY ! It is integrated with the code completion

 

See this small video tutorial to learn how to use this feature:

 

In addition to that we also have static code templates available in Eclipse. A flexible way to easily generate code in your editor. You can also define your own templates and use them. A good example is the template to generate a local test class.

 

See this small video tutorial to learn how to use this feature:

Regards and have fun,

Thomas.

 

To report this post you need to login first.

18 Comments

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

  1. Former Member

    Hi Thomas,

     

    Thank you for great hints. I could not find insert pattern for function module before, and it is so simple – the trick with autocompletion and SHIFT + ENTER.

     

    Regards

    Adam

    (0) 
  2. Former Member

    Hi again,

     

    I like pattern build in code completion, however it looks like pattern for FORM is missing? Insert FORM pattern in SAP GUI lists all available subroutines in main program. When I type PERFORM and then beginning of form name with CTRL + SPACE, nothing is found. It may work in case if forms are in same include. As we often need to work with legacy code, having pattern for FORMs in program would be helpful, otherwise we need to open include in SAP GUI and insert pattern there. Any tips here?

     

    Regards

    Adam

    (0) 
      1. Former Member

        Hi Uwe,

         

        I still have a chance with Easter rabbit.

         

        I get often questions from experienced SAPpers (they can make mistake only once ) about missing things in eclipse, when they are trying to show that eclipse is not good enough yet. And FORM pattern is one of weaknesses, to be honest it may be useful if we work much with legacy code and that is reality. Another case hard to defend is not allowed activation or “where used search” for include used in many programs, but that is another story. Need to switching to embed GUI too often may burn eclipse desire. Not with me anyhow, I am fan of it.

         

        Regards

        Adam

        (0) 
    1. Thomas Fiedler Post author

      Hi Adam,

      I have just check it and it works. I closed my door and darkened the room to create a form routine in a report with ABAP in Eclipse     

      The Code Completion wizard displayed it after typing PERFORM …

       

      Regards,

      Thomas.

      (1) 
      1. Former Member

        Hi Thomas,

         

        Great hint with doors closing, I must remember it

        It might be that you are using FORM that you just created or it is in same include or you have latest AIE 2.7. Anyhow, I accept answer “works on my PC” (sometimes I saw it was working as well), I just wanted to check if there is maybe hidden option with same dialog as for pattern button.

         

        Regards,

        Adam

        (0) 
  3. Former Member

    Hi colleagues,

     

    I was just pointed to a feature of the SE80 patterns that I did not yet find in Eclipse:

     

    activating the option ‘Name of Actual Parameter Same as Formal Parameter’ in the settings of the SE80 ABAP Editor yields a nice hidden feature only available when using the ‘Pattern’ dialogue: it will generate variable declaration with correct data types.

     

    Example:

    *DATA FIELDS TYPE STANDARD TABLE OF SVAL.

    CALL FUNCTION ‘POPUP_GET_VALUES’
       EXPORTING
    *   NO_VALUE_CHECK        = ‘ ‘
         popup_title           = popup_title
    *   START_COLUMN          = ‘5’
    *   START_ROW             = ‘5’
    * IMPORTING
    *   RETURNCODE            = RETURNCODE
       TABLES
         fields                = fields
    * EXCEPTIONS
    *   ERROR_IN_FIELDS       = 1
               .
    Any chance to have that generated in Eclipse, too?


    Regards

    Markus

    (0) 
    1. Thomas Fiedler Post author

      Hi Markus,

      you are right. This option is missing in Eclipse. The data declarations are only generated by pattern function in the GUI edior but not for the Shift-Enter Function of code completion. We will offer a new Quick Fix in Eclipse “Add Data Declaration” which generates the missing variables into your code. I have already tested it yesterday in our dev system. Really cool stuff.

       

      Regards,

      Thomas.

      (1) 
  4. Christine Arundell

    Hi Thomas,

     

    I really like the auto-completion of function calls in ADT using SHIFT+ENTER – but I’ve found that for some function modules, it doesn’t work – instead I get the message ‘Code information isn’t available#’ when I use CTRL+SPACE to find the function module in question.  It works perfectly for other function modules – can you think of a reason why it wouldn’t work in partciular cases?  The function module in question is definitely valid (POPUP_TO_CONFIRM)

     

    Thanks

    Christine

    (0) 
    1. Thomas Fiedler Post author

      Hi Christine,

      on which ABAP stack do you have the issue? Is it NW 7.31 or NW 7.4?

      Which Suppport Package Level do you have?

       

      Regards,

      Thomas.

      (0) 
  5. Former Member

    Hey everybody,

    is there any posibility to transfer the Patterns from SAP SE80 to Eclipse?
    Because I think it would be even easier to take the standard SE80 Patterns from my company instead of creating new ones.


    Regards,

    Erik

     

    P.S. Sorry for bad english!

    (0) 
    1. Thomas Fiedler Post author

      Hi Pavel,

      for generation of method implementations we have the the following Quickfix for you.

      Just press CTRL + 1 on the method definition statement and you will get the following options:

       

      Quickfixes is one of the most important features in ADT.

      Regards,

      Thomas.

       

      (1) 

Leave a Reply