ABAP offers several possibilities to create horizontal and vertical lines. For a list of the corresponding statements, see Lines and Blank Lines.
The system automatically joins lines that meet to united lines or frames. Lines meet if in the direction of at least one of the lines no blank characters or blank lines separate the lines. Depending on the type and number of lines meeting at a certain point, you can draw various line sections. To exceptionally prevent the system from joining lines, you can use special lines:
For a demonstration of automatically joined lines, call the executable program SHOWLINE in any system.
Straight Lines
The example below shows how to create horizontal and vertical straight lines.
Corners
The example below shows how to create different corners.
T Sections
The example below shows how to create different T sections.
Crosses
The example below shows how to create crosses.
Using Special Lines
If you use tightly nested frames or tight hierarchy representations, you might want to keep certain line sections apart, even though there is no space left for inserting a blank character or blank line between them.
In this case, you can use special lines defined as system-defined constants in the INCLUDE program <LINE>:
Syntax
WRITE lin AS LINE.
To be able to use special lines in your program, you must include the INCLUDE program <LINE> or the more comprehensive INCLUDE program <LIST> into your program. The INCLUDE program <LINE> contains a short description of the special lines.
The system displays special lines in the output list exactly the way they are defined. Lines are joined only where they really meet. The system does not automatically make special lines longer to make them meet.
The easiest way to output special lines is to use a statement structure (see Using WRITE via a Statement Structure). From the screen Assemble a WRITE Statement, select the radio button Line and then choose Display. The following dialog box appears:
It contains all available special lines which you can easily include into your program code.
Programming Frames
You can use the line types available in ABAP to program frames. The sample program below defines a macro WRITE_FRAME, which you can use instead of the WRITE f statement. The system draws a frame around a field f specified in WRITE_FRAME that dynamically adapts to the length of the field.
Programming Grids
You can use the line types available in ABAP to program a grid for a table-like list. The sample program below defines two macros NEW_GRID and WRITE_GRID that belong together. NEW_GRID is used to initialize a grid and for line feeds within the grid. You can use WRITE_GRID instead of the WRITE f statement. For each field output using WRITE_GRID, the system draws a vertical grid line to the right of the field and a horizontal grid line below it. The horizontal line dynamically adapts to the length of the field. The lines of all output fields together form a grid.