cancel
Showing results for 
Search instead for 
Did you mean: 

Access via 'NULL' Object Reference not possible error

Former Member
0 Kudos

Friends,


I am working on a custom Web Dynpro component in ECC 6.0. I am working on a dropdown by key field.


I have added the code to populate the dropdown. I am getting an error - Access via ‘NULL’ object reference not possible.


I am guessing that this error is due to the wrong cardinality of the node(s). Here are the details about the node and the attribute:

The attribute is of type string and has been placed in a child node B under root node A.

The root node A has Cardinality 1..1 and Selection 0..1 and the child node B (containing the dropdown attribute) has Cardinality 1..n and Selection 0..1

I have checked the Initialization Lead Selection property of the both the nodes. If I uncheck it, I get an error.


I would greatly appreciate your inputs and thoughts on how to rectify this error.


Thanks and Regards.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for the replies.

The error was in the Supply Function. I rectified it.

Former Member
0 Kudos

To add to the description, I am using the method set_attribute_value_set to populate the drop down.

Looking forward to your inputs.

Thanks.

former_member230486
Contributor
0 Kudos

Hi,

The cardinality which you have been placed is correct.You have to take supply function to assign default values to the drop down list to the child node B.

In the supply function method write the logic for populating data(by default supply function method will provide you code.You just use that code).

Check it once while you are testing in debugging whether the populated data is getting into the table which you binded).

Former Member
0 Kudos

Getting Null object error is very common id Webdynpro. Sometimes we use code wizard and delete few things and while deleting we delete important object reference statements.Please re-generate the code using code wizard it will be corrected.If not check in debugging which node is not getting reference and see object reference is available in code or not.

Hope it will fix.