SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Character String and Byte String Processing → Expressions and Functions for String Processing → string_exp - String Expressions → string_exp - String Templates → Examples of string templates →String Templates, Control Characters
The example demonstrates the formatting of a text using control characters.
Source Code
REPORT demo_string_template_ctrl_char.
CLASS demo DEFINITION.
PUBLIC SECTION.
CLASS-METHODS main.
ENDCLASS.
CLASS demo IMPLEMENTATION.
METHOD main.
cl_demo_output=>display(
|First line.\r\ttab\ttab\ttab\n\ttab\ttab\ttab\rLast line.| ).
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
demo=>main( ).
Description
A string template with literal text and control character is produced using the class CL_DEMO_OUTPUT. The text output is formatted with line breaks and tabulators.