cancel
Showing results for 
Search instead for 
Did you mean: 

Updating a Node

Former Member
0 Kudos

Hi,

I have one node, which contains 2 child nodes and some attributes say AT1, AT2 . These Attributes are directly in Main node, not in sub nodes.

Now i have to update the value of AT2 based on the value of AT1. How to update the same in the node.

Now AT1 has 3 values 1,2,3. For All values of AT1 = 2, i have to update the value of AT2.

Any inputs.

Thanks,

Pankaj Aggarwal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Your requirement is not clear.

Using the GET_ATTRIBUTE method of IF_WD_CONTEXT_NODE get value of AT1 into lv_at1.

if lv_at1 eq 2.
lv_at2 = 2.
Using Set_attribute method set the attribute AT2 with lv_at2 value.  "You can see change in node
endif.

If your other node has also these attributes, then you can modify the table based on AT1 value and bind the table to the node again.

How to update the same in the node.

To which node you are refering

Regards,

Lekha.

Former Member
0 Kudos

Hi lekha,

if lv_at1 eq 2.
lv_at2 = 2.
Using Set_attribute method set the attribute AT2 with lv_at2 value.  "You can see change in node
endif.

My node is binded with the table. Now if i set a single attribute by Set Attribute method then it will be set for every column.

I have to set a attribute for a single column.

Please suggest.

Thanks,

Pankaj Aggarwal

Former Member
0 Kudos

Hi,

I think AT1 and AT2 are also pat of your node that are aslo directly under the root node.

You can modify the table and bind the table again.

loop at lt_table into ls_table.
lv_tabix  = sy-tabix.
if lv_at1 eq 2.
lv_at2 = 2.
endif.
modify lt_table from ls_table index lv_tabix.
clear lv_tabix.
endloop.

can you be more clear.

Regards,

Lekha.

Answers (0)