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: 

How to handle check box click in ALV grid

jiri_faltin2
Explorer
0 Kudos

Hi Experts,

I use ALV grid using FM.

I have list of delivery note items with one custom field as check-box. When I check the checkbox, all other lines related to the same delivery note should be automaticaly checked.

Is there any event or function code, where I can handle single click to checkbox?

Thanks&regards,

Jirka

4 REPLIES 4

Former Member
0 Kudos

Get the Function Code running behind the Check Box click by going into the Debug mode on the CheckBox Click.

Put your code in the at user Command event with case sy-ucomm for your value of sy-ucomm.

Update the Checkbox for your required rows and refresh the ALV......

0 Kudos

Hi Ajay,

problem is, that single click is not going to user_command routine. I found ucomm, but I can't do any action.

Best regards,

Jirka

Former Member
0 Kudos

HI

you can use following code in user command function .




DATA :BEGIN OF IT_MAINDATA OCCURS 0,
      MAINDATA(1),
      IT_RD1(1),
 END OF IT_MAINDATA.

data: V_INDEX TYPE I.


 DESCRIBE TABLE itab LINES LINE.
  DO. " line times.
    READ LINE SY-INDEX FIELD VALUE Iitab-RD1.
    IF SY-SUBRC NE 0. EXIT. ENDIF.
    CHECK V_INDEX > 0.
    CHECK itab-RD1 = 'X'.
    MODIFY itab INDEX V_INDEX.
    IT_MAINDATA-IT_RD1 = Iitab-RD1.
  ENDDO.

i think is work.

regards,

Abhi

babu_kilari4
Active Contributor
0 Kudos

Hi,

Use ALV Layout conept. You get a tab in the left side of the each record. If you check that it takes the value as 'X' and if you uncheck that it takes the value as ' '. Do all your validations based on that.

Thanks,

Babu Kilari