Ansicht
Dokumentation
ABENCDS_F1_SIMPLE_CASE_EXPRESSION - CDS F1 SIMPLE CASE EXPRESSION
PERFORM Short Reference ROGBILLS - Synchronize billing plansThis documentation is copyright by SAP AG.
- simple_case_expr
... CASE operand
WHEN operand1 THEN result1
$[WHEN operand2 THEN result2$]
...
$[ELSE resultn$]
END ...
Effect
Simple case distinction (simple case) in a SELECT statement of a CDS view. The case distinction compares the values of operand operand with operands operand1, operand2, ... and produces the operand result as the result after the first THEN for which the comparison is true. If no matches are found, the result specified after ELSE is selected. If ELSE is not specified, the result is the zero value.
- The following can be specified for operand:
- Fields of a data source data_source of the current CDS view
- Path expressions that identify a field of a data source data_source
- The following can be specified for operand1, operand2, ... :
- Literals without a domain prefix
- Fields of a data source data_source of the current CDS view
- Path expressions that identify a field of a data source data_source
- A further case distinction
- The following can be specified for result1, result2, ...:
- Literals without a domain prefix
- Fields of a data source data_source of the current CDS view
- Path expressions that identify a field of a data source data_source
- A further case distinction
The operand operand must be comparable with operand1, operand2, ... When the CDS view is activated, a result type is determined from the operands result1, result1, ... that covers their types. The operands must be compatible with each other.
The operands cannot have the type LCHR, LRAW, STRING, RAWSTRING, or GEOM_EWKB.
Notes
Example
Case distinction in a SELECT list.
-
case partner.bp_role
when '01' then 'customer'
when '02' then 'supplier'
end as partner_role
BAL Application Log Documentation SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up
This documentation is copyright by SAP AG.
Length: 7326 Date: 20240418 Time: 151936 sap01-206 ( 33 ms )