cancel
Showing results for 
Search instead for 
Did you mean: 

Sap sourcing master agreement status update

Former Member
0 Kudos
115

Dear all,

            When I update the master agreement status, it works fine,but the status is blank.

            But when i leave it to the outside,it can show the status.

               Code is as follows:

    ValueListValueIBeanHomeIfc valueListHome = IBeanHomeLocator.lookup(session,doc.getStatusRef());   
   doc.getIBeanHomeIfc().upgradeToEdit(doc);
   ValueListValueIBeanIfc valueList = valueListHome.findUniqueByNameType("Executed Agreement",1);
   doc.setStatusRef(valueList.getLocalizedObjectReference());
   doc.getIBeanHomeIfc().save(doc);
   doc.getIBeanHomeIfc().downgradeToView(doc);

              I don't know what the reason is,please help me ,thank you very much.

Accepted Solutions (0)

Answers (1)

Answers (1)

kushagra_agrawal
Active Participant
0 Kudos

Hi Jin bin,

Presuming that you are writing Document Life cycle Script of MA.

Try the below code and check if it works for you.

import com.sap.odp.api.doccommon.masterdata.ValueListValueIBeanHomeIfc;

valueListHome = IBeanHomeLocator.lookup(session,ValueListValueIBeanHomeIfc.sHOME_NAME); 

   valueList = valueListHome.findUniqueByNameType("Executed Agreement",1);

  

  doc.setStatusRef(valueList.getLocalizedObjectReference());

Hope it helps!

Best,

Kushagra A

Former Member
0 Kudos

Hi kushagra,

I have tried to use the code you recommended,but it still doesn't work.

Anyway, thank you.

best regards

Jinbin Sun