SAP CDS CASE EXPRESSION V2



Get Example source ABAP code based on a different SAP table
  


• CASE ABAP_CDS_EXPRESSION
• WHEN ABAP_CDS_EXPRESSION
• THEN ABAP_CDS_EXPRESSION
• ELSE ABAP_CDS_EXPRESSION
• END ABAP_CDS_EXPRESSION
• NULL ABAP_CDS_EXPRESSION

ABAP_CDS_DDL - CDS View Entity, case_expr

ABAP_SYNTAX_FORMS

Simple Case Distinction
1 ... CASE operand
WHEN operand1 THEN result1
$[WHEN operand2 THEN result2$]
...
$[${ELSE resultn $| ELSE NULL$}$]
END ...

Complex Case Distinction
2 ... CASE WHEN cds_cond1 THEN result1
$[WHEN cds_cond2 THEN result2$]
$[WHEN cds_cond3 THEN result3$]
...
$[${ELSE resultn $| ELSE NULL$}$]
END ...


What does it do?
Case distinction in a SELECT statement of a CDS view entity. Either a simple case distinction (simple case) or a complex case distinction (searched case).
Case distinctions can be specified in the SELECT list and in operand positions of other expressions.