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: 

Customize the default comment lines to be provided by Pretty Printer

former_member188019
Active Participant

Hi

when i do a pretty printer, few comment lines are automatically added in front of few chunks of abap code.

for e.g. if i write a small code,


report  zaa_atemp.
class lcl_box definition.
  public section.
    data side type i.
endclass.

when i do the pretty printer, it adds few comments before the class definition, it becomes:


report  zaa_atemp.
*----------------------------------------------------------------------*
*       CLASS lcl_box DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_box definition.
  public section.
    data side type i.
endclass.                    "lcl_box DEFINITION

is it possible to customise the template that has been added by pretty printer such that.


*----------------------------------------------------------------------*
*       CLASS lcl_box DEFINITION
*----------------------------------------------------------------------*
*MyCompany: ABC Ltd. 
*ReferenceNo.: <plase provide>
*----------------------------------------------------------------------*

so that everytime, our developers do pretty printer, it will add new set of comments in front of all classes.

thanks.

1 ACCEPTED SOLUTION

Former Member

Hi

Please maintain the entries in table TSE05 to edit the header for a particular key word. Like *F for Sub routine, *M for Modules etc. If you see the entries you'll get more information.

Regards

Ranganath

6 REPLIES 6

Former Member
0 Kudos

Hi,

I am not sure how can we edit the template when you do pretty printer. But there is another way to acheive what you require :

In the ABAP editor , go to the most bottom right corner , you will find the rectangle box ( Its besides NUM )

Click on this rectangle box and it will give you options.

There go to Code templates , add yout template here and SAVE.

Then go back to the editor freshly and type the NAME of your template in the editor.

If your are using the new ABAP editor, as soon as you type your tempalte NAME, it will display whole template description what ever you have given in the template (on press of TAB).

Hope it helps !!

Regards,

Vijaya

Former Member
0 Kudos

Hi Madhu,

It may be possible but not sure.

Pretty Printer is nothing but a Function Module.

SO you can put a break-point in SE 37 --> PRETTY_PRINTER And can debug through the program.

You can get some hint.

May it helps you.

Thanks

Arbind Prasad

Former Member

Hi

Please maintain the entries in table TSE05 to edit the header for a particular key word. Like *F for Sub routine, *M for Modules etc. If you see the entries you'll get more information.

Regards

Ranganath

Former Member
0 Kudos

Hi Madhu,

Enter New Table Entries in TSE05 Table

where the Entries are

APP_OBJ = ABAP

and x = *F

from Position 4 U can Add your own contents.

Thanks,

Venkat.

0 Kudos

thanks for your answers.

in table TSE05, i found the pretty-printer entries for form, *F etc, but there are no pretty printer lines for class.

although i found below entries


APP_OBJ KEYWORD POS     LINE                                                      
ADDM	PL	1	*&---------------------------------------------------------------------*
ADDM	PL	2	*&       Class $
ADDM	PL	3	*&---------------------------------------------------------------------*
ADDM	PL	4	*        Text
ADDM	PL	5	*----------------------------------------------------------------------*
ADDM	PL	6	CLASS $ DEFINITION.
ADDM	PL	7	
ADDM	PL	8	ENDCLASS.               "$

but it seems these are not the ones used in abap workbench pretty-printer.

i changed these, but are not reflecting in abap editor.

also, the first line as per this table is:

&----


but my pretty printer for class is printing as:

----


awin_prabhu
Active Contributor
0 Kudos

Try creating a Custom pattern in your program and insert using Other Pattern option in Pattern.

To create custom pattern => SE38->Utilities->More Utilities->Edit Pattern->Create Pattern

http://wiki.sdn.sap.com/wiki/display/HOME/DYNAMICPATTERN-CustomCreatePatterninABAPEditor.