Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

AdT (ABAP in Eclipse), Code Formatter/PrettyPrinter / Beautify - more options?

joachimrees1
Active Contributor
37,858

I have exactly the question someone had back in 2014:

https://archive.sap.com/discussions/message/15254359

I would wish for e.g. such simple things as aligning adjacent statements by the '='-character, like so:

var1 = 'xyz'.
var_very_long = 123.

“format source (shift+F1) -->:
var1          = 'xyz'.
var_very_long = 123.

It's end of 2017 now, is the answer any different?

(As far as I can tell, no: 😞

- but maybe there's something in the dev-pipeline?)

best

Joachim

1 ACCEPTED SOLUTION
Read only

ThFiedler
Product and Topic Expert
Product and Topic Expert
20,270

Hi Joachim,

there are currently no plans to further improve the pretty printer/Formatter.

Regards,

Thomas.

6 REPLIES 6
Read only

Former Member
20,270

Hello Joachim,

looking for the exact same issue, i found your post. Just wanna inform anybody who is also searching for the formatter-option in adt: In the meanwhile it works well (Shift + F1).

Cheers

Read only

20,270

Hi Erik, thanks for your Feedback! But I am not sure if I understand your "it works well" ?!

My wish was, that this

var1 = 'xyz'.
var_very_long = 123.

would be turned into into that (-> nicely aligning at the '=' )

var1          = 'xyz'.
var_very_long = 123.

I tried it again today: it didn't do it and I still didn't find an option for achieving that.
Best
Joachim

Read only

0 Likes
20,270

Hello Joachim,

well, i tried it at home with the latest ADT Version. And yes it aligns as nicely as the pretty Printer in sap. Have a look at the top bar. There should smth. like "edit". there you can expand a new menu with one entry called "Format" (again, smth. like that). And if i hit that, it Formats my abap Code well.

Best regards

Read only

larshp
Active Contributor
20,270

we have an evil plan to be able to run the abaplint pretty printer from ADT, https://github.com/abaplint/abaplint/issues/629

Read only

ThFiedler
Product and Topic Expert
Product and Topic Expert
20,271

Hi Joachim,

there are currently no plans to further improve the pretty printer/Formatter.

Regards,

Thomas.

Read only

Ulrika_E82
Discoverer
0 Likes
7,229

Juuuust in case someone finds this question today or later and doesn't find a good answer: you should try ABAP Cleaner SAP/abap-cleaner: ABAP cleaner applies 95+ cleanup rules to ABAP code at a single keystroke. It's great.