cancel
Showing results for 
Search instead for 
Did you mean: 

Access via 'NULL' object reference not possible Error in WD application execution

0 Kudos

Experts,

I am getting following error for web dynpro application intermittently, please find following error log:

What happened?
    Error in the ABAP Application Program

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

Error analysis

    An exception occurred that is explained in detail below.

    The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not

     caught in

    procedure "IF_SALV_WD_COMP_TABLE_DATA_MAP~MAP_TO_RESULT_CHANGES" "(METHOD)",

     nor was it propagated by a RAISING clause.

    Since the caller of the procedure could not have anticipated that the

    exception would occur, the current program is terminated.

    The reason for the exception is:

    You attempted to use a 'NULL' object reference (points to 'nothing')

    access a component.

    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_SALV_WD_C_TABLE_V_TABLE====CP" -
     in "IF_SALV_WD_COMP_TABLE_DATA_MAP~MAP_TO_RESULT_CHANGES".
    The main program was "SAPMHTTP ".

    In the source code you have the termination point in line 168
    of the (Include) program "CL_SALV_WD_C_TABLE_V_TABLE====CM080".
    The termination is caused because exception "CX_SY_REF_IS_INITIAL" occurred in
    procedure "IF_SALV_WD_COMP_TABLE_DATA_MAP~MAP_TO_RESULT_CHANGES" "(METHOD)",
     but it was neither handled locally nor declared
    in the RAISING clause of its signature.

    The procedure is in program "CL_SALV_WD_C_TABLE_V_TABLE====CP "; its source
     code begins in line
    1 of the (Include program "CL_SALV_WD_C_TABLE_V_TABLE====CM080 ".

Line  SourceCde

  138
  139         "Set new value to result data
  140         if ls_changelist-r_old_value is not bound.
  141           "insert new table line
  142           lr_component->r_result_data->if_salv_bs_r_data_table_edit~insert_table_line(
  143             index = l_result_data_index ).
  144         else.
  145           "Modify existing table line
  146           lr_component->r_result_data->if_salv_bs_r_data_table_edit~set_table_line(
  147             index     = l_result_data_index
  148             data_line = <ls_table> ).
  149         endif.
  150       else.
  151         "A single attribute value has to be updated
  152
  153         "Get context element from output data node
  154         data lr_element type ref to if_wd_context_element.
  155
  156         "Retrieve the element to update from the data output node
  157         if l_mass_edit_row_inserted = abap_true.
  158           "The Element only exists virtually due to the mass edit mode.

  159           lr_element = lr_node->get_element( l_mass_edit_virtual_index ).

  160           l_mass_edit_row_inserted = abap_false.

  161         else.

  162           "The element already exists in the data output node.

  163           lr_element = lr_node->get_element( ls_changelist-index ).

  164         endif.

  165

  166         "Determine if the cell to be updated is set to null (Nullable)

  167         data l_is_null type abap_bool.

>>>>>         l_is_null = lr_element->is_attribute_null( ls_changelist-attribute ).

  169

  170         "Update result data with change

  171         if <l_value> is assigned.

  172           "update ResultData with cell value

  173           lr_component->r_result_data->if_salv_bs_r_data_table_edit~set_table_cell(

  174             index     = l_result_data_index

  175             attribute = ls_changelist-attribute

  176             data_cell = <l_value>

  177             is_null   = l_is_null ).

  178         else.

  179           "Update result data without any updated cell value

  180           lr_component->r_result_data->if_salv_bs_r_data_table_edit~set_table_cell(

  181             index     = l_result_data_index

  182             attribute = ls_changelist-attribute

  183             is_null   = l_is_null ).

  184         endif.

Please help us on what could be the reason behind this?

Thanks,

Madan

Accepted Solutions (0)

Answers (2)

Answers (2)

ramakrishnappa
Active Contributor
0 Kudos

Hi Madan,

It seems that, there are user settings saved and the attribute in the layout settings is not available with current changes.

try to delete the user settings if any.

Please find my answer in the below link

Reset user settings in WDA

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

It seems that the object reference lr_element has not been assigned. Please ceck, if the context node lr_node has the needed element. (The critical casting happens in line 157 or 163. I think the node has not that many elements as the index number tires to get.

You should always check, if a reference is assigned before accessing this object.

(Like

IF lr_element IS ASSIGNED.

   l_is_null = lr_element->is_attribute_null( ls_changelist-attribute ).

ENDIF.

)