cancel
Showing results for 
Search instead for 
Did you mean: 

Checkbox in ALV table

Former Member
0 Kudos

Hi,

how can I implement checkboxes inside my ALV so that I can select and get data for a slected row ?

I want this data to be used in side the another method .Pls Help me with your valuable solution.

Rgds

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

refer UDAY's reply in the thread :


method ON_DATA_CHECK .
  DATA: lr_node TYPE REF TO if_wd_context_node,
        lr_element TYPE REF TO if_wd_context_element,
        ls_modified_cells TYPE salv_wd_s_table_mod_cell,
        wa_data type wd_this->element_table,
        wd_node type ref to if_wd_context_node.
 
  FIELD-SYMBOLS <temp> TYPE data.
 
  wd_node = wd_context->get_child_node( name = 'TABLE' ).
 
" get message manager
  DATA lo_api_controller     TYPE REF TO if_wd_controller.
  DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
 
  lo_api_controller ?= wd_this->wd_get_api( ).
 
  CALL METHOD lo_api_controller->get_message_manager
    RECEIVING
      message_manager = lo_message_manager.
 
  lr_node = wd_context->get_child_node( name = 'TABLE' ).
 
  LOOP AT r_param->t_modified_cells INTO ls_modified_cells.
    lr_element = lr_node->get_element( index = ls_modified_cells-index ).
" The ALV might also have been modified at other places so check if the modification
" has happened in the checkbox column. In my example the column APPROVE is being
" displayed as checkboxes to the user. 
    IF ls_modified_cells-attribute = 'APPROVE'.
" If the modification has happened in the checkbox then fetch the information of that row
      wd_node->get_static_attributes( exporting index             = ls_modified_cells-index
                                      importing static_attributes = wa_data ).
" Do your desired processing with the row information that you have in wa_data
    endif.
  endloop.
endmethod.

rgds,

amit

Answers (3)

Answers (3)

Former Member
0 Kudos

pls check ON the SDN AND sap online help for similar requirements

cheers:)

rgds,

amit

Former Member
0 Kudos

Refer this :

https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/webDynproABAP-UsingUIelementsinALVcomponentcells

Former Member
0 Kudos

Hi ,

have u referred these tutorials :

To create Checkbox inside an AlV Column , refer this blog :

https://wiki.sdn.sap.com/wiki/display/Snippets/Web%20Dynpro%20ABAP%20-%20Using%20UI%20elements%20in%...

SAP Online help on Various Events of ALV:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/45/12093591152464e10000000a1553f7/frameset.htm

I hope it helps

regards,

amit