Skip to content

Case distinctions of reference types class and interface

Switch on a reference types class and interface using the CASE extension TYPE OF.

CASE TYPE OF account.
  WHEN TYPE bank_account INTO DATA(bank_account).
    " some processing ...
  WHEN OTHERS.
    " some processing ...
ENDCASE.

In a condition e.g. in an IF statement the IS INSTANCE OF operator can be used.

IF account IS INSTANCE OF bank_account.
  " some processing ...
ENDIF.
From SAP/styleguides under CC BY 3.0 — more details
Last updated on