cancel
Showing results for 
Search instead for 
Did you mean: 

set_attribute_value_set not working when called more than once

Former Member
0 Kudos

Hi,

I have an editable ALV where the values for one of the fields are set using the method set_attribute_value_set. First time the method is called it works fine and the values are set. But if I call the method once again, because I want to change the value set for the field, is doesn't work, because it is still the old values that are shown when I use the drop down.

I have tried to call the method get_attribute just after set_attribute_value_set to see what the value set is, and the values are, what I want them to be. But it is still the wrong values that are shown, when I use the drop down.

Does anyone have any idea what is wrong - and how I can fix it?

Regards

Gitte

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member199125
Active Contributor
0 Kudos

Before using value_Set method for second time, clear the contents of attribute or node using Invalidate( ) method.

Check now

Regards

Srinivas

Former Member
0 Kudos

I have tried with invalidate on the node and it has no effect. I don't know how to invalidate an attribute, so if you have some input, it would be very welcome.

former_member199125
Active Contributor
0 Kudos

Try by using method set_attribute_null method of if_wd_context_element.

Regards

Srinivas

Former Member
0 Kudos

Hi Srinivas,

I could not get the method set_attribute_null to work.

I ended up changing the editor to dropdownbyindex instead of dropdownbykey. Then I can use the method set_valueset_fieldname to set the valueset for each line. It is not pretty but i works, and there is not that much data in my alv.

Thanks for your help.

/Gitte