[ABAP] Funktion InstanceOf

* Variante 1 (ab 7.50)
IF o_dock IS INSTANCE OF cl_gui_docking_container.
  WRITE: / 'Ok.'.
ENDIF.

* Variante 2 (ab 7.50)
CASE TYPE OF o_dock.
  WHEN TYPE cl_gui_docking_container INTO DATA(o_out).
    ...
  WHEN OTHERS.
    ...
ENDCASE.
 
* Variante 3 (bis 7.40)
IF abap_true = cl_lcr_util=>instanceof( object = o_dock
                                        class = 'CL_GUI_DOCKING_CONTAINER' ).
  WRITE: / 'Ok.'.
ENDIF.

* Variante 4 (bis 7.40)
IF abap_true = cl_wdy_wb_reflection_helper=>is_instance_of( object = o_dock
                                                            type_name = 'CL_GUI_DOCKING_CONTAINER' ).
  WRITE: / 'Ok.'.
ENDIF.