02-09-2008 7:20 AM
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.
02-09-2008 7:35 AM
Hi,
write this statement after create object statement.
call method obj_test -> retrieve_data.
then see .
if u have any queries plzz post again with the short description of the dump.
Plzz reward points if it helps.
02-09-2008 7:44 AM
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.