Register Login

SAP ABAP Reporting

ABAP REPORTING

The main purpose of a list is to output data in a manner that can be easily understood by the user; this output often takes on the form of a table.

Lists in R/3 take into account special business data requirement:

1. They are language-independent. Text and headers appear in the logical language whenever the appropriate translation is available.

2. They can output monetary values in numerous currencies.

3. You can output list data in the following ways:

  • to the screen: here you can add colours and icons.
  • to the printer
  • to the internet/intranet: Automatic conversion to HTML
  • we can also save the list in the R/3 System or output them for processing by external commercial software applications like spreadsheet prog.

Each list has a list header and up to four lines of column headers. There are two different ways to go about these tools:

1.from within the Editor using the text-element maintenance functions

2. From within the list itself. If you save your program, activate it and then run it to create the list, you can enter both list and column headers by choosing the menu path

System -> List -> List headers.

The main advantage of this method is that the list is still displayed on the screen. This makes it easier to position column headers.

The next time we start the program, the new header will appear in the list automatically.

When no header text is entered, the program title is inserted in the header.

Titles and Headers are part of a program’s text elements. We can translate all text elements into other languages. The logon language setting on the logon screen determines which language text elements will be displayed.

Text Symbols are another kind of text elements. These are special text literal data objects. Compared to normal text literals, text symbols have the advantage that they can be translated into different languages without having to change a program’s source code. Text symbols allow you to create lists independent of language.

In executable programs (type 1), lists are automatically displayed after their corresponding event blocks have been processed. This processing must, however, contains a list creation statement. These are WRITE,SKIP and ULINE.

Events blocks are called in a sequence designed for list processing:

  • Prior to sending the selection screen: INITIALIZATION.
  • After leaving the selection screen: START-OF-SELECTION.
  • All output from START-OF-SELECTION event blocks, subroutines and function modules that are processed before a list is displayed is temporarily stored in a list buffer.
  • Once all list creation processing blocks (for example START-OF-SELECTION) have been processed, all data from the list buffer is output in the form of a list.
  • In executable programs, you can use the event block AT LINE-SELECTION to create detail lists.

The ABAP runtime system:

1. Displays the basic list after the appropriate event blocks have been processed (for example, after START-OF-SELECTION).In this case, system field sy-lsind contains the value zero.
2. Processes the event block, AT LINE-SELECTION each time we double click on an entry. If we are using a standard status, this happens automatically every time we choose the Choose icon, the Choose menu item in the EDIT menu, or the function key F2.
3. Displays detailed list after the AT LINE-SELECTION event block has been processed and increases the value contained in sy-lsind by one.
4.Display the detail list from the previous level in the list hierarchy(n-1) every time we choose the green arrow icon from the current detail list(n)

DETERMINING THE LIST-WIDTH:

To determine the width of the output list, use the LINE-SIZE option of the REPORT statement.

SYNTAX:

REPORT LINE-SIZE .

This statement determines the width of the output list of the report as characters. If we set the width to 0, the system uses the width of the standard list.

A line can be up to 255 characters long. However, if we intend to print the list, beware that most printers cannot print lists wider than 132 characters. If we want to print the list directly while creating it, the page width must comply with one of the existing print formats. Otherwise, the system will not print the list.

INDIVIDUAL PAGE HEADER:

To layout a page header individually, we must define it in the processing block following the event keyword TOP-OF-PAGE.

SYNTAX:

TOP-OF-PAGE.

WRITE: …

The TOP-OF-PAGE event occurs as soon as the system starts processing a new page of a list. The system processes the statements following TOP-OF-PAGE before outputting the first line on a new page.

Remember to end the processing block following TOP-OF-PAGE by using an appropriate event keyword, such as START-OF-SELECTION.

The self-defined page header appears beneath the standard page header. If we want to suppress the standard page header, use the NO STANDARD PAGE HEADING option of the REPORT statement.

SYNTAX:

REPORT NO STANDARD PAGE HEADING.

When using this statement, the system does not display a standard page header on the pages of a list of report.

STANDARD PAGE HEADER

  • The standard page header consists at least of a two-line standard header.
  • The first line of the standard header contains the list header and the page number.
  • The second line is made up of a horizontal line. When the program is executed, the list header is stored in the system field SY-TITLE.
  • If necessary, you can add up to four lines of column headers and another horizontal line to the standard header.
  • The width of the standard page header is automatically adapted to the window width.

DETERMINING THE PAGE LENGTH:

To determine the page length of an output list, use the LINE-COUNT option of the REPORT statement.

SYNTAX:

REPORT LINE-COUNT [()].

This statement determines the page length of the output list of the report as. If you specify the option number, the system reserves lines of the page length for the page footer. Those lines of the page footer that are not filled at the END-OF-PAGE event, appears as a blank line.

While creating the list, the system field SY-LINCT contains the current number of lines per page ( that is, or 0 for the standard page length).

DETERMINING THE PAGE FOOTER:

To define a page footer, use the END-OF-PAGE event. This event occurs if, while processing a list page, the system reaches the lines reserved for the page footer, or if the RESERVE statement triggers a page break. Fill the lines of the page footer in the processing block following the event keyword END-OF-PAGE.

SYNTAX:

END-OF-PAGE.

WRITE:…

