Skip to Content
0
Former Member
Mar 26, 2009 at 12:33 PM

pointer table and exception table use

110 Views

REPORT  ysubdel212     LINE-SIZE 120                         .

*---------------------------------------------------------------------*
*       CLASS testclass DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS testclass DEFINITION.

  PUBLIC SECTION.

    METHODS : testmethod.

    CLASS-DATA num TYPE i.

ENDCLASS.                    "testclass DEFINITION

*---------------------------------------------------------------------*
*       CLASS testclass IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS testclass IMPLEMENTATION.

  METHOD : testmethod.

    num = num + 5.
    write : /5 num.

  ENDMETHOD.                    ":
ENDCLASS.                    "testclass IMPLEMENTATION


START-OF-SELECTION.

  DATA : my_obj TYPE REF TO testclass.
  DATA: myobj_tab TYPE TABLE OF REF TO testclass.

  DO 5 TIMES.

    CREATE OBJECT : my_obj.
    APPEND my_obj TO myobj_tab.

  ENDDO.

  LOOP AT myobj_tab INTO my_obj.
    CALL METHOD: my_obj->testmethod.

Question.

1)I checked in the debugging and checked the value of my_obj in the do loop.

it generated the following values.

tell me what this numbers mean lke 9,10,11,12,13 .

1)9<\PROGRAM=YSUBDEL212\CLASS=TESTCLASS>

2)10<\PROGRAM=YSUBDEL212\CLASS=TESTCLASS>

3)11<\PROGRAM=YSUBDEL212\CLASS=TESTCLASS>

4)12<\PROGRAM=YSUBDEL212\CLASS=TESTCLASS>

5)13<\PROGRAM=YSUBDEL212\CLASS=TESTCLASS>

2) When we need to use pointer table & exception table?

use of pointer table.

3) we can call a static method with the help of object then why we need to declare as static.

one reason may be without object we can call with help of class, is there any other uses?

call method <obj>-> <method>

or call method <class>=><method>

Edited by: Matt on Mar 26, 2009 1:34 PM