2007 Apr 28 3:19 AM
Hi,
I have a ALV report using OOp. In the report application toolbar i have 2 buttons (PF-Status)
If user click on button1 one of the column to be hide from display. But if click button2 then that column to be unhide and display.
I have tried this use NO_OUT or TECH field in the fieldcatalog. but no use.
Any info how to do this.
aRs
2007 Apr 28 3:51 AM
The problem is that you can only set the fieldcat once for the SET_TABLE_FOR_FIRST_DISPLAY. If you want to modify it afterwards, I think you could use the combination of the GET_FRONTEND_FIELDCATALOG and SET_FRONTEND_FIELDCATALOG methods. So get the FC, read the specific line for the field and set the NO_OUT flag, modify the line and then pass this FC internal table to the SET_FRONTEND_FIELDCATALOG method.
REgards,
RIch Heilman
The problem is that you can only set the fieldcat once for the SET_TABLE_FOR_FIRST_DISPLAY. If you want to modify it afterwards, I think you could use the combination of the GET_FRONTEND_FIELDCATALOG and SET_FRONTEND_FIELDCATALOG methods. So get the FC, read the specific line for the field and set the NO_OUT flag, modify the line and then pass this FC internal table to the SET_FRONTEND_FIELDCATALOG method.
REgards,
RIch Heilman
2007 Apr 28 3:41 AM
Hi,
Try this..
In the PBO if the container is not initial then call the method REFRESH_TABLE_DISPLAY
creation of the ALV Grid Control
if g_custom_container is initial.
call the method grid->set_table_for_first_display
else.
call the method grid->refresh_table_display.
endif.
Thanks,
Naren
2007 Apr 28 3:51 AM
The problem is that you can only set the fieldcat once for the SET_TABLE_FOR_FIRST_DISPLAY. If you want to modify it afterwards, I think you could use the combination of the GET_FRONTEND_FIELDCATALOG and SET_FRONTEND_FIELDCATALOG methods. So get the FC, read the specific line for the field and set the NO_OUT flag, modify the line and then pass this FC internal table to the SET_FRONTEND_FIELDCATALOG method.
REgards,
RIch Heilman
2007 Apr 28 4:15 AM
Thanks Rich,
Your solution worked.
In PAI we have to use
call method cl_gui_cfw=>set_new_ok_code
exporting
new_code = 'ENTR'.
In the PBO
if g_custom_container is initial.
perform f_create_and_init_alv.
else.
perform f_rebuild_fieldcat changing gt_fieldcat.
call method g_grid->set_frontend_fieldcatalog
exporting
it_fieldcatalog = gt_fieldcat[].
call method g_grid->refresh_table_display.
endif.
aRs
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |