Skip to Content
0
Former Member
May 26, 2010 at 02:02 PM

Transferring checkbox values on ALV to value in the internal table?

129 Views

Hi,

I'm using an ALV grid (CL_GUI_ALV_GRID) to display an internal table. I want users to be able to select one or many rows and those checked lines to be marked as X in my internal table. I have a field, check(1), in my internal table displayed on the ALV, but when I tick one line on the ALV and debug, I don't see an X in the check field on that line in my internal table.

I've successfully written code to select and deselect all lines and those values copy back to my internal table so why don't the single lines?

CASE sy-ucomm.
    WHEN 'SELECT_ALL'.
*   select all lines
      LOOP AT tbl_data INTO wa_data.
        MOVE 'X' TO wa_data-check.
        MODIFY tbl_data FROM wa_data.
      ENDLOOP.
    WHEN 'DESELECT'.
*   deselect all lines
      LOOP AT tbl_data INTO wa_data.
        CLEAR wa_data-check.
        MODIFY tbl_data FROM wa_data.
      ENDLOOP.
ENDCASE.

Do I have to add some code in the PAI to transfer the values?

Any suggestions welcome,

Gill