07-18-2012 4:07 PM
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
07-18-2012 5:33 PM
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.
07-18-2012 4:10 PM
07-18-2012 4:59 PM
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
07-18-2012 5:13 PM
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
07-18-2012 5:21 PM
Can we see one of your very pretty programs please? You have got our attention now, show and tell
07-18-2012 5:12 PM
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
07-18-2012 5:33 PM
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.
07-18-2012 6:53 PM
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
07-18-2012 7:20 PM
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