04-23-2007 3:42 PM
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
.
04-23-2007 3:43 PM
hi,
Check out this sample program
http://www.sap-img.com/abap/abap-example-program-alv-grid-control.htm
04-23-2007 3:43 PM
hi,
Check out this sample program
http://www.sap-img.com/abap/abap-example-program-alv-grid-control.htm
04-23-2007 3:44 PM
first error
give test in upper case
data:c_container type scrfname value 'TEST', "<-------------
U have to create one screen , say 100
call screen 100.
then create one custom container and give the names as TEST
Message was edited by:
Chandrasekhar Jagarlamudi