Ansicht
Dokumentation

ABENCHAR_COMP_OP_VS_FUNCT - CHAR COMP OP VS FUNCT

ABENCHAR_COMP_OP_VS_FUNCT - CHAR COMP OP VS FUNCT

BAL_S_LOG - Application Log: Log header data   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

- Comparison Operators vs. Predicate Functions

Instead of the comparison operators for character-like data types, predicate functions can be used as shown in the following table:

Comparison Operator Predicate Function
o1 CO o2 NOT contains_any_not_of( val = o1 sub = o2 )
o1 CN o2 contains_any_not_of( val = o1 sub = o2 )
o1 CA o2 contains_any_of( val = o1 sub = o2 )
o1 NA o2 NOT contains_any_of( val = o1 sub = o2 )
o1 CS o2 contains( val = to_upper( o1 ) sub = to_upper( o2 ) )
o1 NS o2 NOT contains( val = to_upper( o1 ) sub = to_upper( o2 ) )

Since the comparison operators CS and NS are not case-sensitive, the arguments must be processed by the functions to_upper (or to_lower). It should also be noted that the trailing blanks of character-like arguments of fixed length are always ignored in the predicate functions, whereas there are exceptions to this rule for operands of comparison operators.

The operators CP and NP can also be replaced by the predicate function contains or matches and a suitable regular expression. The differences in case handling must also be respected, whereby a simple mapping like in CS and NS is not possible, but usually not required.

The following two relational expressions yield the same result.






SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 2397 Date: 20240416 Time: 183550     sap01-206 ( 36 ms )