cancel
Showing results for 
Search instead for 
Did you mean: 

Set value attribute of a node

Former Member
0 Kudos

Hi all,

I am trying to set the default value of a dropdown by key.

My context node structure is

My_Node

- My_NodeAttribute

My dropdown by key is binded to My_NodeAttribute and is displaying all the values.But the initial value is blank.So I am using the following code to set the default value in the dropdown,

data: data: LO_My_NodeELE type ref to if_wd_context_element.

CALL METHOD LO_My_NodeELE->SET_ATTRIBUTE

EXPORTING

NAME = 'My_NodeAttribute'

VALUE = 'XYZ'

.

Its not giving me any syntax errors but at runtime I m getting the following error:

Access via 'NULL' object reference not possible.

The node Cardinality is 1-1,selection - 0-1.

Please advise.

Thanks

Kukku

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Does the domain has the fixed values or you are populating the values.

The cardinality of the node should be 1:N or 0:N to hold the mutliple values for the dropdown.

Is this the part of the selection fields.

Check ST22 for the detailed error analysis. I think the context element reference is not there.

Regards,

Lekha.

Former Member
0 Kudos

Hello Lekha,

Thank you for your immediate response.I was able to solve my problem by setting the default value of the value attribute in the properties.The cardinality is changed to 1-n.

Thanks

Kukku

Answers (0)