Ansicht
Dokumentation

ABENOO_OBS_CASE_2 - OO OBS CASE 2

ABENOO_OBS_CASE_2 - OO OBS CASE 2

Vendor Master (General Section)   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

Incorrect Statement After CASE

In ABAP Objects WHEN must be the first statement after CASE.

Error message in ABAP Objects if the following syntax is used:

CASE a.
  MOVE 5 TO a.
  WHEN 5.
    WRITE a.
ENDCASE.

Correct syntax:

MOVE 5 TO a.
CASE a.
  WHEN 5.
    WRITE a.
ENDCASE.

Reason:

The CASE control structure must always reflect the semantics of an IF - ELSEIF control structure, which is not ensured if a statement could occur between CASE and WHEN.






CPI1466 during Backup   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 895 Date: 20240416 Time: 062029     sap01-206 ( 18 ms )