Skip to content

ABAP Keyword Documentation →  ABAP - Quick Reference 

CASE TYPE OF - Quick reference

Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


CASE TYPE OF oref 
  [WHEN TYPE class|intf [INTO target1].
    [statement_block1]]
  [WHEN TYPE class|intf [INTO target2].
    [statement_block2]]
  ...
  [WHEN OTHERS.
    [statement_blockn]]
ENDCASE.

Effect

Defines a control structure with multiple statement blocks statement_block1, ..., statement_blockn. The first statement block is executed for which an object type class or intf specified in the WHEN TYPE statement is more general or equal to the dynamic or static type of the object reference variable oref. If the condition is not met, the statement block is executed after the statement WHEN OTHERS.

Addition

  • INTO target
    Specifies a target variable to which the object reference can be copied.