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

PushButton in ALV Grid

0 Likes
1,910

Hi All,

I have a ALV report in a container of screen painter and i want to change a column of ALV grid into a Pushbutton with image. Is it possible? if yes, then how?Please tell me as soon as possible.

Thanks and Regards

Shubhanshu

1 ACCEPTED SOLUTION
Read only

chundru_ravindra
Participant
0 Likes
1,070

Hi,

For Displaying as Push Button :

  •     Add one more field for final Structure i.e. CSTYLE Type LVC_T_STYL(this of table type) .
  •      Declare workarea for this ex: WA_STYLE TYPE  LVC_S_STYL.
  •      While filling Final internal Table pass this info also.   

        WA_STYLE-FIELDNAME    = 'your field name'.

        WA_STYLE-STYLE        = CL_GUI_ALV_GRID=>MC_STYLE_BUTTON.

        INSERT WA_STYLE INTO TABLE Your final Itab-CSTYLE.

       append finalwa to finalitab.

For Getting Image:

  • Include INCLUDE <ICONS>.
  • Fieldcat of type LVC_S_FCAT.
  • IF WA_FCAT-FIELDNAME = 'YOUR FIELD'.

          WA_FCAT-ICON = 'X'.

        ENDIF.

  • While filling final ITAB pass Icon Name(from <ICONS>) to your required field
  • append finalwa to finalitab.

Regards,

Ravindra.


Hi All,

I have a ALV report in a container of screen painter and i want to change a column of ALV grid into a Pushbutton with image. Is it possible? if yes, then how?Please tell me as soon as possible.

Thanks and Regards

Shubhanshu

4 REPLIES 4
Read only

Former Member
Read only

chundru_ravindra
Participant
0 Likes
1,071

Hi,

For Displaying as Push Button :

  •     Add one more field for final Structure i.e. CSTYLE Type LVC_T_STYL(this of table type) .
  •      Declare workarea for this ex: WA_STYLE TYPE  LVC_S_STYL.
  •      While filling Final internal Table pass this info also.   

        WA_STYLE-FIELDNAME    = 'your field name'.

        WA_STYLE-STYLE        = CL_GUI_ALV_GRID=>MC_STYLE_BUTTON.

        INSERT WA_STYLE INTO TABLE Your final Itab-CSTYLE.

       append finalwa to finalitab.

For Getting Image:

  • Include INCLUDE <ICONS>.
  • Fieldcat of type LVC_S_FCAT.
  • IF WA_FCAT-FIELDNAME = 'YOUR FIELD'.

          WA_FCAT-ICON = 'X'.

        ENDIF.

  • While filling final ITAB pass Icon Name(from <ICONS>) to your required field
  • append finalwa to finalitab.

Regards,

Ravindra.


Read only

0 Likes
1,070

Hi Chundru Ravindra

Thanks for your answer. Now I have one more question, how I will get sy-ucomm of this push button for further process. Please tell me.

Thanks in advance.

Read only

0 Likes
1,070

Moderator Message: Next time before asking a question , please check if it has been discussed before or not . This topic has been answered many times before.

I recommend to read the useful Blog "Asking Good Questions in the SCN Discussion Spaces will help you get Good Answers" to avoid the impression of "spec dumping and learn the principles of this before asking any more questions.