on 2013 Jun 19 2:48 PM
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?
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.