Pretty Printer in the Web Application Builder
Use
When you create dynamic and static code, the Pretty Printer in the Web Application Builder (just like in all of the ABAP Workbench) is used for optical arrangement. This improves the layout and as a result, the coding lines are much easier to read.
See also:
Pretty Printer Functions
Prerequisites
You are using an SAP Web AS 6.20 system and have implemented at least Support Package 3.
Functions
The Pretty Printer performs the following for BSP applications:
The Pretty Printer is available for the following components of a BSP application:
Activities
In the Web Application Builder, on your page press the Pretty Printer pushbutton (
) or in the menu, choose Edit →
Pretty Printer.
Example
Example of formatting a page with BSP extension elements:
|
<%@page language="abap" %> <%@extension name="htmlb" prefix="htmlb" %> <htmlb:content> <htmlb:page title="List of Authors" > <table width="100%" height="100%" cellspacing="1" cellpadding="2" border="0"> <tr class="sapTbvCellStd"> <td bgcolor="Whitesmoke" valign="top"> <htmlb:form> <htmlb:tableView id = "tv1" headerText = "List of Authors" headerVisible = "true" footerVisible = "false" design = "ALTERNATING" table = "<%= authors %>" > <htmlb:tableViewColumns> <htmlb:tableViewColumn columnName = "authfnam" title = "first name" > </htmlb:tableViewColumn> <htmlb:tableViewColumn columnName = "authlnam" title = "last name" > </htmlb:tableViewColumn> </htmlb:tableViewColumns> </htmlb:tableView> </htmlb:form> </td></tr></table> </htmlb:page> </htmlb:content> |
Example of indentation with static coding and ABAP scripting:
|
<%@page language="abap" %> <html> <head> <title>SAP Web Application Server</title> </head> <body> <center> <h1>Welcome to the</h1> <h2>SAP Web Application Server!</h2> <% do 5 times. %> <font SIZE = <%= sy-index %>> <p> <center> Hello World! </font> <% enddo. %> <p> <img src="../PUBLIC/Tutorial/scalability.jpg"> </body> </html> |