When you specify an absolute position, the subsequent output is written to the screen starting at fixed lines and columns.
To specify a horizontal output position, ABAP offers two ways:
The AT option of the WRITE and ULINE statements (see Positioning WRITE Output on the List ) and the POSITION statement. The syntax of the POSITION statement is:
SKIP TO LINE n.
This statement sets the horizontal output position and the sy-colno system field to col . If col lies outside the page, the subsequent output statements are ignored.
The system writes an output following the POSITION statement or a WRITE statement formatted using AT to the specified position, regardless of whether there is enough space. That part of the output that does not fit onto the line, is truncated. Other WRITE output then starts on the next line.
You specify vertical output positions as follows:
SKIP TO LINE n.
This statement sets the vertical output position and the sy-linno system field to lin . If lin does not lie between 1 and the page length, the system ignores the statement.
When you use LINE , the system also counts page header and page footer lines. Make sure that you do not unintentionally overwrite header or footer lines.
Positioning Output Beneath the Page Header
To position output on the first line following the entire page header, use the BACK statement:
If this statement does not follow a RESERVE statement, the subsequent output appears beneath the page header. The system sets sy-c olno to 1 and sy-linno according to the length of the page header. In combination with the RESERVE statement, another rule applies (see Specifying a Relative Position ).
If the BACK statement is executed at the TOP-OF-PAGE event, the system does not set the output position to beneath the entire page header, but only to beneath the standard page header. Any output written now overwrites the self-defined page header specified at TOP-OF-PAGE .
Example of Absolute Positioning
REPORT demo_list_position NO STANDARD PAGE HEADING LINE-SIZE 60. DATA: x(3) TYPE c, y(3) TYPE c. x = sy-colno. y = sy-linno. TOP-OF-PAGE. WRITE: 'Position of Header: ', x, y. ULINE. START-OF-SELECTION. SKIP TO LINE 10. POSITION 20. x = sy-colno. y = sy-linno. WRITE: '* <- Position', x, y. SKIP TO LINE 12. ULINE AT 20(20). BACK. x = sy-colno. y = sy-linno. WRITE: 'Position after BACK:', x, y.
This program creates the following list page:
The system assigns the original values of sy-colno and sy-linno to the fields X and Y. Note that this assignment actually takes place at the START-OF-SELECTION event (see Defining Processing Blocks ). The original output position is the position of the first header line. The output is written there. SKIP TO LINE and POSITION place an asterisk '*' in column 20, line 10. SKIP TO LINE and AT produce underlining. Finally, BACK sets the output position to column 1, line 3 beneath the two-line page header.