cancel
Showing results for 
Search instead for 
Did you mean: 

FPM report_bapiret2_message problem

former_member182048
Active Contributor
0 Kudos

Hi There,

Trying to use if_fpm_message_manager->report_bapiret2_message to focus on the attribute with the message.

Seem to have struck an issue, getting short dumps. Seems to have something to do with the if_wd_context_element i am passing - null reference to element->node->controller in IF_WD_MESSAGE_MANAGER~REPORT_ATTRIBUTE_T100_MESSAGE

 data:  lo_node_general_data TYPE REF TO if_wd_context_node,
          lo_el_general_data TYPE REF TO if_wd_context_element.

"Read general data element
  lo_node_general_data = wd_context->get_child_node( name = wd_this->wdctx_general_data ).
  lo_el_general_data = lo_node_general_data->get_element(  ).

"function call returning bapirettab

  LOOP AT lt_return ASSIGNING <fs_return>.
      TRY.
        lv_field = <fs_return>-field.
        wd_this->mr_fpm_message_manager->report_bapiret2_message(
          EXPORTING
           is_bapiret2                 = <fs_return>
           io_component                = wd_this
           io_element                  = lo_el_general_data
           iv_attribute_name           = lv_field
           ).
      ENDTRY.
    ENDIF.
  ENDLOOP.

Any help would be much appreciated

Cheers

JSP

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Pl post the error log. from ST22

Abhi

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Are you sure that lo_el_general_data is not initial? That would seem to be the likely cause of the error. You have no if checks to see if the object call returns null. Set a breakpoint to see if you are passing in a null object reference to begin with.

former_member182048
Active Contributor
0 Kudos

Hi Thomas et al,

Thanks for responses, this was baffeling me as the report_bapiret2 was working in other areas.

Are you sure that lo_el_general_data is not initial? Yes

What happened was after reporting the messages and before the message got reported I

lo_nd_general_data->invalidate( ).

this was the problem

cheers

John P

Former Member
0 Kudos

Hi,

If you have N number of elements then you need to pass the index value also to get that element.

If you have only one element then the below statement works fine.

lo_el_general_data = lo_node_general_data->get_element( ).

Before proceeding further with LOOP check if element is initial or not.

if lo_el_general_data is not initial.

loop at...............

endloop.

endif.

Regards,

Lekha.