Skip to content

ABAP Keyword Documentation →  ABAP - Dictionary →  ABAP CDS in ABAP Dictionary →  ABAP CDS - Data Definitions →  ABAP CDS - DDL for Data Definitions →  ABAP CDS - DEFINE VIEW →  ABAP CDS - SELECT →  ABAP CDS - SELECT, Operands and Expressions 

ABAP CDS - case_expr

Other versions: 7.31 | 7.40 | 7.54

Syntax Forms

Simple case distinction

1. ... CASE operand
           WHEN operand1 THEN result1
          [WHEN operand2 THEN result2]
          [ELSE resultn]
      END ...

Complex case distinction

2. ... CASE WHEN cond_expr1 THEN result1
          [WHEN cond_expr2 THEN result2]
          [WHEN cond_expr3 THEN result3]
          [ELSE resultn]
      END ...


Case distinction in a SELECT statement of a CDS view. 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.


ABAP CDS - simple_case_expr

ABAP CDS - searched_case_expr