Ansicht
Dokumentation

ABENSQL_CASE - SQL CASE

ABENSQL_CASE - SQL CASE

BAL_S_LOG - Application Log: Log header data   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

- sql_case

Simple case distinction

1. ... CASE sql_exp
           WHEN sql_exp1 THEN result1
          $[WHEN sql_exp2 THEN result2$]
           ...
          $[ELSE resultn$]
      END ...


Complex case distinction

2. ... CASE WHEN sql_cond1 THEN result1
          $[WHEN sql_cond2 THEN result2$]
          $[WHEN sql_cond3 THEN result3$]
            ...
          $[ELSE resultn$]
      END ...



Effect

Case distinction in . Either a simple case distinction (simple case) or a complex case distinction (searched case).

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 statements.
  • A maximum of 10 case distinctions can be nested with CASE.





ABAP Short Reference   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.

Length: 2850 Date: 20240420 Time: 002306     sap01-206 ( 38 ms )