on 03-27-2012 8:17 AM
Hi Experts,
method WDDOINIT .
data node_context type REF TO if_wd_context_node.
data node_ele type REF TO if_wd_context_element.
call METHOD wd_context->get_child_node
EXPORTING name = 'FLIGHT_INFO'
RECEIVING child_node = node_context.
CALL METHOD node_context->get_element
RECEIVING node_element = node_ele.
CALL METHOD node_ele->set_attribute
EXPORTING name = 'CARRID'
value = 'AA'.
endmethod.
This Method will set the default value for CARRID as 'AA'.
set_attribute is a method of interface if_wd_context_node. OK..
Then how r we able to call this method using a reference of type if_wd_context_element?? (You can see in my Coding Also)
I am not getting the concept so please help me
Hi Abhishek,
FYI,
SET_ATTRIBUTE method is exists under both the interfaces IF_WD_CONTEXT_ELEMENT & IF_WD_CONTEXT_NODE. but the difference between those both is..
if you have already bound elements to the NODE.. and you wanna change some attribute in particular element.. then you can use SET_ATTRIBUTE method under interface IF_WD_CONTEXT_NODE with INDEX number as exporting parameter.
And you wanna set an attribute value irrespective of data existency at node level.. then you must use SET_ATTRIBUTE of interface IF_WD_CONTEXT_ELEMENT.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi abhisheik,
set_attribute method is also present in if_wd_context_element. we are not using a reference of type if_wd_context_element to point to if_wd_context_node. The variable node_ele in ur program points to an object of type if_wd_context_element which is received from the node_context object.
Check out the methods of if_wd_context_element. It has set_attribute and get_attribute.
Regards
Fareez.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.