The user can print out the ALV output that is currently displayed. To do this, the user chooses the pushbutton Print Version from the toolbar. ALV then generates a standard PDF file from the ALV output data, starts Adobe Acrobat, and displays the generated PDF file.
The user can use the Settings dialog box to make many settings related to the display of the PDF file. The same options are available in your application. Define the presettings for the PDF document as follows:
· Define the paper format and alignment
· Define the size of the printable area
· Scale columns and rows
· Send the output directly to the printer
· Set up the header and footer
· Copy design objects to the PDF file
You can also define whether a design object that you defined for the header or footer should also appear in the PDF file.
You can specify the paper format for the PDF document. You can choose between the following paper formats:
· DIN A4
· Letter
You can also define whether the PDF document is to be generated in Portrait or Landscape format.
You use the methods of the interface class IF_SALV_WD_PDF_SETTINGS for this (implementing class CL_SALV_WD_CONFIG_TABLE).
Methods for Paper Format and Orientation
Function |
Method |
Define paper format |
SET_PAGE_SIZE |
Get paper format |
GET_PAGE_SIZE |
Set paper orientation |
SET_ORIENTATION |
Get paper orientation |
GET_ORIENTATION |
You can define the size of the printable area on pages of your PDF document by specifying the width of the margins. You also specify the unit of measurement for your settings. You use the methods of the interface class IF_SALV_WD_PDF_SETTINGS for this (implementing class CL_SALV_WD_CONFIG_TABLE).
Methods Relating to the Printable Area of a Page
Function |
Method |
Define unit of measurement for margins |
SET_MARGINS_UNIT |
Get unit of measurement for margins |
GET_MARGINS_UNIT |
Define width of bottom, top, right, and left margins |
SET_MARGIN_BOTTOM SET_MARGIN_TOP SET_MARGIN_RIGHT SET_MARGIN_LEFT |
Get width of bottom, top, right, and left margins |
GET_MARGIN_BOTTOM GET_MARGIN_TOP GET_MARGIN_RIGHT GET_MARGIN_LEFT |
By default, the columns are displayed in the PDF document with the same width as in the ALV output. However, if there is not enough room on one page for all the columns, the table is split onto two or more pages. The rows are also distributed over the number of pages necessary to display them. There are different options for modifying the size of the columns and rows in line with the page size of your PDF document:
· Reduce the width of columns so that they fit onto one page.
The height of the table remains unchanged.
· Reduce the width and the height of the table so that the entire table fits onto one page.
· Leave both width and height unchanged.
If the columns are distributed over several pages, you can define whether certain information should appear only on the first page or should be repeated on subsequent pages too. You can choose between the following variants:
· If the column width is unchanged (wallpaper): The column titles are displayed on all pages.
· If the column width is changed: The column titles are also repeated on subsequent pages.
· Regardless of scaling: Fixed columns are repeated on all subsequent pages.
You use the methods of the interface class IF_SALV_WD_PDF_SETTINGS for this (implementing class CL_SALV_WD_CONFIG_TABLE).
Methods for Scaling Columns and Rows
Function |
Method |
Define table scaling in PDF document |
SET_PAGE_LAYOUT |
Get table scaling in PDF document |
GET_PAGE_LAYOUT |
Repeat column titles if page width is adjusted |
SET_REPEAT_HEADERS_FIT_H |
Check whether column titles are repeated if page width is adjusted |
GET_REPEAT_HEADERS_FIT_H |
Repeat column titles for adjacent pages |
SET_REPEAT_HEADERS_WALLPAPER |
Check whether column titles are repeated for adjacent pages |
GET_REPEAT_HEADERS_WALLPAPER |
Repeat fixed columns on every page |
SET_REPEAT_KEY_COLUMNS |
Check whether fixed columns are repeated on every page |
GET_REPEAT_KEY_COLUMNS |
You can choose for the print version to be created as a PostScript file instead of a PDF document. The PostScript file is then sent directly to a printer of your choice.
If you do not specify an output device here, a PDF file is generated and displayed on the screen.
You use the methods of the interface class IF_SALV_WD_PDF_SETTINGS for this (implementing class CL_SALV_WD_CONFIG_TABLE).
Methods for Printing Directly
Function |
Method |
Set ALV output to be printed immediately |
SET_PRINT_IMMEDIATE |
Check whether the ALV output is to be printed immediately |
GET_PRINT_IMMEDIATE |
Set printer |
SET_PRINTER |
Get printer |
GET_PRINTER |
You can use text modules to create a header and/or footer for your PDF document. The header or footer will appear on every page. When doing this, you have to specify the position of the text module (centered, left-justified, or right-justified).
You can place one of the following text modules at the required position:
· No text
The current position is not occupied.
· Free text
The free text that you defined for the position is inserted at the current position.
· Current date
Current date and time
· Current page
· Page 1 of ?
The number of the current page and the total number of pages are inserted at this position.
You use the methods of the interface class IF_SALV_WD_PDF_SETTINGS for this (implementing class CL_SALV_WD_CONFIG_TABLE).
Methods for Placing Text Modules in Headers and Footers
Function |
Method |
Set free text for the different positions |
SET_FOOTER_CENTER_FREETEXT SET_FOOTER_LEFT_FREETEXT SET_FOOTER_RIGHT_FREETEXT SET_HEADER_CENTER_FREETEXT SET_HEADER_LEFT_FREETEXT SET_HEADER_RIGHT_FREETEXT |
Get free text for the different positions |
GET_FOOTER_CENTER_FREETEXT GET_FOOTER_LEFT_FREETEXT GET_FOOTER_RIGHT_FREETEXT GET_HEADER_CENTER_FREETEXT GET_HEADER_LEFT_FREETEXT GET_HEADER_RIGHT_FREETEXT |
Set text module for the different positions |
SET_FOOTER_CENTER SET_FOOTER_LEFT SET_FOOTER_RIGHT SET_HEADER_CENTER SET_HEADER_LEFT SET_HEADER_RIGHT |
Get text module for the different positions |
GET_FOOTER_CENTER GET_FOOTER_LEFT GET_FOOTER_RIGHT GET_HEADER_CENTER GET_HEADER_LEFT GET_HEADER_RIGHT |
If you have defined a design object for a header or footer for the ALV output, you can define whether the content of this design object should also be copied into the PDF file. You use the methods of the interface class IF_SALV_WD_PDF_SETTINGS for this (implementing class CL_SALV_WD_CONFIG_TABLE).
Methods for Copying Design Objects into the PDF File
Function |
Method |
Copy design object for the PDF header |
SET_EXPORT_NO_TOL |
Check whether the design object is to be copied for the PDF header |
GET_EXPORT_NO_TOL |
Copy design object for the PDF footer |
SET_EXPORT_NO_EOL |
Check whether the design object is to be copied for the PDF footer |
GET_EXPORT_NO_EOL |