Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ALV field Catalog error

I tried to build the field catalog as below but it is erroring saying it_fieldcat allows certain data types and ls_fieldcatalog uses a different data type

TYPE-POOLS: slis.

.

data ls_fieldcatalog type SLIS_T_FIELDCAT_ALV

with header line.

DATA: i_repid type sy-repid.

i_repid = sy-repid.

ls_fieldcatalog-fieldname = 'Co Code'.

ls_fieldcatalog-inttype = 'C'.

ls_fieldcatalog-col_pos = '0'.

APPEND ls_fieldcatalog to ls_fieldcatalog.

clear ls_fieldcatalog.

ls_fieldcatalog-fieldname = 'Document No'.

ls_fieldcatalog-inttype = 'N'.

ls_fieldcatalog-col_pos = '1'.

APPEND ls_fieldcatalog to ls_fieldcatalog.

clear ls_fieldcatalog.

ls_fieldcatalog-fieldname = 'GL Account'.

ls_fieldcatalog-inttype = 'N'.

ls_fieldcatalog-col_pos = '2'.

APPEND ls_fieldcatalog to ls_fieldcatalog.

clear ls_fieldcatalog.

ls_fieldcatalog-fieldname = 'Posting Date'.

ls_fieldcatalog-inttype = 'D'.

ls_fieldcatalog-col_pos = '3'.

APPEND ls_fieldcatalog to ls_fieldcatalog.

clear ls_fieldcatalog.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = i_repid

IT_FIELDCAT = ls_fieldcatalog

I_SAVE = 'A'

TABLES

t_outtab = it_tab

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

Former Member replied

it_fieldcatalog is internal table type whereas the parameter u r passing ls_fieldcatalog is a structure, it should be declared as a table type u need to use ls_fieldcatalog[] and the error will b removed.

Edited by: vijetasap on Jun 22, 2010 6:09 AM

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question