Application Development 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: 

Pushbutton in AlV grid using OOPs

bhargava_dns
Participant
0 Kudos

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.

4 REPLIES 4

Former Member
0 Kudos

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

0 Kudos

The text should be dynamic based on the status.

0 Kudos

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

Former Member
0 Kudos

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 ..