Ansicht
Dokumentation

ABENOO_OBS_CASE_1 - OO OBS CASE 1

ABENOO_OBS_CASE_1 - OO OBS CASE 1

Vendor Master (General Section)   General Data in Customer Master  
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.






CL_GUI_FRONTEND_SERVICES - Frontend Services   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 895 Date: 20240423 Time: 082919     sap01-206 ( 17 ms )