Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

abap

Former Member
0 Likes
361

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.

2 REPLIES 2
Read only

Former Member
0 Likes
344

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

Read only

Former Member
0 Likes
344

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.