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

ALV LIST is working wrong

Former Member
0 Likes
641

I have written program to see alv list. When i run the program it shows first field value in all fields in same row.I mean it looks like

row1 : 1 1 1 1 1

row2 : 2 2 2 2 2

row3: 3 3 3 3 3

I am calling function to do list with this program :

gd_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = gd_repid

is_variant = gs_variant

is_layout = gs_layout

it_fieldcat = gt_fieldcatalog[]

i_save = 'A'

TABLES

t_outtab = person_tab

EXCEPTIONS

program_error = 1

OTHERS = 2.

and my selection data program is here :

SELECT * INTO CORRESPONDING FIELDS OF TABLE person_tab

FROM zpersonel_bilg

WHERE id = p_id.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
615

Hi,

Please check your field catalog, you might be building it wrongly. Better is use the FM: REUSE_ALV_FIELDCATALOG_MERGE

This will build the fieldcatalog automatically, you need to pass the output table and program name. For more details check the FM documentation.

Hope this helps

Regards

Shiva

I have written program to see alv list. When i run the program it shows first field value in all fields in same row.I mean it looks like

row1 : 1 1 1 1 1

row2 : 2 2 2 2 2

row3: 3 3 3 3 3

I am calling function to do list with this program :

gd_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = gd_repid

is_variant = gs_variant

is_layout = gs_layout

it_fieldcat = gt_fieldcatalog[]

i_save = 'A'

TABLES

t_outtab = person_tab

EXCEPTIONS

program_error = 1

OTHERS = 2.

and my selection data program is here :

SELECT * INTO CORRESPONDING FIELDS OF TABLE person_tab

FROM zpersonel_bilg

WHERE id = p_id.

3 REPLIES 3
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
615

You are building your gt_fieldcatalog[] wrong. Same fields are append thrice.

Read only

Former Member
0 Likes
616

Hi,

Please check your field catalog, you might be building it wrongly. Better is use the FM: REUSE_ALV_FIELDCATALOG_MERGE

This will build the fieldcatalog automatically, you need to pass the output table and program name. For more details check the FM documentation.

Hope this helps

Regards

Shiva

Read only

0 Likes
615

Hi,

REUSE_ALV_FIELDCATALOG_MERGE solved my problem but i am wondering why my function didnt do it. Because when

i write another select program to see on alv list it is working.

Regards.