You are on page 1of 3

Literals are data objects that you define in the source code of a program by specifying a string

representing a value.

The ABAP runtime environment differentiates among the following types of literals:

 Numeric literals

You can define a numeric literal as a sequence of digits in the program text, with or
without + or - signs. A numeric literal has type I if its value lies within the value range
of this type (-2^31+1 to 2^31-1), otherwise it has type P.

 Text field literals

You can define a text field literal as a character string that is enclosed in single
quotation marks (') in the program text. A text field literal can be from one to 255
characters long, and any spaces at the end are ignored. Text field literals have type C.

 String literals

You can define a string field literal as a character string that you enclose in back
quotation marks (`) in the program text. String literals have the type string, and their
length is limited to 255 characters. They can also have zero length. In contrast to text
field literals, spaces are not suppressed at the end of a string literal.
Hint: To display a single quotation mark within a text field literal, you have to enter it twice.
The same applies if you enter a back quotation in a string literal. No restrictions apply to
single quotations in a string literal, or back quotations in a text field literal.

You might also like