Custom ABAP Code Folding in ABAP for Eclipse

587 views Asked by At

I'm trying to find out if Code Folding in Eclipse is possible.
(I dont mean the automated Folding for Source Code by the way)

Is there something like the equivalent in Visual Studio?

#region Region1

 'Sample Code

#endregion

Would love to hear from you

1

There are 1 answers

1
Sandra Rossi On

This region feature used to exist in the ABAP editor of the ABAP Workbench (SAP GUI), but I didn't see this option in Eclipse ADT. I guess it became useless since the SAP recommendation is to write short methods.

If you really need to use regions, you may use the old ABAP editor (transaction codes SE24, SE37, SE38, SE80...) from Eclipse ADT, by first editing the ABAP code as usually, switch to the SAP GUI via the context menu Open with > SAP GUI, then write the regions this way:

"$. Region region-name followed by an optional text and a final dot.

ANY ABAP CODE

"$. Endregion region-name followed by a final dot.

Regions have a number of rules: their names must not contain spaces, are case-insensitive, they must not "cut" an ABAP block (like IF...ENDIF) in the middle, they may be nested, etc.