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

Reg: Push Button on report Output list

Former Member
0 Likes
429

Dear Experts,

I am developing an OO-ALV Report.I got the data for all the fields in my output table.Now my requiement is I have to display a pushbutton with the text 'Information' at the end of each row of the ALV output list.If anybody knows pls.help me on this how can we achieve this.

Thanks in advance.

Dear Experts,

I am developing an OO-ALV Report.I got the data for all the fields in my output table.Now my requiement is I have to display a pushbutton with the text 'Information' at the end of each row of the ALV output list.If anybody knows pls.help me on this how can we achieve this.

Thanks in advance.

2 REPLIES 2
Read only

Former Member
0 Likes
402

You will need to use cellstyles in your ALV setup. This code does not set up the buttons, however, the logic is very close.

You will need to set the cell attribute to MC_STYLE_BUTTON.

table definition.


DATA: BEGIN OF gt_outtab OCCURS 0.
        INCLUDE STRUCTURE zscemp_wk.
DATA: cellstyles    TYPE lvc_t_styl.
DATA: END OF gt_outtab.


*&---------------------------------------------------------------------*
*&      Form  adjust_editables
*&---------------------------------------------------------------------*
FORM adjust_editables USING    pt_list LIKE gt_outtab[].
  DATA: ls_listrow  LIKE LINE OF pt_list.
  DATA: ls_stylerow TYPE lvc_s_styl.
  DATA: ls_styletab TYPE lvc_t_styl.

  LOOP AT pt_list INTO ls_listrow.
    REFRESH ls_listrow-cellstyles.
    REFRESH ls_styletab.

    IF edit_mode EQ 'D'.
      ls_stylerow-fieldname = 'BRANCH'.
      ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
      APPEND ls_stylerow TO ls_styletab.
    ENDIF.

    ls_stylerow-fieldname = 'EMPNO'.
    IF  ls_listrow-empno IS INITIAL
    AND edit_mode EQ 'E'.
      ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled.
    ELSE.
      ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
    ENDIF.
    APPEND ls_stylerow TO ls_styletab.

    INSERT LINES OF ls_styletab INTO TABLE ls_listrow-cellstyles.

    MODIFY pt_list FROM ls_listrow.
  ENDLOOP.

Read only

Former Member
0 Likes
402

ram..

The more I thought about this, it more likely you will not need the cell styles, but you will need to set the column attribute

MC_STYLE_BUTTON to 'X'.