ABAP - Keyword Documentation →  ABAP - Dictionary →  Built-In Functions in ABAP Dictionary →  SQL Functions → 

SQL Functions for Strings

The following table shows the SQL functions for strings supported by ABAP CDS and Open SQL. The last two columns indicate where a function can be used.

SQL Function Result ABAP CDS Open SQL
CONCAT( arg1, arg2 ) Chaining of character strings in arg1 and arg2. Trailing blanks in arg1, arg2, and in the result are ignored. The maximum length of the result is 1333. x x
CONCAT_WITH_SPACE( arg1, arg2, spaces ) Concatenation of strings in arg1 and arg2 as with CONCAT. The number of blanks specified in spaces is inserted between arg1 and arg2. The maximum length of the result is 1333. x x
INSTR( arg, sub ) Position of the first occurrence of the string from sub in arg (case-sensitive). arg respects leading blanks and ignores trailing blanks. sub respects all blanks. sub must contain at least one character. If no occurrences are found, the result is 0. x x
LEFT( arg, len ) String of the length len with the len left characters of arg (ignoring the trailing blanks). The value of len cannot be greater than the length of arg. x x
LENGTH( arg ) Number of characters in arg ignoring trailing blanks. x x
LOWER( arg ) String with a length of arg, in which all upper and lowercase characters are have been converted. x x
LPAD( arg, len, src ) String of the length len with the right-justified content of arg without trailing blanks and in which leading blanks produced by the expanded string are replaced by the characters from the argument src (respecting all blanks). Trailing blanks from arg are preserved. If more characters are required than exist in src, the content of src is used repeatedly. If len is less than the length of arg, it is truncated on the right. If src is empty and len is greater than the length of arg, arg remains unchanged. x x
LTRIM( arg, char ) String with the content of arg in which all trailing blanks and leading characters are removed that match the character in char. A blank in char is significant. x x
REPLACE( arg1, arg2, arg3 ) Character string arg1, in which all instances of arg2 are replaced by the content from arg3. The replacement of letters is case-sensitive. Trailing blanks are ignored in all arguments. The maximum length of the result is 1333. x x
RIGHT( arg, len ) String of the length len with the len right characters of arg (ignoring the trailing blanks). The value of len cannot be greater than the length of arg. x x
RPAD( arg, len, src ) String of the length len with the left-justified content of arg without trailing blanks and in which trailing blanks produced by the expanded string are replaced by the characters from the argument src (respecting all blanks). Trailing blanks from arg are preserved. If more characters are required than exist in src, the content of src is used repeatedly. If len is less than the length of arg, it is truncated on the right. If src is empty and len is greater than the length of arg, arg remains unchanged. x x
RTRIM( arg, char ) String with the content of arg in which all trailing blanks are removed and all trailing characters that match the character in char. A blank in char is significant. x x
SUBSTRING( arg, pos, len ) Substring of arg from the position pos in the length len. pos and len must be specified so that the substring is within arg. x x
UPPER( arg ) String with a length of arg, in which all lower and uppercase characters are have been converted. x x

Descriptions of the potential operands and data types can be found in the corresponding documentation for ABAP CDS and Open SQL.

Executable Example

SQL Function UPPER



Continue
Example SQL Function UPPER