Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9071

Re: ABAP Basics

$
0
0

Hi Murali,

 

Murali Krishnan wrote:

 

I am new to webdynpro abap and can anyone please tell me how to hardcode values to a  node ?

 

Do you mean, you need to set the data to context node ? If so, use code wizard as suggested by Mr. Chandra

 

We can set the data to context attribute/element/node as below

 

 

data lo_node type ref to if_wd_context_node.

data lo_element type ref to if_wd_context_element.

data ls_data           type wd_this->element_YOUR_NODE_NAME.

data lt_data            type wd_this->elements_YOUR_NODE_NAME.

 

lo_node = wd_context->get_child_node( name = 'YOUR_NODE_NAME').

 

lo_element = lo_node->get_element( ). " Note: it gets you the element reference based on lead selection

 

"Set data to a context attribute

lo_element->set_attribute(

     exporting

          name = 'ATTRIBUTE_NAME'

          value = 'MY_VALUE' ).

 

" Set data to all context attributes of a context element

lo_element->set_static_attributes(

                    value = ls_data ).

 

" Set data to context node

lo_node->bind_table(

     new_items = lt_data ).

 

Hope this helps you.

 

Regards,

Rama


Viewing all articles
Browse latest Browse all 9071

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>