cancel
Showing results for 
Search instead for 
Did you mean: 

Change version is not getting created for SRM contract using BAPI

dipak_khatavkar
Participant
0 Kudos


Hi Team,

Change version is not getting created after updation of SRM contract. I have used below BAPI to updated contract price and MPN.

BBP_PROCDOC_GET_CHANGE_VERSION

BBP_PD_CTR_GETDETAIL

BBP_PD_CTR_UPDATE

BAPI_TRANSACTION_COMMIT

fields are getting updating in BBP_PD and SRM portal as well but change version is not getting created.

Please can you help us to resolve this issue.

Thanks in advance

Dipak

Accepted Solutions (0)

Answers (3)

Answers (3)

dipak_khatavkar
Participant
0 Kudos

Issue is resolved now..

After contract SAVE and Commit BAPI..need to call release contract code...

now change version is getting created.

       TRY.

*    Instance of ctr to release

*      lv_o_pdo_ctr

            lo_ctr_adv_instance = /sapsrm/cl_pdo_factory_ctr_adv=>get_instance( iv_header_guid = ls_upd_header-guid

           iv_mode        = 'EDIT' ).      " 'EDIT'

*    release ctr

            lo_message_handler = NEW /sapsrm/cl_pdo_msg( ).

            lo_ctr_adv_instance->/sapsrm/if_pdo_bo_ctr~release( CHANGING co_message_handler = lo_message_handler ).

*

*    Read messages

            CLEAR lt_messages.

            lo_message_handler->get_messages( IMPORTING et_messages = lt_messages ).

*

          CATCH cx_root INTO lo_exception.

*     ERROR!

        ENDTRY.

        CALL FUNCTION 'BBP_PROCDOC_RESET_BUFFER'.

        COMMIT WORK.

former_member190689
Contributor
0 Kudos

Hi Dipak ,

Have you done any custom code in order to update the contract changes on the same version rather than creating a new version . I am asking this because many times when change version is created for a contract then it gives problem while releasing the contract and gives error . We had this problem and sap suggested the above mentioned idea in order to release the contract without error . Moreover  we used to delete the change version and then again make some changes in the contract and then release it without saving . Please get it checked with the help of a abaper .

BR

Gaurav

dipak_khatavkar
Participant
0 Kudos

Thanks Laurent and Gaurav for reply

Yes...i am using BAPI which is mentioned above to update the contract. first i am checking active or change version of the contract and based on that i am creating change version suing update BAPI.

Thanks

dipak_khatavkar
Participant
0 Kudos

Appreciate your help....

Thanks

Dipak..

laurent_burtaire
Active Contributor
0 Kudos

Hello,

which WF do you use? Application-Controlled or Process-Controlled Workflow?

Regards.

Laurent.

dipak_khatavkar
Participant
0 Kudos

Hi Laurent,

I am ABAP'er...actully i dont have idea about the SRM worfklow stratergy.

Thanks

laurent_burtaire
Active Contributor
0 Kudos

Hello,

check blog below if it can help:

Update PO using BBP_PD_PO_UPDATE and trigger Process-Controlled Workflow

This is for PO, but process should be the same for contracts.

Regards.

Laurent.