Skip to Content
0
Former Member
Oct 18, 2011 at 09:41 AM

Reason for Short Dump???

18 Views

Why does this program terminate even when i_obj has a RUNTIME TYPE of TYPE REF TO Class C1.

Note: I_OBJ is defined as TYPE REF TO interface, however can hold a object of class C1. At run time I_OBJ points to object of ckass C1, However CALL METHOD I_OBJ->('CALL_DUMMY') terminates with a dump.

Please explain

Report xyz.

interface intf.
  methods : dummy.
endinterface.

class c1 definition.
  public section.
    interfaces intf.
    methods : call_dummy.
endclass.

class c1 implementation.
  method intf~dummy.
    write : 'HI, Dummy Here'.
  endmethod.

  method call_dummy.
    intf~dummy( ).
  endmethod.
endclass.

START-OF-SELECTION.
  DATA : i_obj TYPE REF TO intf.

  create object i_obj type c1.
  call method i_obj->('CALL_DUMMY').

<Added code tags>

Edited by: palwaigupta on Oct 18, 2011 11:55 AM

Moderator Message: Please use code tags to format your code.

Edited by: Suhas Saha on Oct 18, 2011 3:28 PM