Skip to Content
0
Former Member
Apr 23, 2007 at 02:42 PM

s my code is rite

18 Views

am getting dump error for the following code, can anyone tell me if my code is correct

error is telling like alv_grid s empty

this is my first pgm in oops concepts so i dont know how to correct this

tables: mara.

data: itab like table of mara with header line,

w_itab like line of itab.

data:c_container type scrfname value 'test',

alv_grid type ref to cl_gui_alv_grid,

c_custom_container type ref to cl_gui_custom_container.

data:i_fcat type lvc_t_fcat,

w_fcat like line of i_fcat.

select matnr from mara into corresponding fields of table itab.

CREATE OBJECT C_CUSTOM_CONTAINER

EXPORTING

PARENT = c_custom_container

CONTAINER_NAME = c_container

.

w_fcat-fieldname = 'MATNR'.

w_fcat-ref_table = 'MARA'.

w_fcat-ref_field = 'MATNR'.

w_fcat-coltext = text-002.

w_fcat-seltext = 'Material Number'.

w_fcat-col_pos = 1.

append w_fcat to i_fcat.

clear w_fcat.

CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY

CHANGING

IT_OUTTAB = itab[]

IT_FIELDCATALOG = i_fcat

.