Ansicht
Dokumentation
ABENCONDENSE_FUNCTIONS - CONDENSE FUNCTIONS
Addresses (Business Address Services) CL_GUI_FRONTEND_SERVICES - Frontend ServicesThis documentation is copyright by SAP AG.
- condense
... condense( $[val =$] text $[del = del$] $[from = from$] $[to = to$] ) ...
Effect
This built-in function returns a condensed content of text. The function works as follows:
- First, all leading and trailing characters are removed, that are specified del. If del is an empty string, no leading and trailing characters are removed.
- Second, in the remaining string all substrings composed of characters specified in from are replaced with the first character of the string specified in to. If from is an empty string, no characters are replaced. If to is an empty string, the characters specified in from are removed.
The default values for del, from, and to are one blank each. If neither del, from, nor to are specified, val = can also be omitted. Then, the condense function first removes any leading and trailing blanks and then all substrings of the remaining character string that contain nothing but blanks are replaced by exactly one blank.
del, from, and to are character-like expression positions. If these have a fixed length, trailing blanks are ignored.
The return value has the type string.
Notes
- Comparison with the CONDENSE statement:
- When del, from, and to are not specified or their default values (one blank) are passed, the condense function works in the same way as the CONDENSE statement without the NO-GAPS addition.
- When for del and from their default values (one blank) are passed and for to an empty string is passed, the condense function works in the same way as the CONDENSE statement with the NO-GAPS addition.
- When using default values, the effect of condensing substrings containing nothing than blanks to one blank, comes from applying the default values for from and to and has nothing to do with the value of del.
- For removing the leading and trailing blanks without affecting the remaining character string, you can use the default value for del and an empty string for from. The latter must be specified explicitly, because the default value (blank) causes substrings consisting of blanks to be replaced by the first character from to, which also is a blank.
- Specifying a text field literal ' ' containing one blank for del, from, and to is the same as specifying `` but not as` ` `. Only the latter represents the default value.
The return values of the following functions are "abc_def", "abc___def", "abcdef" and "abcXdef", where "_" stands for a blank.
The return value of the following function call is "Rock'n'Roll".
Fill RESBD Structure from EBP Component Structure Addresses (Business Address Services)
This documentation is copyright by SAP AG.
Length: 4340 Date: 20240417 Time: 231834 sap01-206 ( 75 ms )