on 11-28-2012 5:24 PM
Hi Experts,
Thanks for your time in advance,
Could you please let me know, if anyone worked on setting VLV values through java code. This VLV is a custom extension field. We have another vlv , which is field of custom Collection. so these values we are would like to set through Java code. This java code is in custom jar.
Thanks and Regards,
N.Venkateswararao.
Hello,
Here you have an example to set vlv in one extension field:
import com.sap.odp.api.doccommon.masterdata.ValueListValueIBeanHomeIfc;
import com.sap.odp.api.doccommon.masterdata.ValueListValueIBeanIfc;
.....
//Retrieve Value Type "XXXXX":
valueTypeHome = IBeanHomeLocator.lookup(session,"com.sap.odp.api.doccommon.masterdata.ValueListTypeIBeanHomeImpl");
valueTypeBean = valueTypeHome.findByExternalId("<EXTERNAL_ID_OF_VALUE_TYPE>");
valueBean = valueTypeBean.getCollnValueListValue().get(i); // i = position of value list value (from 0 to N)
//Set value in corresponding field
doc.getExtensionField("<EXTENSION_FIELD>").set(valueBean.getLocalizedObjectReference());
Hopes this help you.
Best regards,
Isaac
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.