on 10-27-2015 8:55 PM
Hi Experts,
We are creating a Form and selecting a Master Agreement from the Header tab. When the MA is created, we want to automatically populate the Supplier from the MA into the Suppliers tab.
We tried the following code but could not get the Supplier loaded.
vendExtId = IBeanHomeLocator.lookup(session,doc.getVendorRef()).find(doc.getVendorRef()).getExternalId();
vendorBean= (VendorIBeanIfc) IBeanHomeLocator.lookup(session, com.sap.odp.api.doccommon.masterdata.VendorIBeanHomeIfc.sHOME_NAME).findByExternalId(vendExtId);
if (hasValue(vendorBean)){
rColCol=doc.getCollnVendors();
ven = rColCol.create();
ven.setDisplayName(vendorBean.getDisplayName());
rColCol.add(ven);
Please see attached screen print for what we are tryign to see.
Thank you!
Phil
Hi Phil,
If I understood correct, you have created a UDO form and pointing it to an MA.
And you would like to auto populate Vendor info from MA to this from. For this, you can try the following code:
I believe, here MA is an extension field.
import com.sap.odp.api.doccommon.userdefined.UserDefinedVendorSubIbeanIfc;
import com.sap.odp.api.doccommon.userfefined.UserDefinedVendorSubIbeanImpl;
maHome = IBeanHomeLocator.lookup(session, com.sap.eso.api.contracts.ContractIBeanHomeIfc.sHOME_NAME);
maId = doc.getExtensionField(" Put Extension Name here").get().getDsiplayName().toString();
maBean = (ContractIBeanIfc)maHome.findByUniqueDocName(maId);
vendorName = maBean.getVendorRef();
vendorContact = maBean.getContactRef();
if(hasValue(vendorName) && hasValue(vendorContact))
{
vendColln = doc.getCollnVendors();
collnRow = vendColln.create();
collnRow.setVendorObjRef(vendorName);
collnRwo.setContactObjRef(vendorContact);
vendColln.add(collnRow);
}
Hope this would help you.
Thanks
Krish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.