cancel
Showing results for 
Search instead for 
Did you mean: 

To save checkbox group result

Former Member
0 Kudos

Hi ,

i'm using check-box group. i want to get the values of the checked or selected check boxes in a variable if possible.

reply asap.

Edited by: sarthakar on Feb 6, 2012 1:31 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

You just read the attribute under node to which you binded the check box group values using method get_attribute .

It will give the selected value text.

Hope this helps u.,

Thanks & Regards,

Kiran.

Answers (2)

Answers (2)

Former Member
0 Kudos

thanks all,

for your valuable answers

Former Member
0 Kudos

Hi Sarthakar,

use following code to get selected elements for checkbox group.


    DATA lo_nd_chkgrp TYPE REF TO if_wd_context_node.
    DATA lo_el_chkgrp TYPE REF TO if_wd_context_element.
    DATA ls_chkgrp TYPE wd_this->element_chkgrp.
    DATA lt_chkgrp TYPE wd_this->elements_chkgrp.
*   navigate from <CONTEXT> to <CHKGRP> via lead selection
    lo_nd_chkgrp = wd_context->get_child_node( name = wd_this->wdctx_chkgrp ).

*   @TODO handle not set lead selection
    IF lo_nd_chkgrp IS INITIAL.
    ENDIF.

*   get element via lead selection
    lo_el_chkgrp = lo_nd_chkgrp->get_element(  ).

*   @TODO handle not set lead selection
    IF lo_el_chkgrp IS INITIAL.
    ENDIF.
data ele_set type wdr_context_element_set.
data wa like line of ele_set.
CALL METHOD lo_nd_chkgrp->get_selected_elements
*  EXPORTING
*    including_lead_selection = ABAP_FALSE
  receiving
    set                      = ele_set
    .
loop at ele_set INTO wa.
CALL METHOD wa->get_static_attributes
  IMPORTING
    static_attributes = ls_chkgrp
    .
append ls_chkgrp to lt_chkgrp.
endloop.