cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_BUS21xx_SET_STATUS status change not saved

Former Member
0 Kudos

Hello experts,

i have a problem with the BAPI's BAPI_BUS21xx_SET_STATUS. We are using SAP PPM 5.0. We don't use any user status for the project definition or project phases.

When i execute a test sequence from SE37 and use the BAPI's BAPI_BUS2172_SET_STATUS and BAPI_CPROJECTS_COMMIT_WORK i get the following results.

Input Data for BAPI_BUS2172_SET_STATUS:

PROJECT_DEFINITION_GUID: my project guid

IS_BUSINESS_TRANSACTION-BUSINESS_TRANSACTION: RELEASE

all other fields are empty. The result is:

I DPR_BAPI             157 BOR object Project 'PROJECTNAME': BAPI method SET_STATUS

I DPR_BAPI             050 No active status profile - deletion is not necessary

The result from the commit BAPI is:

S DPR_CORE             001 No changes were made. Data is not saved

Does anyone have a solution for my problem?

Thanks in advance.

Regards

Christian

Accepted Solutions (1)

Accepted Solutions (1)

former_member201206
Active Contributor
0 Kudos

Hi Christian,

I could reproduce it in SAP internal system as well. Actually it is not a problem, rather the test of funtion modul is not flexible as a normal program.

The test of function modul in your case is like to  run the following codes:

  CALL FUNCTION 'BAPI_BUS2172_SET_STATUS'
    EXPORTING
      project_definition_guid = lv_guid
      IV_STATUS_PROFILE       = ' '
      is_business_transaction = lv_transaction
    TABLES
      return                  = lt_return.

Once you codes in the following way in a program, it works fine:

CALL FUNCTION 'BAPI_BUS2172_SET_STATUS'
    EXPORTING
      project_definition_guid = lv_guid
*      IV_STATUS_PROFILE       = ' '                " comment out this importing parameter
      is_business_transaction = lv_transaction
    TABLES
      return                  = lt_return.

Using the function modul test, it is not possible to not given the importing parameter. The not filled importing parameters are considered as 'value = space'.  For this BAPI is big difference:

IV_STATUS_PROFILE      not set : no change of status profile.

IV_STATUS_PROFILE      = space : initialize the status profile. => leads to problem

Kind regards,

Zhenbo

Former Member
0 Kudos

Hi Zhenbo,

thanks for this detailed answer. No I understand, why I couldn't test it with se37.

Regards

Christian

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Christian,

We are using the same BAPI for setting the status of a task followed by BAPI_CPROJECTS_COMMIT_WORK' and it works all fine. Check the sample code below:

      DATA: LS_BUSINESS_TRANSACTION TYPE BAPI_TS_BUSINESS_TRANSACTION.

      LS_BUSINESS_TRANSACTION-BUSINESS_TRANSACTION = 'CANCEL'     

     

     CALL FUNCTION 'BAPI_BUS2175_SET_STATUS'
        EXPORTING
          TASK_GUID               = TASKGUID
          IS_BUSINESS_TRANSACTION = LS_BUSINESS_TRANSACTION
        TABLES
          RETURN                  = LT_RETURN.

* check whether the return tabel contains any error entry i.e Return-Type = 'E'


        CALL FUNCTION 'BAPI_CPROJECTS_COMMIT_WORK'
          TABLES
            RETURN = LT_RETURN.

If you are using for Project level, make sure that the project structure is created before going for these BAPI calls.


Former Member
0 Kudos

Hi Sunny,

thanks for your help.

Regards

Christian