HI Saloni,
Below is one of the approach through which you can mass update the Name of the Contract Documents in MA depending upon your requirement:
First you need to write an import Lifecycle Event Script which will target “Master Agreement” class and Target "Process Row".
Write the below code:
import com.sap.eso.api.doccommon.doc.contract.ContractDocumentIBeanHomeIfc;
import com.sap.odp.api.ibean.IBeanHomeLocator;
import com.sap.eso.api.doccommon.doc.contract.ContractDocumentIBeanIfc;
newCDName = import_record.getField(1);// It will fetch the new CD Name from the workbook which will be imported.
ContractCOll=doc.getContractDocuments();
contractBean=ContractCOll.get(0);// It is getting the first CD from the list of CDs available. Code can be changed according to the requirement and which CD name has to be changed.
beanObRef=contractBean.getObjectReference();
contractHome=IBeanHomeLocator.lookup(session,ContractDocumentIBeanHomeIfc.sHOME_NAME);
specificBean=contractHome.find(beanObRef);
contractHome.upgradeToEdit(specificBean);
specificBean.setDisplayName(newCDName);
contractHome.save(specificBean);
contractHome.downgradeToView(specificBean);
Prepare the workbook with below 2 fields:
Where
UNIQUE_DOC_NAME is the Document ID of the MA whose CD name has to be changed
NEW_DOC_NAME is the New Contract Document Name
Import the workbook via Enterprise.
Hope it helps!
Regrads,
Kushagra A