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 Grid header refresh problem

Former Member
0 Likes
1,695

Hi,

I have a some stupid problem wich I can not solve on my own 😕 I'm trying to change ALV header during runtime. I have an ALV grid with 7 columns. Each column header conatins name with corresponding date of a current week. I would like to change date period to previous week together with column names. I mean... when I click a button, grid column name's are changing... I simple tried something like this:

CLEAR ws_fieldcat[].

PERFORM build_fields.

lvc_s_stbl-row = 1.

lvc_s_stbl-col = 1.

CALL METHOD go_grid_plan->refresh_table_display

EXPORTING

is_stable = lvc_s_stbl.

but its dont work at all ! I mean even if ws_fieldcat table is filled with correct values column name are not changing 😕 Event if ws_fieldcate table is empty (perfom build_fields is commented out) header are not changing 😕 Propably I dont know something about OO programing or something like that because in most examples in the internet this lines works fine. I call this method from PBO. Thx a lot for help !

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
841

Use method [set_frontend_fieldcatalog|http://help.sap.com/saphelp_erp2004/helpdata/EN/0a/b5532dd30911d2b467006094192fe3/frameset.htm] before method [refresh_table_display|http://help.sap.com/saphelp_erp2004/helpdata/EN/0a/b5531ed30911d2b467006094192fe3/frameset.htm]

- use [get_frontend_fieldcatalog|http://help.sap.com/saphelp_erp2004/helpdata/EN/0a/b55303d30911d2b467006094192fe3/frameset.htm] to get the actual field catalog before updating your data

- Be aware that some changes may require the use of [set_table_for_first_display|http://help.sap.com/saphelp_erp2004/helpdata/EN/0a/b5533cd30911d2b467006094192fe3/frameset.htm]

Regards,

Raymond

3 REPLIES 3
Read only

Former Member
0 Likes
841

Hi

The method refresh_table_display should be calles once, if you need to refresh the ALV you have to call the method for refreshing: REFRESH_TABLE_DISPLAY.

In PBO u can check the object for container if it's initial u can call method to display the list, else to refresh it.

Before refreshing the ALV u need to call the method to change the catalog table: SET_FRONTEND_FIELDCATALOG.

Max

Read only

RaymondGiuseppi
Active Contributor
0 Likes
842

Use method [set_frontend_fieldcatalog|http://help.sap.com/saphelp_erp2004/helpdata/EN/0a/b5532dd30911d2b467006094192fe3/frameset.htm] before method [refresh_table_display|http://help.sap.com/saphelp_erp2004/helpdata/EN/0a/b5531ed30911d2b467006094192fe3/frameset.htm]

- use [get_frontend_fieldcatalog|http://help.sap.com/saphelp_erp2004/helpdata/EN/0a/b55303d30911d2b467006094192fe3/frameset.htm] to get the actual field catalog before updating your data

- Be aware that some changes may require the use of [set_table_for_first_display|http://help.sap.com/saphelp_erp2004/helpdata/EN/0a/b5533cd30911d2b467006094192fe3/frameset.htm]

Regards,

Raymond

Read only

0 Likes
841

exactly ! thx a lot for help !!!!