Skip to Content
0
Aug 03, 2020 at 05:09 PM

lr_object_manager->do_save

42 Views Last edit Aug 03, 2020 at 06:23 PM 2 rev

Hi,

I am using Classes to update decision point status. In my requirement i need to update multiple statuses in sequence depending on the condition.

there are 2 things :

The status is not getting updated and i am getting a short dump as this code is being called in a method which is exposed to Odata Service.

Please let me know what am i missing here.

  METHOD update_followon_status_class.
      IF gt_dp_item_status_update IS NOT INITIAL.
        DATA: lr_decision     TYPE REF TO cl_rpm_decision.
        DATA(lr_object_manager) = cl_rpm_obj_manager=>get_instance( ).
        CALL METHOD lr_object_manager->get_appl_object
          EXPORTING
            iv_project_guid = im_prop_data-zzproposal_guid
            iv_appl_obj_id  = obj_id
            iv_appl_obj_ot  = 'EPO'
          RECEIVING
            rr_object       = DATA(lr_common).

        lr_decision ?= lr_common.

        CALL METHOD lr_decision->get_attributes
          IMPORTING
            es_attributes = DATA(ls_dp_details).

        DATA(l_rc) = lr_decision->if_rpm_entity~set_edit_mode(
        cl_rpm_co=>sc_edit_mode_change ).


        IF l_rc IS NOT INITIAL.
*         Display Error
        ELSE.

          LOOP AT gt_dp_item_status_update ASSIGNING FIELD-SYMBOL(<lw_dp_item_status_update>).

            ls_dp_details-status = <lw_dp_item_status_update>-dp_status.
*           SET the dp attributes
            lr_decision->set_attributes( ls_dp_details ).

            lr_object_manager->do_save( RECEIVING rv_rejected = DATA(l_rejected) ).
            IF l_rejected EQ abap_true.
*             Display Error
              EXIT.
            ENDIF.
          ENDLOOP.
        ENDIF.
  ENDMETHOD.<br>