cancel
Showing results for 
Search instead for 
Did you mean: 

How to re-set project role status using the class CL_DPR_API_STATUS?

Former Member
0 Kudos

Hi,

Can anyone explain how to re-set the status of a project role in enhanced staffing using the class CL_DPR_API_STATUS, e.g. from Staffing in Process to Start Staffing?

In transaction code BS02 I have found the transactions allowed by the object and the corresponding system statuses as well as the function module CRM_STATUS_CHANGE_FOR_ACTIVITY to "Reset Staffing" the status with activity/business transaction DX46.

Best Regards,

Philipp

Accepted Solutions (0)

Answers (1)

Answers (1)

judith_gabriel
Contributor
0 Kudos

Dear Philipp,

you can also use BAPI BAPI_BUS2177_SET_STATUS to set the status on a role.

Detailed information can you find in the documentation of the function module in SE37.

Best regards,
Judith

Former Member
0 Kudos

Hi Judith,

Thank you for your reply. The function module you mention works for user statuses, not for system statuses.

The SAP logic checks the user authority whenever the status is set via the API class, which we would like to change in this case. Thus, I have implemented the following which serves the basic funtionality, but lacks the finesse to update all Web Dynpro contents beyond the window/view in focus.

  lv_participant_guid = wd_comp_controller->ms_obj_event-guid.

  READ TABLE wd_comp_controller->mt_active_status INTO ls_value_pair INDEX 1.
  IF sy-subrc IS INITIAL.
    CASE ls_value_pair-name.
      WHEN 'I1730'. "Staffing in Process
        CALL FUNCTION 'CRM_STATUS_CHANGE_FOR_ACTIVITY'
          EXPORTING
            objnr                = lv_participant_guid
            vrgng                = 'DX46'
          EXCEPTIONS
            activity_not_allowed = 1
            object_not_found     = 2
            status_inconsistent  = 3
            status_not_allowed   = 4
            wrong_input          = 5
            warning_occured      = 6
            OTHERS               = 7.
        IF sy-subrc <> 0.
* Implement suitable error handling here
          CALL METHOD cl_dpr_ui_services=>add_t100_msg(
            EXPORTING
              iv_msg_type  = 'I'
              iv_msg_class = 'ZPPM_MESSAGE_CLASS'
              iv_msg_nr    = '050' ). "Error on Reset of Staffing Start
        ENDIF.

        IF sy-subrc IS INITIAL.
          CALL FUNCTION 'BAPI_CPROJECTS_COMMIT_WORK'
            TABLES
              return = lt_return.