cancel
Showing results for 
Search instead for 
Did you mean: 

Access vis NULL object reference.

former_member189058
Active Contributor
0 Kudos

Hi experts,

I have a component having context->node1->usernr

usernr is one of the attributes in node1.

node1 has cardinality 0..n

I have two views, view1 and view2 in the window.

both the view contexts have mapping with node1 of component controller context.

View1 has a table that shows usernr as a column and view2 has an inputfield, the value of which is bound to usernr.

On clicking a button in view1, I am creating an element of node1 and binding it to the node. this os working fine. Also I am firing the outplug of view1 which is connected to inplug of view2.

I debugged the view2 and it is going upto the HANDLEIN_view2_inputplug

Then I just get this dump "Access via 'NULL' object reference not possible."

Error in the ABAP Application Program

The current ABAP program "CL_WDR_VIEW_ELEMENT_ADAPTER===CP" had to be terminated because it has come across a statement that unfortunately cannot be executed.

Error analysis

You attempted to use a 'NULL' object reference (points to 'nothing') access a component (variable: " ").

An object reference must point to an object (an instance of a class) before it can be used to access components.

Either the reference was never set or it was set to 'NULL' using the CLEAR statement.

Information on where terminated

Termination occurred in the ABAP program "CL_WDR_VIEW_ELEMENT_ADAPTER===CP" - in "GET_ATTRIBUTE_EXTERNAL".

The main program was "SAPMHTTP ".

In the source code you have the termination point in line 10 of the (Include) program "CL_WDR_VIEW_ELEMENT_ADAPTER===CM00Q".

Source Code Extract

Line SourceCde


    1 method get_attribute_external.
    2
    3   data data_container type ref to cl_wdr_data_container.
    4   data attribute type wdr_attribute_pointer.
    5   data client_component type ref to cl_wdr_client_component.
    6
    7   attribute-attribute_name = i_binding->attribute_name.
    8   attribute-element ?= get_bound_element( i_binding ).
    9   client_component ?= attribute-element->node->controller->component->data_container_superio
   11   data_container = client_component->data_container.
   12
   13   e_value = data_container->get_and_format( attribute = attribute ).
   14
   15 endmethod.

Error is at line 9

Chosen variables

Name

Val.

No. 21 Ty. METHOD

Name CL_WDR_VIEW_ELEMENT_ADAPTER=>GET_ATTRIBUTE_EXTERNAL

I_BINDING

########

0000000C

D0000002

E_VALUE

SY-REPID

CL_WDR_VIEW_ELEMENT_ADAPTER===CP

0000000000000000000000000000000000000000

0000000000000000000000000000000000000000

4455455544554444445544455453334522222222

3CF742F6957F5C5D5E4F1410452DDD3000000000

%_DUMMY$$

0000

0000

2222

0000

ATTRIBUTE-ATTRIBUTE_NAME

USERNR

000000

000000

554545

5352E2

I_BINDING->ATTRIBUTE_NAME

USERNR

000000

=======================================================================

The thing that is worrying me is that nothing like this was happening at all earlier. I tested the application quite a few number of times and then suddenly this started. Since then it has not stopped.

I am unable to understand the reason for this. Pl help.

Regards,

Reema.

Edited by: Reema Shahbazkar on Jun 12, 2008 3:28 AM

Accepted Solutions (0)

Answers (7)

Answers (7)

former_member189058
Active Contributor
0 Kudos

When navigating from view1 to view2, I created an element in the node, set its attributes and bound it to the node. Also I set its lead selection to the newly created element. and it works fine now,.

former_member189058
Active Contributor
0 Kudos

The node in the component controller had Initialize Lead Selection set to FALSE.

Former Member
0 Kudos

Hey Reema,

Were you able to resolve this error. I am facing exactly the same issue currently . My primary data container nodes belong to the component controller. I did verify the same for any change in the cardinality and dont see anythign thats changed which could be impacting my views. In any case, I had kept the cardinality as 0...n initially to be safe since there cud be scenarios where no values can exist for the same at runtime.

Please do let me know how you happened to resolve this.

Thanks,

Puja.

Former Member
0 Kudos

Hi Puja

Can you paste your code where you getting error. and open a new thread for that.

Regards

Naresh

Former Member
0 Kudos

Hi,

if there are no values then also it dumps.

so change the cardinality to 0..n

check the value whether bound to correct value.

Yashpal
Active Contributor
0 Kudos

Hi ,

You are binding the inputfield with the attribute whose node cardinality is 0....n that's why its giving u dump , make it 1...1

it should work .also u cannot do the mapping ,do the manual copy of data .

Regards

Yash

Former Member
0 Kudos

hi reema,

this is because you are trying to access a vriable which does not exist. it might be because of a spelling mistake or because you are not passing teh variable name in capital letters or the node name might have been changed.

---regards,

alex b justin

Former Member
0 Kudos

Reema,

What is that you are trying to acheive on the click of button in view1.

which line of code in view2 is giving problem