cancel
Showing results for 
Search instead for 
Did you mean: 

WDA - 2 Radio Button points to one back end field.

Former Member
0 Kudos

Hi,

I have one field in back end which type is Boolean.

I need to have two Radio button (Yes or No) in WDA UI and according to that I need to update that back end field (‘X’ for Yes and ‘ ‘ for No).

Example: Are you SAP Trained? Radio Button ‘Yes’ and Radio Button ‘No’ (Both Radio button should update the same back end Boolean field(‘X’ for Yes and ‘ ‘ for No).

I see in UI element Radio button by group and Key? Which one I use for requirement?

I would appreciate if you guide me with steps to achieve my requirement.

Do let me know, if you need more information

Regards,

...Naddy

Edited by: Naddy on Apr 10, 2008 12:43 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member515618
Active Participant
0 Kudos

Hi Naddy,

Simple way is to create a Radio button group by Key.

Identify a dataelement in the data base which has a value range of Yes and No only. If not create one.

Create an attribute with type this data element.

Bind the 'SelectedKey' property of the radio button group with the above attribute. So On the screen it is displayed as

  • Yes

  • No

The selected value is stored in the attribute bound to it.

To read the value selected, do the following.


    DATA lo_nd_radio_button TYPE REF TO if_wd_context_node.
    DATA lo_el_radio_button TYPE REF TO if_wd_context_element.
    DATA ls_radio_button TYPE wd_this->element_radio_button.
    DATA lv_rbg_key LIKE ls_radio_button-rbg_key.
*   navigate from <CONTEXT> to <RADIO_BUTTON> via lead selection
    lo_nd_radio_button = wd_context->get_child_node( name = wd_this->wdctx_radio_button ).

*   get element via lead selection
    lo_el_radio_button = lo_nd_radio_button->get_element(  ).

*   get single attribute
    lo_el_radio_button->get_attribute(
      EXPORTING
        name =  `RBG_KEY`
      IMPORTING
        value = lv_rbg_key ).

Regards,

Sravan Varagani

Former Member
0 Kudos

Thanks, Sravan.

What should i do to display ‘Yes’ and ‘No’ horizontally?

Like,

• Yes

• No

Regards,

...Naddy

Former Member
0 Kudos

To display Horizantally, enter a value 'colCount' accordingly.

Ex - 1 - One Radio button in a line.

2 - Two Radio button in a line.

...Naddy

Answers (1)

Answers (1)

Former Member
0 Kudos

hi naddy.....

you can simply use radiobutton ui element.

[link|http://help.sap.com/saphelp_nw2004s/helpdata/en/c0/e8884118aa1709e10000000a155106/content.htm]

---regards,

alex b justin