Skip to Content

Code Template ABAP in Eclipse

As we all know iIn SAP GUI it is possible to use 'Pattern' function to import (for example) a function module with it's entire interface (import, export, tables, changing, exceptions). This is also possible in AiE. However, in SAP GUI, via (menu) settings ABAP Editor->Pattern you can also set the following option: 'Name of actual parameter same as Formal Parameter'. Beside the named parameters also the data declaration is done.

*DATA IF_SOFORTAUFTRAG TYPE XFELD.
*DATA IF_GET_HUS       TYPE XFELD.
*DATA IF_DEQUEUE       TYPE XFELD.
*DATA IT_VENUM         TYPE HUM_VENUM_T.
*DATA ET_VEKP          TYPE VSEP_T_VEKP.
*DATA ET_VEPO          TYPE VSEP_T_VEPO.

CALL FUNCTION 'HU_PACKING_REFRESH'
* EXPORTING
*   IF_SOFORTAUFTRAG       = ' '
*   IF_GET_HUS             = IF_GET_HUS
*   IF_DEQUEUE             = IF_DEQUEUE
*   IT_VENUM               = IT_VENUM
* IMPORTING
*   ET_VEKP                = ET_VEKP
*   ET_VEPO                = ET_VEPO.

Can I also achieve the same in ABAP in Eclipse? I know about templates and code suggestions, but that won't give me the data declaration part.

Kind regards,

Micky

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 14, 2017 at 12:44 PM

    Hi Micky,

    Nice to see you after a long time :)

    Tbh, i had the same problem like you when i started working with Eclipse. But then i realised the power of "Quick Fixes".

    Base Template you get by using code completion Ctrl+Space

    Comment out the parameters you would be needing & hit Ctrl+1 (QuickFix).

    N.B.: QuickFixes somehow don't like procedural programming :)

    The needed (local)variables will be automatically defined by ADT.

    IMHO the ADT feature is more comfortable than the GUI feature.

    BR,

    Suhas

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Suhas,

      now I know what you mean by 'QF doesn't like procedural programming'. You are absolutely correct, the QF now indeed gives me the options to declare all variables.

      Thanks. will definitely be very helpful in my day-to-day work!

      KR. Micky.

  • Feb 15, 2017 at 11:45 AM

    Hey Mickey,

    Long time no see :)

    I didn't even know of this option in the ABAP editor, even though I unearthed how to make dynamic patterns a loooong time ago.

    You could send an email to the editor of the ABAP plug in requesting this functionality in a future release.

    Cheers, Rob Dielemans

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Rob,

      indeed, long time no see.

      As you can see in above replies, the quick fix should be the 'fix' I'm looking for. But for now I will have to declare them myself as long as I only get the options I mentioned above. So hopefully it's just a matter of the ADT version I'm currently working on (even though I thought I have the latest version downloaded not so long ago).

      BR. Micky.

      P.S. Good to see that you are still very active (even) on (the new) SCN.