Current position:  Home > Default > Report in OOPS

Report in OOPS

Time:October 11
Advertisement
Hi,
   I am new to oops I have created a small program to display data. I have declared a small struture in the Public section. but when I see the internal table in the debugging mode it contains 2 fields as KEYPART    FUNCPART  instead of fields which are return in the internal table decleration. and the program in going to dump.
the report is as follows
CLASS TEST DEFINITION.
PUBLIC SECTION.
DATA : BEGIN OF ITAB,
            KUNNR TYPE KNA1-KUNNR,
            LAND1 TYPE KNA1-LAND1,
            NAME1 TYPE KNA1-NAME1,
            ORT01 TYPE KNA1-ORT01,
       END OF ITAB.
DATA IT_ITAB TYPE STANDARD TABLE OF ITAB.
DATA WA_ITAB TYPE ITAB.
METHODS: DISPLAY,
         RETRIEVE_DATA,
         PASS_TO_ALV.
ENDCLASS.
CLASS TEST IMPLEMENTATION.
METHOD RETRIEVE_DATA.
  SELECT KUNNR LAND1 NAME1 ORT01 FROM KNA1 INTO TABLE IT_ITAB.
ENDMETHOD.
METHOD PASS_TO_ALV.
  RETRIEVE_DATA( ).
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
      I_STRUCTURE_NAME                  = 'ITAB'
    TABLES
      t_outtab                          =  IT_ITAB.
ENDMETHOD.
METHOD DISPLAY.
     PASS_TO_ALV( ).
ENDMETHOD.
ENDCLASS.
DATA  OBJ_TEST TYPE REF TO TEST.
START-OF-SELECTION.
   CREATE OBJECT OBJ_TEST.
please trace out the problem.
Thanks in Advance.
Advertisement
Thanks for your reply,
As with in the display I called Pass_to_alv and with in the Pass_to_alv I have called retrieve_data method as there is no problem there. Please run the report in the debug mode as you cannot see the fields ( kunnr name1 land1 ort01 ) in the table as it shows 2 fields KEYPART  FUNCPART. The problem lines there.