1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
method ONACTIONSELECTITEM . DATA: v_Element TYPE REF TO if_wd_context_element, items_node TYPE REF TO if_wd_context_node, v_index TYPE i, v_text TYPE string, itemList TYPE STANDARD TABLE OF if_main=>element_radiogroup, w_list LIKE LINE OF itemList. items_node = wd_context->get_child_node( Name = 'RADIOGROUP' ). items_node->get_static_attributes_table( IMPORTING table = itemList ). v_index = items_node->get_lead_selection_index( ). CLEAR w_list. READ TABLE itemList INTO w_list INDEX v_index. v_text = w_list-ebeln. wd_context->set_attribute( EXPORTING value = v_Text NAME = 'VIEWTEXT'). endmethod. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
method WDDOINIT . DATA: v_Element TYPE REF TO if_wd_context_element, items_node TYPE REF TO if_wd_context_node, v_index TYPE i, v_text type string, itemlist type STANDARD TABLE OF IF_MAIN=>element_radiogroup, w_list LIKE LINE OF itemlist. w_list-ebeln = 'Blue'. APPEND w_list TO itemlist. w_list-ebeln = 'Yellow'. APPEND w_list TO itemlist. w_list-ebeln = 'Red'. APPEND w_list TO itemlist. w_list-ebeln = 'Magenta'. APPEND w_list TO itemlist. w_list-ebeln = 'While'. APPEND w_list TO itemlist. w_list-ebeln = 'Black'. APPEND w_list TO itemlist. Items_node = wd_context->get_child_node( Name = 'RADIOGROUP' ). Items_node->bind_table( itemList ). Items_node->set_lead_selection_index( 3 ). v_Index = Items_node->get_lead_selection_index( ). CLEAR w_list. READ TABLE itemlist INTO w_list INDEX v_index. v_text = w_list-ebeln. wd_context->set_attribute( EXPORTING value = v_text NAME = 'VIEWTEXT' ). endmethod. |