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

how to solve it ??

Former Member
0 Likes
591

hi, i just want to test simple ALV program, and following is my code, but error occurs said that no fieldcat defined, how to solve that ?

And i really need some underling concept about such kind ALV. thank you !!

REPORT ZZKTEST .

TYPE-POOLS: slis.

TABLES sflight.

DATA: data_sflight LIKE TABLE OF sflight,

lt_fieldcat TYPE slis_t_fieldcat_alv.

INITIALIZATION.

SELECT * FROM sflight INTO TABLE data_sflight.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-cprog

i_callback_user_command = 'USER_COMMAND'

it_fieldcat = lt_fieldcat

TABLES

t_outtab = data_sflight.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
570

well you are giving an empty field cat to the ALV.

HJe doesnt like that. either build your field cat before sending it to the FM, or forget about that fieldcat and use the parameter I_STRUCTURE of the FM.

give the structure of your data to that parameter ( the structure of the table your data is beeing stored in).

hi, i just want to test simple ALV program, and following is my code, but error occurs said that no fieldcat defined, how to solve that ?

And i really need some underling concept about such kind ALV. thank you !!

REPORT ZZKTEST .

TYPE-POOLS: slis.

TABLES sflight.

DATA: data_sflight LIKE TABLE OF sflight,

lt_fieldcat TYPE slis_t_fieldcat_alv.

INITIALIZATION.

SELECT * FROM sflight INTO TABLE data_sflight.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-cprog

i_callback_user_command = 'USER_COMMAND'

it_fieldcat = lt_fieldcat

TABLES

t_outtab = data_sflight.

4 REPLIES 4
Read only

amit_khare
Active Contributor
0 Likes
570

You have to create the fieldcatalog for the REUSE FM.

Check the link -

Regards,

Amit

Reward all helpful replies.

Read only

Former Member
0 Likes
570

u have to maintain field catalog or u have to pass ref structure name for this FM.

check i_structure parameter.

Regards

prabhu

Read only

Former Member
0 Likes
571

well you are giving an empty field cat to the ALV.

HJe doesnt like that. either build your field cat before sending it to the FM, or forget about that fieldcat and use the parameter I_STRUCTURE of the FM.

give the structure of your data to that parameter ( the structure of the table your data is beeing stored in).

Read only

Former Member
0 Likes
570

u had not maintained the field catalog for it,

just check the sample programs in package SLIS.

regrds

anjali