on 06-29-2012 8:38 AM
Hi All,
I am new to Sourcing.
I have a userdefinedbizdoc1 which has a group of approvers attached with it. What I am trying is to add this group to a list but I am unable to do so. It is throwing error "Error executing script: Sourced file: inline evaluation of: ``import java.util.List; import com.sap.eso.api.rfx.RfxDocIBeanIfc; import com . . . '' : null."
Plz help how to get rid of this error.
Here is the code I am using
import java.util.List;
import com.sap.eso.api.rfx.RfxDocIBeanIfc;
import com.sap.odp.api.common.platform.IapiSessionContextIfc;
import com.sap.odp.api.common.types.ObjectReferenceIfc;
import com.sap.odp.api.doccommon.masterdata.InternalCatIBeanIfc;
import com.sap.odp.api.ibean.ExtensionCollectionIfc;
import com.sap.odp.api.ibean.ExtensionCollectionMemberIfc;
import com.sap.odp.api.ibean.ExtensionFieldIfc;
import com.sap.odp.api.ibean.IBeanHomeLocator;
import com.sap.odp.api.ibean.OrderedSubordinateCollectionIfc;
import com.sap.odp.api.usermgmt.masterdata.GroupIBeanIfc;
List listGcl= null;
OrderedSubordinateCollectionIfc rfxCollaboratorCollection=(OrderedSubordinateCollectionIfc) doc.getCollaborators();
ExtensionCollectionIfc commodityCollection=doc.getExtensionCollection("RR_COMMODITY_COL");//gets commodity collection
if (commodityCollection==null||commodityCollection.size()==0)
{
doc.setDocumentDescription("commodityCollection null");//just to check whther working or not
}
for (int i=0;i<commodityCollection.size();i++)
{
ExtensionCollectionMemberIfc commodityCollMember=(ExtensionCollectionMemberIfc)commodityCollection.get(i);//gets every element
ObjectReferenceIfc commodityFromRfx=(ObjectReferenceIfc)commodityCollMember.get("RR_INTERNAL_CAT");//gets object reference
InternalCatIBeanIfc cmdy=(InternalCatIBeanIfc) IBeanHomeLocator.lookup(session,commodityFromRfx).find(commodityFromRfx);
ExtensionFieldIfc gclExtension=cmdy.getExtensionField("RR_GCL");
if (gclExtension.equals(null))
doc.setDocumentDescription("GCL null");
ObjectReferenceIfc groupGcl=(ObjectReferenceIfc) gclExtension.get();//object reference of GCL
if (!groupGcl.isSet())//if gcl is not referenced
doc.setDocumentDescription("groupGcl null");
GroupIBeanIfc groupHomeBean=(GroupIBeanIfc) IBeanHomeLocator.lookup(session,groupGcl).find(groupGcl);//find gcl
doc.setDocumentDescription("groupHomeBean"+groupHomeBean.getDisplayName());
if(!listGcl.contains(groupHomeBean))
listGcl.add(groupHomeBean);
}
I am getting error in last 2 lines. adding is not working. Don't know why.
Hi Kumud,
The null is because you have not instantiated listGcl yet.
Declared:
List listGcl= null;
Used:
if(!listGcl.contains(groupHomeBean))
No instantiation in between.
Regards,
Subhasini
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.