Skip to Content

Checkbox in alv

Hi Friends,

Iam using checkbox in webdynpro alv table ,my requirement is among the table only one record checkbox is selected.please let me know friends

thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jan 22, 2014 at 04:22 AM

    HI Santhosh,

    You can achieve your requirement as below

    • On cell action alv on check box, you can reset the other check boxes
    • R_PARAMS is having index of selected row
    • Get data from node and reset all check boxes other than the selected row

    Hope this helps you.



    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Santhosh,

      Okay, let me explain in detail

      Let us say you have a alv component usage name as MY_ALV & context node used for alv is MY_NODE and column used for check box is CHECK_BOX

      • Go to methods tab of your view and add an event handler method on_cell_action as below

      • Open event handler method ON_CELL_ACTION and add the below code

      DATA lo_node TYPE REF TO if_wd_context_node.
      DATA lo_el TYPE REF TO if_wd_context_element.
      DATA lt_data TYPE wd_this->elements_MY_NODE.

      FIELD-SYMBOLS <fs_data> LIKE LINE OF lt_data.

      " Nothing to do if column name is not "COLUMN1'
      IF r_param->column NE 'CHECK_BOX'.

      lo_node = wd_context->get_child_node( name = wd_this->wdctx_MY_NODE ).

      table = lt_data

      "reset the check box value of all other rows
      LOOP AT lt_data ASSIGNING <fs_data>.
      IF sy-tabix EQ r_param->index. "skip the reset, for current line

      CLEAR <fs_data>-CHECK_BOX.

      "set data after resetting check box
      new_items = lt_data

      Note: here change the node name, component usage name and column names as per your component

      Hope this helps you.



      alv.PNG (15.1 kB)

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.