The system only processes the processing block following END-OF-PAGE if we reserve lines for the footer in the LINE-COUNT option of the REPORT statement.

PROGRAMMING PAGE BREAKS:

  • To program unconditional page breaks, use the NEW-PAGE statement.
  • To program page breaks depending on the number of empty lines left on a page, use the RESERVE statement.

UNCONDITIONAL PAGE BREAK

To trigger a page break during list processing, use the basic form of the NEW-PAGE statement.

SYNTAX:

NEW-PAGE.

This statement:

1. Ends the current page. All other output appears on a new page.
2. Only starts a new page if the output is written to the current page as well as to the new page after NEW-PAGE.
The system then increases the SY-PAGNO system field by one. We cannot produce empty pages.
3. Does not trigger the END-OF-PAGE event. This means that the system does not output a page footer even one is defined.

CONDITIONAL PAGE BREAK

To execute a page break on the condition that less than a certain number of lines is left on a page, use the RESERVE statement.

SYNTAX:

RESERVE LINES.

This statement triggers a page break if less than free lines are left on the current list page between the last output and the page footer. Before starting a new page, the system processes the END-PAGE event.RESERVE only takes effect if the output is written to the subsequent page(the system will not generate an empty page

STANDARD PAGE HEADERS OF INDIVIDUAL PAGES

The standard page header consists of list and column headers. To influence the representation of these individual components of the standard page header, use the following options of the

NEW-PAGE statement:

SYNTAX:

NEW-PAGE [NO TITLE|WITH TITLE] [NO HEADING|WITH-HEADING].

  • We can switch the standard heading for all subsequent pages on or off using WITH-TITLE or NO-TITLE additions respectively.
  • We can switch the column headings for all subsequent pages on or off using WITH-HEADING or NO-HEADING additions respectively.
  • The NEW-PAGE statement does not affect the display of a page header that we define in the event TOP-OF-PAGE since this event is processed on the new page.

SCROLLING IN LISTS

  • We can scroll through lists vertically and horizontally using the SCROLL keyword.
  • We can only use the SCROLL statement for completed lists. If we use SCROLL before the first output statement of a list, it does not affect the list. If we use SCROLL after the first output statement of a list, it affects the entire list, that is, all subsequent output statements as well.

VERTICAL SCROLLING

1.Scrolling window by window
2.Scrolling by Pages

HORIZONTAL SCROLLING:

1.Scrolling to the list’s margins
2. Scrolling by Columns

SCROLLING WINDOW BY WINDOW

To scroll through a list vertically by the size of the current window and independent of the page length, use the following statement:

SYNTAX:

SCROLL LIST FORWARD|BACKWARD [INDEX ].

If we do not use the INDEX addition, the statement scrolls forward or backwards by one whole window in the list. If we use the INDEX addition, the system scrolls in the list with the level.

SCROLLING BY PAGES

To scroll a list by pages, that is, scroll vertically depending on the page length, the SCROLL statement offers several options.

SCROLLING TO SPECIFIC PAGES

To scroll to specific pages, use the TO option of the SCROLL statement:

SYNTAX:

SCROLL LIST TO FIRST PAGE | LAST PAGE | PAGE [index ] [LINE ].

Without the INDEX option, the statement scrolls the current list to the first, to the last, or to the page numbered. If we specify the INDEX option, the system scrolls the list of a list level. If we specify the LINE option, the system displays the page to which it scrolls starting from the line of the actual list. It does not count the page header lines.

SCROLLING BY A SPECIFIC NUMBER OF PAGES

To scroll a list by a specific number of pages, use the following options of the SCROLL statement.

SYNTAX:

SCROLL LIST FORWARD | BACKWARD PAGES [INDEX ].

If we do not specify the INDEX option, the statement scrolls forward or backward pages.

SCROLLING TO THE MARGINS OF THE LIST

To scroll horizontally to the left or right margin of a list, use the following options of the SCROLL statement:

SYNTAX:

SCROLL LIST LEFT | RIGHT [INDEX ].

If we do not specify the INDEX option, the statement scrolls to the left or right margin of the current list. If we specify the INDEX option, the system scrolls the list level.

SCROLLING BY COLUMNS

To scroll a list horizontally by columns, the SCROLL statement offers several options. A column, in this case, is one character of the list line.

SCROLLING TO SPECIFIC COLUMNS

To scroll to specific columns, use the TO COLUMN option of the SCROLL statement:

SYNTAX:

SCROLL LIST TO COLUMN [INDEX ].

If we do not specify the INDEX option, the system displays the current list starting from the column .

SCROLLING BY A SPECIFIC NUMBER OF COLUMNS

To scroll a list by a specific number of columns, use the following option of the SCROLL statement.

SYNTAX:

SCROLL LIST LEFT | RIGHT BY PLACES [ INDEX ].

DEFINING WHERE THE USER CAN SCROLL ON A PAGE

We can restrict the area of a page that can be scrolled horizontally by the user with the scrollbar or from within the program. We can also combine the following two techniques.

EXCLUDING LINES FROM HORIZONTAL SCROLLING

To exclude a line from horizontal scrolling, define the line feed for that a follows:

SYNTAX:

NEW-LINE NO-SCROLLING.

The line following the statement can not scroll horizontally. However, it can be scrolled vertically.


 Download attached file.

You must be Logged in to download this file