cancel
Showing results for 
Search instead for 
Did you mean: 

How to get attribute from a dynamic attribute.

Former Member
0 Kudos

Hi,

Can anyone please tell me how to read a dynamic attribtue using get_attribute method in Web Dynpro?

I am able to do a get_attribute of a static attribute. ie

call method element_name->get_attribute

exporting

name 'dynamic attribute'

importing

value = local_variable.

  • Points will be rewarded for helpful answers.

Thanks all,

Rajesh.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi rajesh.....

you can use the same coding...

if you know the attribute name, then you can pass the attribute name in the exporting field.

make sure you create references before that with respect to the node in which it is present.

---regards,

alex b justin

Former Member
0 Kudos

Hi Alex,

I am dynamically adding a child node, and the attribute whichever I am adding to the child node becomes dynamic. My concern is how to access this attribute.

Best Regards,

Rajesh.

Former Member
0 Kudos

hi rajesh.....

eventhough it is dynamic.......

you will know its name



 DATA <var1>  TYPE REF TO if_wd_context_node.
 DATA <var2> TYPE REF TO if_wd_context_element.
 
  var1 = wd_context->get_child_node( name = wd_this->wdctx_<node name>).

  var2 = var1->get_element(  ).



 var2->get_attribute(
    EXPORTING
      name =  <attribute name>
    IMPORTING
      value = lv_ernam ).

---regards,

alex b justin