SAP SQL CASE



Get Example source ABAP code based on a different SAP table
  


• CASE ABAP_OSQL_EXP
• WHEN ABAP_OSQL_EXP
• THEN ABAP_OSQL_EXP
• ELSE ABAP_OSQL_EXP
• END ABAP_OSQL_EXP

ABAP_SQLEXP - sql_case

ABAP_SYNTAX_FORMS

Simple Case Distinction
1 ... CASE sql_exp
WHEN sql_exp1 THEN result1
$[WHEN sql_exp2 THEN result2$]
...
$[ELSE resultn$|sql_null$]
END ...

Complex Case Distinction
2 ... CASE WHEN sql_cond1 THEN result1
$[WHEN sql_cond2 THEN result2$]
$[WHEN sql_cond3 THEN result3$]
...
$[ELSE resultn$|sql_null$]
END ...


What does it do?
Case distinction in AB_SQL . Either a simple case distinction (simple case) or a complex case distinction (searched case).



Latest notes:

Specifying a case distinction always means specifying an SQL expression. Case distinctions can only be specified for operand positions in which SQL expressions are possible.
A conflict between SQL language element CASE and a column named CASE cannot occur because the ABAP Dictionary does not allow a column with this name to be created. However, if a column with this name does exist, it must be prefixed with the escape character ! when it is specified in an AB-SQL statement.
A maximum of 10 case distinctions can be nested with CASE.
A case distinction can be evaluated in the table buffer and does not cause table buffering to be bypassed.
NON_V5_HINTS
ABAP_HINT_END