on 12-22-2015 9:29 AM
Hello Everyone,
I am new to CLM and scripting (beanshell).
I have a requirement for which i have to write script.
To determine the number of suppliers that are present in RFX,
And determine the supplier number and name from the suppliers added in RFX.
Please help me with this.
Thanks in advance,
Sudha
Hi Sudha,
To get list of supplier added in RFx and to display the name of the supplier,use the below code :
import com.sap.odp.api.doccommon.masterdata.VendorIBeanHomeIfc;
import com.sap.odp.api.doccommon.masterdata.VendorIBeanIfc;
vendorColln = doc.getVendorList(); // to get the list of suppliers added in RFx
for(i = 0;i < vendorColln.size();i++) // iterate over the collection
{
member = vendorColln.get(i);
vendorObj = member.getFieldMetadata("VENDOR_REF").get(member);
VendorHome=IBeanHomeLocator.lookup(session,VendorIBeanHomeIfc.sHOME_NAME);
vendorBean=VendorHome.find(vendorObj);
supplierId = vendorBean.getExternalId();
Name = vendorBean.getDisplayName() ;
}
Please know in case of any issues.
Thanks & Regards,
Rajiv Yadav.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sudha,
You can get a list of suppliers using the getVendorList() method. From the vendor list you can retrieve the vendor name and using the VendorIBeanHome class (method: findWhere()) get the Vendor Bean and then the Vendor ID.
Although I haven't tried this code but from the looks of it I guess it will work.
Thanks,
Arijeet
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.