Skip to content

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 ABAP SQL. The columns ABAP CDS and SQL indicate where a function can be used. The Table Buffer column indicates whether the function can be executed in the table buffer.

SQL Function Result ABAP CDS ABAP SQL Table Buffer
CONCAT( arg1, arg2 ) Concatenates 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 x
CONCAT_WITH_SPACE( arg1, arg2, spaces ) Concatenates strings in arg1 and arg2as with CONCAT. The number of blanks specified in spacesis inserted between arg1 and arg2. The maximum length of the result is 1333. x 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 lenleft 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 uppercase letters are transformed to lowercase letters. 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 replacedby the characters from the argument src (respecting all blanks). Leadingblanks from arg are preserved. If more characters are required than existin src, the content of src is used repeatedly.If len is less than the length of arg, itis truncated on the right. If src is empty and lenis 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 leadingcharacters are removed that match the character in char. A blank in char is significant. x x -
REPLACE( arg1, arg2, arg3 ) String arg1, in which all instances of arg2are 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 lenright 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 arereplaced by the characters from the argument src (respecting all blanks).Leading blanks from arg are preserved. If more characters are requiredthan exist in src, the content of src isused repeatedly. If len is less than the length of arg,it is truncated on the right. If src is empty and lenis 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 removedand all trailing characters that match the character in char. A blank in char is significant. x x -
SUBSTRING( arg, pos, len ) Substring arg from the position poswith length len. pos and len must be specified so that the substring is within arg. x x x
UPPER( arg ) String with a length of arg, in which all lowercase letters were transformed to uppercase letters. x x -

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

Other versions: 7.31 | 7.40 | 7.54

Executable Example

SQL Function UPPER

Continue

SQL Function UPPER