03-17-2015 12:28 PM
Hi everybody,
One my client requirement is that he needs push buttons in side the alv grid, i.e. one full column should be of push button and the text of these push button should be changed dynamically and on the when the button event should be activated when the button is pressed.
please let me how this can be achieved....as far as i know the button style can be activated in the reuse_display_alv but i could not come across any posts that tells how to achieve the above requirement.
Thanks
Bhargava.
03-17-2015 12:36 PM
Hi Bhargava,
When you build your field catalog, try passing this information to your column.
wa_filedcat-style = cl_gui_alv_grid=>mc_style_button
When you say the text should be dynamic, you need it to change as soon as you click the button, or depending of a status, etc?
Try updating the table/fieldcat and refreshing the alv display.
Regards,
Thales Schmidt
03-18-2015 4:49 AM
03-18-2015 9:27 AM
Hi,
Take a look on this article for more examples ABAP-Changing Cell characteristics in ALV (OOPS) - Code Gallery - SCN Wiki
When you populate your output table, just make a small logic to fill the button column with the text you want, based on the status. I believe the button will output the field value on the button text.
Thales Schmidt
03-20-2015 2:27 PM
Hello,
You can set the button using gst_fieldcat-style = cl_gui_alv_grid=>mc_style_button.
and then to change the text by directly copying the text ..
gt_i_out_tab-pb_bunit = c_icon_create.
I had used this technique to dynamically change the icon of the buttons ..