on 11-04-2009 12:02 PM
Hi All,
I'm having an issue about adding static attributes to a newly defined context node.
how is this possible ? (adding them with add_attribute will make them dynamic, which gives me problems later on)
As it is now i having some sucess with defining the node as follows:
rootnode_info->add_new_child_node( name = tablename is_static = abap_true STATIC_ELEMENT_TYPE = iobj_tab_name ).
where the element type is a structure in the DDIC.
The problem is that if I add adition attributes to this node they become dynamic, and since I don't have a DDIC type containing all my desired attributes, I can't use this approach.
Hi,
For the static node or root node do you want to add attributes dynamically or statitcally...
rootnode_info->add_new_child_node( name = tablename is_static = abap_true STATIC_ELEMENT_TYPE = iobj_tab_name ).
The above statement is for adding a node under the root node....
Regards,
Lekha.
Edited by: Lekha on Nov 4, 2009 5:34 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I guess you already have some node(EMP) under the Root node. Using the code wizard try to get the refernece of this.
ans also the node info for this node not for the root node..
Now using this nodeinfo you can use the methof ADD_ATTRIBUTE method....
DATA:
lo_node type ref to if_wd_context_node,
lo_info type ref to if_wD_context_node_info.
ls_attr type WDR_CONTEXT_ATTRIBUTE_INFO.
lo_node = wd_context->get_child_node( name = 'EMP' ).
lo_node is not initial.
lo_info = lo_node->get_node_info( ).
endif.
*fill tle Ls_attr structure
if lo_info is not initial.
lo_info->ADD_ATTRIBUTE(
exporting
attribute_info = ls_attr.
endif.
Regards,
Lekha.
Edited by: Lekha on Nov 4, 2009 5:43 PM
Hi,
You can add dynamic attribute in following way:
DATA lo_nd_info_root TYPE REF TO if_wd_context_node_info.
DATA lo_nd_info_flights TYPE REF TO if_wd_context_node_info.
DATA ls_atribute TYPE wdr_context_attribute_info.
*GET META DATA OF THE ROOT CONTEXT NODE
lo_nd_info_root = wd_context->get_node_info( ).
*CREATE A NODE WITH NAME FLIGHTS
lo_nd_info_root->add_new_child_node( u2026u2026.).
*define attribute CARRID
Ls_attribute-NAME = 'CARRID'.
Ls_attribute-TYPE_NAME = 'S_CARR_ID'.
LS_ATTRIBUTE-VALUE_HELP_MODE = '0'.
lo_nd_info_flights->ADD_ATTRIBUTE(ATTRIBUTE_INFO = LS_ATTRIBUTE ).
Regards,
Priya
Hi,
Yes i got your requirement.....IS_STATIC is X means it is static i guess....have you passed the same to the structure..
One you do this....It means that you donot see it in the context node..but internally it is statitc..
Use the HAS_ATTRIBUTE method of if_wd_context_node....
if that attribute is geting created then use the GET_ATTRIBUTE of if_wd_context_node_info and check the properties....
Regards,
Lekha.
'X' or ' ' or even ABAP_TRUE... doesn't seem to do any difference... in the end the Node still have static attributes, and 1 (or however many I make) dynamic attributes.
I event tried changing the IS_STATIC attribute at runtime (in the debugger) - didn't help either.
Note that with the STATIC_ELEMENT_TYPE = iobj_tab_name line I will get some static attributes, but only the ones in the structure, all attributes added afterwards will be dynamic
yes - and if you set the STATIC_ELEMENT_TYPE to a structure in the DDIC the node it creates has static attributes matching the fields of that strcuture.
My problem is though, that I want to add more (since no DDIC structure exists to meet my requirements) attributes... but these cannot (it seems) become static.
User | Count |
---|---|
95 | |
11 | |
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.