ABAP Keyword Documentation → ABAP - Reference → Processing Internal Data → Character String and Byte String Processing → Expressions and Functions for String Processing → String Functions → Processing Functions for Character-Like Arguments
condense - Condense Function
... condense( [val =] text [del = del] [from = from] [to = to] ) ...
This function returns the content of
text, condensed as follows:
- All leading and trailing characters specified in
delare removed from the string in
delis an empty string, no characters are removed.
- In the character string from
text, all subsequences that are compiled from the characters in
fromare replaced by the first character in the character string specified in
fromis an empty string, no characters are replaced. If
toan empty string, the characters specified in
fromare removed from the character string.
The default values for
are blank in each case. If
to are not specified,
val = can also be omitted.
character-like expression positions. If they have a fixed length, trailing blanks are ignored.
The return code has the type
- When the standard values for
toare specified, the
condensefunction works in the same way as the
CONDENSEstatement without the
- By entering an empty string for
from, you can remove the leading and closing spaces, without affecting the character string.
The return codes of the following functions are "abc_def", "abc___def" and "abcXdef" (where "_" stands for a space).
result = condense( val = ` abc def ` from = `` ).
result = condense( val = `XXabcXXXdefXX`
del = 'X' from = 'X' to = 'X' ).
The return code of the rollowing function call is "Rock'n'Roll".
del = `re `
from = `x` to = `n` ).