cancel
Showing results for 
Search instead for 
Did you mean: 

How to Hide A Radio button By key in webdynpro abap?

suman_kumar16
Participant
0 Kudos

Hi Gurus,

               I have a Radio Button By Key Filed (Coming from domain) three radio buttons such as a) Rad1  b) Rad2 c) Rad3 ....In my requirement I have to hide Rad2 radio button based on some condition.Kindly help me

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Create 3 radio buttons independently instead of creating radio button group and set the visible property based on condition..hope this will help ..

Regards,

Vasavi.

Former Member
0 Kudos

Maybe you should also consider using fixed radiobuttons (not radiobutton group). That way you would be able to bind an visible property with each one separately and would not need to use SET_ATTRIBUTE_VALUE_SET.

former_member184578
Active Contributor
0 Kudos

Hi,

Use SET_ATTRIBUTE_VALUE_SET method of IF_WD_CONTEXT_NODE_INFO to achieve this.

Use FM DD_DOMA_GET/ GET_DOMAIN_VALUES to get the domain values, then based on condition remove the second value and bind the value set.


data: lt_valueset type table of wdr_context_attr_value,

lr_node type ref to if_wd_context_node,

lr_node_info type ref to if_wd_context_node_info.

lr_node = wd_context->get_child_node( '<NODE_NAME>' ).

lr_node_info = lr_node->get_node_info( ).

*get the domain values.. in to lt_valueset,

*based on condition delete the second record from lt_valueset.

lr_node_info->set_attribute_value_set(

exporting

name = '<RADIO_KEY>'  " attribute name

value_set = lt_valueset ).

hope this helps u,

Regards,

Kiran

suman_kumar16
Participant
0 Kudos

Hi Kiran,

            Thanks for your quick reply. Could you please tell me how to get the domain values.. in to internal table [ lt_valueset, ].

Thanks

Suman Kumar.

former_member184578
Active Contributor
0 Kudos

Hi,

Use the Function modules mentioned above( there are many other ways to get the domain values)

sample code:


data: lt_dom_values type standard table of dd07v,
      ls_dom_values type dd07v,
      lt_valueset type table of wdr_context_attr_value,
      ls_valueset type wdr_context_attr_value.

CALL FUNCTION 'GET_DOMAIN_VALUES'
  EXPORTING
    DOMNAME               = 'DOMN' " Your domain name
    TEXT                  = 'X'
  TABLES
    VALUES_TAB            = lt_dom_values.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.

  loop at lt_dom_values into ls_dom_values.

*here you can write the condition and donot append the second record.
   ls_valueset-value  = ls_dom_values-domvalue_l.
   ls_valueset-text   = ls_dom_values-ddtext.
   append ls_valueset to lt_valueset.
   clear ls_valueset.
  endloop.

Now you can bind the value set.

Hope this helps u,

Regards,

Kiran