Ansicht
Dokumentation

ABENCASE_FUNCTIONS - CASE FUNCTIONS

ABENCASE_FUNCTIONS - CASE FUNCTIONS

TXBHW - Original Tax Base Amount in Local Currency   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.
SAP E-Book

- to_upper, to_lower, to_mixed, from_mixed

1. ... to_upper( $[val =$] text ) ...

2. ... to_lower( $[val =$] text ) ...

3. ... to_mixed( $[val =$] text $[sep = sep$] $[case = case$] $[min = min$] ) ...

4. ... from_mixed( $[val =$] text $[sep = sep$] $[case = case$] $[min = min$] ) ...

Effect

These built-in functions return the character string from text after it has been converted in accordance with the following case rules:

  • The function to_upper transforms all letters in the character string to uppercase letters.
  • The function to_lower transforms all letters in the character string to lowercase letters.
  • The function to_mixed transforms all letters in the character string to lowercase letters from the second position. Then, from left to right from the second position, it removes occurrences of the first character specified in sep from the character string and transforms the next letter to an uppercase letter. The default value for separator sep is an underscore (_). If case is not specified, the first character of the string remains unchanged. If case is specified and the first character of case is an uppercase letter, the first character in the string is also uppercase and otherwise lowercase. A positive number can be passed to min to specify a minimum number of characters that must appear before a separator from the start of the string or since the last replacement so that it works as described. The default value for min is 1.
  • The function from_mixed inserts the first character specified in sep before each uppercase letter from left to right and from the second position. The default value for separator sep is an underscore (_). If case is not specified or if the first character in case is an uppercase letter, the entire string is transformed to uppercase, otherwise to lowercase. A positive number can be passed to min to specify a minimum number of characters that must appear before an uppercase letter from the start of the string or since the last insert so that a separator is inserted. The default value for min is 1.

sep is a character-like expression position. If they have a fixed length, trailing blanks are ignored. min is a numeric expression position of type i. case expects a character-like data object with fixed length. val = can be omitted only if none of the optional arguments are specified. If sep is an empty string or if min is negative, an exception of class CX_SY_STRG_PAR_VAL is raised.

The return value has the type string.

Note

The functions to_mixed and from_mixed are intended for transforming standard ABAP naming conventions for names with underscores to standard Java naming conventions with uppercase and lowercase letters (Mixed Case Style and Camel Case Style) and vice versa.

Example

Outputs the Latin alphabet in lowercase letters.

String Functions, to_mixed and from_mixed

Exceptions

Catchable Exceptions

CX_SY_STRG_PAR_VAL

  • Cause: The separator in sep is empty or the minimum number in min is negative.
    Runtime Error: STRG_ILLEGAL_PAR





CL_GUI_FRONTEND_SERVICES - Frontend Services   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 5123 Date: 20240425 Time: 012015     sap01-206 ( 88 ms )