SAP Tutorials Blog

 

Character Literals

Character literals are sequences of alphanumeric characters in the source code of an ABAP program enclosed in single quotation marks. Character literals enclosed in quotation marks have the predefined ABAP type C and are described as text field literals. Literals enclosed in “back quotes” have the ABAP type STRING and are described as string literals. The field length is defined by the number of characters.


Note − In text field literals, trailing blanks are ignored, but in string literals they are taken into account.

Following are some examples of character literals.


Text field literals

REPORT YR_SEP_12. 

Write 'Tutorials Point'. 

Write / 'ABAP Tutorial'.  

String field literals

REPORT YR_SEP_12. 

Write `Tutorials Point `. 

Write / `ABAP Tutorial `. 

The output is same in both the above cases −

Tutorials Point  

ABAP Tutorial


Serkan AKKAVAK

Computer Engineer BSc

SAP Department Manager

Contact : serkurumsal@yandex.com