on 05-13-2006 4:56 PM
Hi Experts
How to set a default value to a context node attribute programmatically? Any code snippet will be really helpfull. I am talking about the attribute inside a node in context.
Note: This is for webdynpro for ABAP
Thanks
Gopal
Hi Gopal,
To set value for attribute(ABC) inside Node.
wdContext.currentNodeElement().setABC("Data");
I hope this will help
Regards
Suresh KB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gopal,
Assume you have the node called TEST and attribute called NAME then to set the value of NAME, you can use the following code say in WDDOINIT method or any other method.
data:
Node_Test type ref to If_Wd_Context_Node,
Elem_Test type ref to If_Wd_Context_Element,
Stru_Test type If_Componentcontroller=>Element_Test ,
Item_NAME like Stru_Test-NAME.
navigate from <CONTEXT> to <TEST> via lead selection
Node_Test = wd_Context->get_Child_Node( Name = wd_This->wdctx_Test ).
get element via lead selection
Elem_Test = Node_Test->get_Element( ).
set single attribute
Elem_Test->set_Attribute(
exporting
Name = `NAME`
Value = 'Value').
Note: You can use Weddynpro code wizard to get this code. (Ctrl+F7)
Regards,
Srini.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.