Skip to Content

How to write script that will add template that is inside Event terms template of document setup into an Rfx by default when we create Rfx.

The template should be added into Event terms inside Suppliers tab of an Rfx.

Kindly tell us how to accomplish this in Sourcing using script .Any suggestion would be helpful.

first i need to get reference of event terms template library–Home reference

then get the reference of template which i have created.i.e test template.

then query the feild which are required i.e display name and terms text.

set it inside Rfx supplier tab event terms feild by default whenver i create Rfx.

So when i create Rfx i want template from Event terms template library to be default entry inside Rfx .there should be display name and terms text defaultly present in Event terms feild.Kindly look to the code

import com.sap.odp.api.common.log.Logger;
import java.io.*;
import com.sap.odp.api.common.exception.ApplicationException;
import java.sql.SQLException;
import com.sap.odp.api.common.exception.ChainedException;
import com.sap.odp.api.common.log.LogMessageIfc;
import com.sap.odp.api.common.platform.IapiSessionContextIfc;
import com.sap.odp.api.common.types.ObjectReferenceIfc;
import com.sap.odp.api.ibean.IBeanIfc;
import com.sap.odp.common.db.NoConnectionException;

final String CLASS_NAME = “RFx”;
/*

LogMessageIfc log = (LogMessageIfc)Logger.createLogMessage(session);
log(msg)
{
log.setLogMessage(CLASS_NAME + msg);
Logger.info(log);
}
log.setMethod(CLASS_NAME);
logMsg = Logger.createLogMessage(session);
logMsg.setLogMessage(“***START QUERYING THE DATABASE***”);
Logger.info(logMsg);
ApplicationException ae = new ApplicationException(session);

localIapiGenerationService = new IapiGenerationService(session);
//EventTermsTemplate = IBeanHomeLocator.lookup(session,TermsIBeanIfc.sPROPID_DISPLAY_NAME);
EventTermsTemplate = IBeanHomeLocator.lookup(session,TermsIBeanIfc);

sqlFilter = “DISPLAY_NAME = ‘TEST TEMPLATE'”;

localList =EventTermsTemplate.findWhere(sqlFilter);
if(hasValue(localList)) {
localListSize = localList.size();
localTemplateEvent = (TermsIBeanIfc)localList.get(0);
EventObjRef=localTemplateEvent.getObjectReference();

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply