Relative Positioning

Relative positions refer to output previously written to the list. Several relative positionings occur automatically. When you use WRITE without specifying a position, the output appears after the previous output, separated by a blank column. If there is not enough space in the current line, a line feed occurs. ULINE and SKIP statements without positioning produce a line feed.

To program relative positioning, use either the sy-colno and sy-linno system fields together with the statements described in Absolute Positioning or the statements for relative positioning described below.

Producing a Line Feed

To produce a line feed, use either the forward slash ‘//' in the AT option of WRITE or ULINE or the statement:

Syntax

NEW-LINE.

This statement positions the next output in a new line, setting sy-colno to 1 and increasing sy-linno by 1. The system only executes the statement if output was written to the screen since the last line feed. NEW-LINE does not create a blank line. To create a blank line, use the SKIP statement (see Creating Blank Lines).

An automatic line feed occurs at the NEW-PAGE statement and at the beginning of an event.

Positioning Output Underneath Other Output

You can position a WRITE output in the same column as a previous WRITE output. Use the formatting option UNDER of the WRITE statement:

Syntax

WRITE f UNDER g.

The system starts outputting f in the same column from which field g started. This statement is not limited to the current page, that is, g must not appear on the same page.

The reference field g must be written exactly as in the corresponding WRITE statement, including all specifications such as offset (see Specifying Offset Values for Data Objects). If g is a text symbol (see Text Symbols), the system determines the reference field from the number of the text symbol.

Positioning Output in the First Line of a Line Block

To set the next output line to the first line of a block of lines defined with the RESERVE statement (see Programming Page Breaks), use the BACK statement as follows:

Syntax

RESERVE.   ..... BACK.

If BACK follows RESERVE, the subsequent output appears in the first line written after RESERVE. You can use this statement, for example, to jump back to a specific line after writing an output from within a loop.

Examples of Relative Positioning

The first example shows how to create a column-based list by means of a self-defined page header.

The second example shows the effect of the BACK statement following RESERVE.