SAP Tutorials Blog

 

 


Strings, which are widely used in ABAP programming, are a sequence of characters.


We use data type C variables for holding alphanumeric characters, with a minimum of 1 character and a maximum of 65,535 characters. By default, these are aligned to the left.


Creating Strings

The following declaration and initialization creates a string consisting of the word 'Hello'. The size of the string is exactly the number of characters in the word 'Hello'.


Data my_Char(5) VALUE 'Hello'.

Following program is an example of creating strings.


REPORT YT_SEP_15. 

DATA my_Char(5) VALUE 'Hello'. 

Write my_Char.

The above code produces the following output −


Hello


Serkan AKKAVAK

Computer Engineer BSc

SAP Department Manager

Contact : serkurumsal@yandex.com