cancel
Showing results for 
Search instead for 
Did you mean: 

Error(Access via 'NULL' object reference ) in link to action

Former Member
0 Kudos

Hi,

I have a table-VBAK with "LinkToAction" is one of my column,Once i click that action,i want to call one more table-VBAP in the "TablePopin".

<b>OnAction of "LinkToAction"</b>

I called the another Table(VBAP)-"TablePopin" with the help of following code,

<u>context_element->set_attribute( name = 'SELECTED_POPIN' value = 'TABLEPOPIN' ).</u>

Now i want to fill the VBAP-Table.

So <b>OnAction of "LinkToAction"</b>.

i called the

method ONACTIONOPEN_POPIN .

DATA:

NODE_VBAK1 TYPE REF TO IF_WD_CONTEXT_NODE,

ELEM_VBAK1 TYPE REF TO IF_WD_CONTEXT_ELEMENT,

STRU_VBAK1 TYPE WD_THIS->ELEMENT_VBAK1,

wa_vbap type vbap,

itab_vbap like table of wa_vbap.

  • navigate from <CONTEXT> to <VBAK1> via lead selection

NODE_VBAK1 = WD_CONTEXT->GET_CHILD_NODE( NAME = 'VBAK1' ).

  • @TODO handle not set lead selection

IF ( NODE_VBAK1 IS INITIAL ).

ENDIF.

  • get element via lead selection

ELEM_VBAK1 = NODE_VBAK1->GET_ELEMENT( ).

  • @TODO handle not set lead selection

IF ( ELEM_VBAK1 IS INITIAL ).

ENDIF.

ELEM_VBAK1->GET_STATIC_ATTRIBUTES(

IMPORTING

STATIC_ATTRIBUTES = STRU_VBAK1 ).

if stru_vbak1 is not initial.

select * from vbap into table itab_vbap where vbeln = STRU_VBAK1-vbeln.

endif.

context_element->set_attribute( name = 'SELECTED_POPIN' value = 'TABLEPOPIN' ).

endmethod.

i set the break point and check it.once it enter into the following area of the above code,i am getting error like <b>Access via 'NULL' object reference</b>

<b>ELEM_VBAK1->GET_STATIC_ATTRIBUTES(

IMPORTING

STATIC_ATTRIBUTES = STRU_VBAK1 ).</b>

Now my problem is,i want to fill the VBAP-Table in my "TablePopin".Once i click the "LinktoAction" in my Main Table.

can any body share your ideas.

Thanks in Advance,

Regards,

Ravi.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Ravi,

if you are already filling the node for VBAK make sure you have binded it with the corresponding node...

if still ur getting the dump then try using the get_selected_elements method for getting all the selected entries from the table

Former Member
0 Kudos

Hi Ravi,

Have you filled in the node_vbak1 with some elements? Lets say in a supply function or wddoinit etc.?

Just check that. After that, make sure you have IntializeLeadSelection property set to true for the node_vbak1.

Hope this helps.

Regards,

Neha

Former Member
0 Kudos

Seems that lead selection has not been set on node VBAK1.

get_element returns the lead selection, and if it not has been set you get a null reference.

Set initialiaze lead selection on the node.

Cheers,

Sascha