Skip to Content
0
Former Member
Aug 16, 2007 at 06:29 PM

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

20 Views

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.