cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

About Release contract used FM "BBP_PD_CTR_STATUS_CHANGE"

former_member324993
Active Contributor
0 Likes
362

Dear all,

     We need batch release the contract,Now we create a program call FM "BBP_PD_CTR_STATUS_CHANGE",The source code follow as :

   REPORT  Z_CTR6.
data:l_guid type CRMD_ORDERADM_H-GUID,
     it_mess like BBP_PDS_MESSAGES OCCURS 0 WITH HEADER LINE.

select SINGLE guid INTO l_guid from CRMD_ORDERADM_H where Object_ID = '4400000109'
and Object_Type = 'BUS2000113'.
CALL FUNCTION 'BBP_PD_CTR_STATUS_CHANGE'
   EXPORTING
    I_GUID             = l_guid
*    IV_ITEM_GUID       =
     I_ACTIVITY         = 'LDRC'
    I_SAVE_DB          = 'X'
*    I_TEST_RUN         =
   TABLES
     E_MESSAGES         = it_mess
*  CHANGING
*    E_CHANGED          =
           .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
*   WAIT          =
* IMPORTING
*   RETURN        =
          .

But the FM return message ""Release Contract" is not allowed (Purchasing Contract 4400000109)"..

Who can help me?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Likes

If you have workflows for contract, you can use BBP_PD_CTR_STATUS_CHANGE_WF. Send input 1 and the GUID of contract.

But this will override all Approval levels in the contract.

It is better if you call FM BBP_PD_CTR_CHECK to ensure there are no errors on the contract before calling the above FM.

Let me know if this helps.

Sushil.

former_member324993
Active Contributor
0 Likes

Dear Sushil,

    Thank you replay,I check it,Because of the contract release need other logic,SO used FM " BBP_PD_CTR_STATUS_CHANGE_WF"  and  " BBP_PD_CTR_STATUS_CHANGE"  can't released it.