‎2008 Mar 09 6:42 AM
hi,
can some one help me find the bug in the followin code?. it throws me the followin error.
"itab is not compatible with the formal parameter it_outtab".
REPORT ZALVDILIP.
data: begin of itab occurs 0 ,
carrid type s_carrid,
end of itab.
data: custom type ref to cl_gui_custom_container.
data: grid type ref to cl_gui_alv_grid.
select carrid from scarr into itab.
write: / itab.
endselect.
create object custom exporting container_name = 'ZCUSTOMCONTROL'.
create object grid exporting i_parent = custom.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING I_STRUCTURE_NAME = 'SCARR'
CHANGING IT_OUTTAB = itab.
thanks.
‎2008 Mar 09 6:46 AM
Hi,
You cannot write directly the internal table as you did, above.
Give the loop statement like this.
After the select statement enter the loop at statement like this.
Loop at itab.
write : / itab-carid.
endloop.
For e.g view this coding below :
DATA : BEGIN OF ITAB,
PERNR TYPE PA0001-PERNR,
END OF ITAB.
SELECT SINGLE PERNR FROM PA0001 INTO ITAB.
LOOP AT ITAB.
WRITE : / ITAB-PERNR.
ENDLOOP.
Use like this for your coding.
Thanks,
Sakthi
‎2008 Mar 09 8:09 AM
HI,
REPORT ZALVDILIP.
data: begin of itab occurs 0 ,
carrid type s_carrid,
end of itab.
data: custom type ref to cl_gui_custom_container.
data: grid type ref to cl_gui_alv_grid.
select carrid from scarr into itab.
write: / itab.
endselect.
create object custom exporting container_name = 'ZCUSTOMCONTROL'.
create object grid exporting i_parent = custom.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING I_STRUCTURE_NAME = 'SCARR'
CHANGING IT_OUTTAB = itab[].
Cheers,
Chandra Sekhar.