<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: how to load supplier from agreement on Forms in Spend Management Q&amp;A</title>
    <link>https://community.sap.com/t5/spend-management-q-a/how-to-load-supplier-from-agreement-on-forms/qaa-p/11332626#M168964</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I understood correct, you have created a UDO form and pointing it to an MA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you would like to auto populate Vendor info from MA to this from. For this, you can try the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe, here MA is an extension field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import com.sap.odp.api.doccommon.userdefined.UserDefinedVendorSubIbeanIfc;&lt;/P&gt;&lt;P&gt;import com.sap.odp.api.doccommon.userfefined.UserDefinedVendorSubIbeanImpl;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maHome = IBeanHomeLocator.lookup(session, com.sap.eso.api.contracts.ContractIBeanHomeIfc.sHOME_NAME);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maId = doc.getExtensionField(" Put Extension Name here").get().getDsiplayName().toString();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maBean = (ContractIBeanIfc)maHome.findByUniqueDocName(maId);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vendorName = maBean.getVendorRef();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vendorContact = maBean.getContactRef();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(hasValue(vendorName) &amp;amp;&amp;amp; hasValue(vendorContact))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;vendColln = doc.getCollnVendors();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;collnRow = vendColln.create();&lt;/P&gt;&lt;P&gt;collnRow.setVendorObjRef(vendorName);&lt;/P&gt;&lt;P&gt;collnRwo.setContactObjRef(vendorContact);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vendColln.add(collnRow);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Krish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Oct 2015 08:08:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-10-30T08:08:15Z</dc:date>
    <item>
      <title>how to load supplier from agreement on Forms</title>
      <link>https://community.sap.com/t5/spend-management-q-a/how-to-load-supplier-from-agreement-on-forms/qaq-p/11332625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are creating a Form and selecting a Master Agreement from the Header tab.&amp;nbsp; When the MA is created, we want to automatically populate the Supplier from the MA into the Suppliers tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We tried the following code but could not get the Supplier loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vendExtId = IBeanHomeLocator.lookup(session,doc.getVendorRef()).find(doc.getVendorRef()).getExternalId();&lt;/P&gt;&lt;P&gt;vendorBean= (VendorIBeanIfc) IBeanHomeLocator.lookup(session, com.sap.odp.api.doccommon.masterdata.VendorIBeanHomeIfc.sHOME_NAME).findByExternalId(vendExtId);&lt;/P&gt;&lt;P&gt;if (hasValue(vendorBean)){&lt;/P&gt;&lt;P&gt;rColCol=doc.getCollnVendors(); &lt;/P&gt;&lt;P&gt;ven = rColCol.create();&lt;/P&gt;&lt;P&gt;ven.setDisplayName(vendorBean.getDisplayName());&lt;/P&gt;&lt;P&gt;rColCol.add(ven); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see attached screen print for what we are tryign to see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2015 20:55:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/spend-management-q-a/how-to-load-supplier-from-agreement-on-forms/qaq-p/11332625</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-27T20:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to load supplier from agreement on Forms</title>
      <link>https://community.sap.com/t5/spend-management-q-a/how-to-load-supplier-from-agreement-on-forms/qaa-p/11332626#M168964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I understood correct, you have created a UDO form and pointing it to an MA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you would like to auto populate Vendor info from MA to this from. For this, you can try the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe, here MA is an extension field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import com.sap.odp.api.doccommon.userdefined.UserDefinedVendorSubIbeanIfc;&lt;/P&gt;&lt;P&gt;import com.sap.odp.api.doccommon.userfefined.UserDefinedVendorSubIbeanImpl;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maHome = IBeanHomeLocator.lookup(session, com.sap.eso.api.contracts.ContractIBeanHomeIfc.sHOME_NAME);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maId = doc.getExtensionField(" Put Extension Name here").get().getDsiplayName().toString();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maBean = (ContractIBeanIfc)maHome.findByUniqueDocName(maId);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vendorName = maBean.getVendorRef();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vendorContact = maBean.getContactRef();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(hasValue(vendorName) &amp;amp;&amp;amp; hasValue(vendorContact))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;vendColln = doc.getCollnVendors();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;collnRow = vendColln.create();&lt;/P&gt;&lt;P&gt;collnRow.setVendorObjRef(vendorName);&lt;/P&gt;&lt;P&gt;collnRwo.setContactObjRef(vendorContact);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vendColln.add(collnRow);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Krish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2015 08:08:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/spend-management-q-a/how-to-load-supplier-from-agreement-on-forms/qaa-p/11332626#M168964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-30T08:08:15Z</dc:date>
    </item>
  </channel>
</rss>

