cancel
Showing results for 
Search instead for 
Did you mean: 

Node - Dynamic Attributes

Former Member
0 Kudos

Hi,

I have a node 'CONF' with attribute ATNAM01. I used a ZSTRUC to create this node. Here my requirement is that based on user inputs I will execute a FM, I will get no of entries in my itab. I need to assign attributes based on itab entries to 'CONF' node dynamically ....

Ex: ATNAM01, ATNAM02....ATNAMNN.

Is it possible? How? Any code/link!

Regards,

Sateesh...

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi sateesh,

Is your problem statement is some thing like this .Based on data in attribute ATNM01 you need to perform correpsonding treatment .

********************************************************************************************

DATA:

node_check TYPE REF TO if_wd_context_node,

elem_check TYPE REF TO if_wd_context_element,

stru_check TYPE if_start_ior=>element_check ,

item_check_attribute LIKE stru_check-check_attribute.

element = wd_context->get_lead_selection( ).

index = wdevent->get_string( 'INDEX' ).

  • navigate from <CONTEXT> to <CHECK> via lead selection

node_check = wd_context->get_child_node( name = if_start_ior=>wdctx_check ).

  • get element via lead selection

elem_check = node_check->get_element( ).

  • get single attribute

elem_check->get_attribute(

EXPORTING

name = `CHECK_ATTRIBUTE`

IMPORTING

value = item_check_attribute ).

if index EQ 2.

elem_check->set_attribute( name = 'CHECK_ATTRIBUTE' value = Abap_true ).

endif.

if index EQ 1.

elem_check->set_attribute( name = 'CHECK_ATTRIBUTE' value = Abap_false ).

endif.

endmethod.

*********************************************************************************************

Point I want make is based on data populated in attribute <b>check_attribute</b>

.I have identified index of attribute and accordingly performed treatment.

Hope this will help you .

If yes give points.

Cheers!

..............

Parag

Former Member
0 Kudos

Hello Sateesh.

Have a look at the class <b>cl_wd_dynamic_tool</b>. You can use methods of this

class to dynamically at nodes to your context.

lr_rootnode_info   type ref to if_wd_context_node_info

lr_rootnode_info = wd_context->get_node_info( ).

    cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
      parent_info = lr_rootnode_info
      node_name = 'NAME'
      structure_name = 'ZSTRUCT'
      is_multiple = abap_true ).

Hope this helps.

Cheers,

Sascha

Former Member
0 Kudos

Sascha..

I hv created a node dynamically...with some attibutes...

Now i want to give F4 help ....Im usding OVS..

My query is ...how do i set OVS to this dynamically created attribute...

Any idea..

regards

jagruti..

Former Member
0 Kudos

Hi.

Get the node info of the dynamically created node.

Then call method SET_ATTRIBUTE_VALUE_HELP of node info to set the

value help.

Cheers,

Sascha

Former Member
0 Kudos

thanx sascha...it works now...

Former Member
0 Kudos

Sasch..

Im not getting the values....

im getting an error message saying..'NO input help found.Component Usage OVS does not exist'..

This is wht im doing..

node_info->set_attribute_value_help(

exporting name = attribute name

value_help_mode = '131'

value_help = 'OVS' ).

OVS is the method name...

But its not getting called ...

jagruti

Former Member
0 Kudos

Hi Jagruti.

You have to define the component usage at the properties level of your view.

Cheers,

Sascha

Former Member
0 Kudos

hey thanx SASCHA

...im getting it now....

thank you

regards

jagruti..

Former Member
0 Kudos

Hi Sascha...

Have a question...I want to align the data in the cell..

For eg:----

N1

N11

N12

N2

All this in the same column...

But i want to display it in this way ...sm wht like hierarchy...But dont want to use hierarchy display...

Just want to add a tab in the cell...

Can u help..

Jagruti..