on 05-20-2011 4:02 PM
Hi experts,
I need to create new dynamic element in exist node.
This is my coding:
DATA lo_nd_conti_display_table TYPE REF TO if_wd_context_node.
DATA lo_el_table TYPE REF TO if_wd_context_element.
lo_nd_conti_display_table = wd_context->get_child_node( name = wd_this->wdctx_item_basic_data ).
lo_el_table = lo_nd_conti_display_table->get_element( ).
lo_el_table = lo_nd_conti_display_table->create_element( ).
lo_el_table->set_attribute( name = 'ZZ_PROD_TEXT' value = '1' ).
But I have dump at last expression
UNCAUGHT_EXCEPTION
Could not find attribute ZZ_PROD_TEXT
Method: IF_WD_CONTEXT_NODE_INFO~GET_ATTRIBUTE of program CL_WDR_CONTEXT_NODE_INFO======CP
Method: IF_WD_CONTEXT_ELEMENT~SET_ATTRIBUTE of program CL_WDR_CONTEXT_ELEMENT========CP
Method: PST4LVVUE6CIE3YCDWZCWO0T62P3 of program /1BCWDY/PH5AZ8WQT1P84GS6R3OK==CP
Method: IF_WDR_VIEW_DELEGATE~WD_DO_MODIFY_VIEW of program /1BCWDY/PH5AZ8WQT1P84GS6R3OK==CP
Method: DO_MODIFY_VIEW of program CL_WDR_DELEGATING_VIEW========CP
Method: MODIFY_VIEW of program CL_WDR_VIEW===================CP
Method: DO_MODIFY_VIEW of program CL_WDR_CLIENT_COMPONENT=======CP
Method: DO_MODIFY_VIEW of program CL_WDR_CLIENT_COMPONENT=======CP
Method: DO_MODIFY_VIEW of program CL_WDR_CLIENT_COMPONENT=======CP
Method: DO_MODIFY_VIEW of program CL_WDR_CLIENT_COMPONENT=======CP
Can you please help me?
BR
Evgeniy
Does this node item_basic_data has the attribute ZZ_PROD_TEXT ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In that case you coding is not correct.
lo_el_table->set_attribute( name = 'ZZ_PROD_TEXT' value = '1' ).
You need to get the node info and use add attribute method like below.
For Dynamically creating Attribute
DATA :
rootnode_info TYPE REF TO if_wd_context_node_info,
dyn_node_info TYPE REF TO if_wd_context_node_info,
dyn_node TYPE REF TO if_wd_context_node,
dyn_attr_info TYPE wdr_context_attribute_info.
dyn_attr_info-name = 'ZZ_PROD_TEXT'.
dyn_attr_info-DEFAULT_VALUE = '1'.
dyn_attr_info-type_name = 'PROD_NAME' . Data Element(CHAR20) ( Type Of Attribute )
rootnode_info = wd_context->get_node_info( ).
CALL METHOD rootnode_info->add_attribute
EXPORTING
attribute_info = dyn_attr_info.
Hi,
try using that code in the WDDOMODIFYVIEW method of the view in which you want to create the nodes dynamically.
Also if you want that node to be created/inserted into the view when it is displayed for the first time during runtime you can
insert the appropriate code into the WDDOINIT method of that view.
Edited by: Adithya K Ramesh on May 23, 2011 10:43 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Evgeniy
Is ths attribute already defined on the node?
I think not.
First you will have to define the all the attributes you need
Then you create a new element
regards
yuval
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.,
This is not the right way to create element dynamically.,
Check this wiki ., [Create UI elements Dynamically in WDA|http://wiki.sdn.sap.com/wiki/display/WDABAP/CreatingUIElementsDynamicallyinAbapWebdynpro+Application]
hope this helps u.,
Thanks & Regards
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.