Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to provide checkboxes for particular records in alv ?

Hi experts ,

  Can i know how to provide checkboxes for particular records in alv.I am using  reuse_alv_grid_display??

for example:

      name    city

1   mike    abc

2   harry    xyz

3    bob    

So i need only checkbox for 3rd record i.e if city is initial?  can you please suggest me how to achieve it?

Former Member
Former Member replied

Hi experts,

The issue is solved .Slight modification with ROBERT'S code.

TYPES: BEGIN OF ty_final_1,

        chk(1),

       HANDLE_STYLE TYPE LVC_T_STYL,

        soldto TYPE bu_partner,

        shipto TYPE bu_partner,

        report TYPE zserino,

        soldnm TYPE char40,

        shipnm TYPE char40,

        END OF ty_final_1.

DATA: wa_final1 TYPE ty_final_1,

       it_final1 type table of ty_final_1.

  DATA: wa_celltab TYPE lvc_s_styl,

       ta_celltab TYPE lvc_t_styl.

  DATA:H_TABIX TYPE SY-TABIX.

DATA:wa_LAYOUT TYPE LVC_S_LAYO.

    REFRESH ta_celltab.

   loop at it_final1 into WA_FINAL1.

     H_TABIX = SY-TABIX.

   IF wa_FINAL1-REPORT IS INITIAL.

     wa_celltab-fieldname = 'CHK'.

     wa_celltab-style = cl_gui_alv_grid=>mc_style_enabled.

   ELSE.

     wa_celltab-style = cl_gui_alv_grid=>mc_style_disabled.

  ENDIF.

   INSERT wa_celltab INTO TABLE TA_CELLTAB.

INSERT LINES OF Ta_celltab INTO TABLE wa_final1-HANDLE_STYLE.

     MODIFY IT_FINAL1 INDEX h_tabix FROM wa_final1  TRANSPORTING

                                       HANDLE_STYLE.

     wa_layout-STYLEFNAME = 'HANDLE_STYLE'.

clear:wa_final1.


Warm Regards,

Ramesh Moka

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question