Displaying text and radio button using WebDynpro for ABAP

...Previous   

  1. Insert UI element TextView  Under GROUP :

 

Enter the name of the TextView as TEXT_VIEW. 

 

And Insert UI element Caption Under GROUP.

Set the Text properties as “Selected Item Name :”. 

  1. Insert UI element RADIOBUTTONGROUPBYINDEX under Group :

 

  1. The result should look like this:

 

Creating data binding from Layout tab UI Elements to context node RADIOBROUP and Attribute VIEWTEXT. 

Enter UI Text_View element and set the below properties :

Text                  :  Binding with the MainView Context VIEWTEXT attribute 

 

Enter UI RBGBINDEX element properties :

TEXT                 :  Binding with the MAINVIEW context node of  RADIOGROUP

   

Create an Action In properties Events under OnSelect  click on New Button and Enter name of the Action “SELECTITEM” 

 

Press Continue Button. 

Supply data to context node RADIORGROUP and attribute VIEWTEXT at runtime. 

  1. Switch to tab Methods of view MAINVIEW and double-click method WDDOINIT. Enter the given coding.

 

  1. On initialization of view MAINVIEW, the content  is loaded into an internal table and assigned to the data structure of context node  RADIOGROUP.
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_MAINVIEW=>ELEMENT_radiogroup,
         w_list LIKE LINE OF itemList.
* Appending elements to "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 = 'White'.
     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.

To continue click here..

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image