Application Development 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: 

Switching off pretty printer in the ABAP editor

former_member517
Participant
0 Kudos

Hello dear all,

I often face the problem that coding which was manually edited and optimized to look good

gets changed by another programmer who uses the pretty print function destroying the cdarefully

designed coding structure.

Is there any way to avoid that the pretty printer function changes a certain ABAP program ?

Best regards

Rabanus Diehl

1 ACCEPTED SOLUTION

former_member129652
Active Participant
0 Kudos

Hi Rabanus Diehl,

   GOTO --> Attribute.  Check the "editor lock" program attribute.  After that, other programmer cannot edit your code.

  I hope it can solve your problem.

8 REPLIES 8

Phillip_Morgan
Contributor
0 Kudos

solution: start using it too  😉

0 Kudos

If you never used structures that is a valid approach. But if you have your own rules giving a much higher quality pretty printer is a loss.

Best regards

Rabanus Diehl

0 Kudos

Hi Rabanus,

What do you mean by structures in this context. I am just curious to know why one may not like PRETTY PRINTER functionality. Does it have any side affects - apart from readability preference?

Regards,

Shravan

0 Kudos

Can we see one of your very pretty programs please? You have got our attention now, show and tell

former_member227141
Active Participant
0 Kudos

Hi Rabanus, you can't deactive pretty printer button, you just could uncheck checkboxes in properties going to Utilities - > Settings -> ABAP Editor - > Pretty Printer, and then if someone clicks on pretty printer button it will cause no effect, but another developer could check again checkboxes and use it in your code, so.. I think we have to deal with pretty printer even when it is not really useful.

Regards,

Karina Hurtado

former_member129652
Active Participant
0 Kudos

Hi Rabanus Diehl,

   GOTO --> Attribute.  Check the "editor lock" program attribute.  After that, other programmer cannot edit your code.

  I hope it can solve your problem.

0 Kudos

Hi Michael,

The 'Editor Lock' is not a good option. What if someone else needs to change the code. They can remove the editor lock in debugging with change option, but why put it then.

The only thing I can think of is an enhancement in either FM PRETTY_PRINTER or somewhere else - but not worth it I suppose.

The best solution is to write comments and pray that other developers read the comments and care enough for them.

Regards,

Shravan

former_member517
Participant
0 Kudos

Dear colleagues,

thanks for the comments up to now. My hope was that there is something like a special comment (opne and closing) existing, where I could block the PP function to use its own logic. I have been debugging the FM PRETTY_PRINTER for some time to understand its behaviour, but the logic it uses seems to be fixed.

For those who askwhy I need it: I use a different style of indenting the code and try to write a compact good readable code with much comments, which gets messed up by the pretty printer, because the comments later do not align with "pretty" version.

Best regards

Rabanus Diehl