Logic to check all the checkboxes in the o/p screen

Hi,
In the o/p screen there are about 20 records.Besides each record there is a checkbox.There are 2 pushbuttons on the top of the screen(checkall and uncheckall).When the user clicks on the checkall pushbutton,all the checkboxes should be checked.Similarly when the uncheckall push button is clicked,all the check boxes should be unchecked.Can anyone tell me how to do this?

Hi,
Maybe you try the following:
types: begin of ty_checkboxref,
        ref type ref to checkbox,
        end of ty_checkboxref.
TABLES: sscrfields.
data: gs_checkbox type ty_checkboxref,
        gt_checkbox type table of ty_checkboxref.
parameters: cbox1 as checkbox,
                  cbox2 as checkbox,
                   rbut01 RADIOBUTTON GROUP grp1 USER-COMMAND fcode,
            rbut02 RADIOBUTTON GROUP grp1 ,
            rbut03 RADIOBUTTON GROUP grp1 .
initialization.
get REFERENCE of cbox1 into gs_checkbox-ref.
  append gs_checkbox to gt_checkbox.
  get REFERENCE of cbox2 into gs_checkbox-ref.
  append gs_checkbox to gt_checkbox.
at selection screen.
  IF sscrfields-ucomm = 'FCODE'.
TO CLEAR ALL CHECKBOXES:
loop at gt_checkbox into gs_checkbox.
    gs_checkbox-ref->* = ' '.
    MODIFY gt_checkbox from gs_checkbox.
endloop.
    IF rbut01 = 'X'.
      SPACE FOR ANY FUNCTIONALITY
    ELSEIF rbut02 = 'X'.
      SPACE FOR ANY FUNCTIONALITY
    ELSEIF rbut03 = 'X'.
      SPACE FOR ANY FUNCTIONALITY
    ENDIF.
  ENDIF.
Of course you have to fill the table with the references to the checkboxes once, but than you can loop over the table and handle any amount of checkboxes simultaniously.
Regards,
Dave

Similar Messages

Maybe you are looking for

  • IPhone can no longer connect to AT&T network, just says No Service1

    Ever since I returned from a trip to Canada my iPhone has been unable to connect to the AT&T network. It worked fine before I crossed re boarder into Canada last week and while in Canada it was able to connect to the Rogers network. Since I crossed b

  • Looking for Final Cut Pro Version 6

    I'm looking to upgrade from FCP Version 5 to Version 6, but my G5 is pre-Intel. Anyone have suggestions on where to obtain FCP 6 besides just buying a new Intel G5? I would like to get a new G5, but the economy forced me to look at least upgrading as

  • Force Quit Didn't Work

    I just recently got a brand new Macbook Pro with retina display in January. I was playing games online when suddenly the game froze.  I tried moving the cursor but the cursor was no where to be found.The sounds to the game still worked perfectly and

  • How to find disputed objects in FS-SCM for a disputed case

    Hi, I am trying to get the disputed objects (company code, year, document number etc) for a case in FS-SCM Dispute management. I am new to this subject. Can anyone help in getting the required details? Thanks in advance. Kiran

  • I'm getting an error message when I try to sync

    I am trying to sync my iPhone 4s but it keeps canceling showing an error message that says 'iTunes cannot sync apps to the iPhone because the apps installed on the iPhone could not be determined. Any idea what this means?