cancel
Showing results for 
Search instead for 
Did you mean: 

Get the document owner's email id through scripting

Former Member
0 Kudos

Hello,

I am trying to fetch the email ID of the owner of a master agreement. This is how I 'm doing it.

Following is the script :

NewUserAccountIBeanHomeIfc userAccountHome = (NewUserAccountIBeanHomeIfc)IBeanHomeLocator.lookup(session,com.sap.odp.api.usermgmt.masterdata.NewUserAccountIBeanHomeIfc.sHOME_NAME);

userAccountBean = userAccountHome.findByName(doc.getDocumentOwnerUserReference().getDisplayName());

receiver_email = userAccountBean.getEmail();

Now I 'm getting this exception - Error executing script: Sourced file: inline evaluation of: ``import com.sap.odp.api.ibean .*; import com.sap.odp.api.doccommon.masterdata .* . . . '' : null

Looks like nothing is being fetched. Where am I going wrong? Please help. Thanks in advance.sa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Shreya,

You might want to do the following to retrieve the MA owner email id:

import com.sap.odp.api.common.platform.IapiAccountLocator;

ownerRef = doc.getDocumentOwnerUserReference();

owner = IapiAccountLocator.lookup(session, ownerRef);

email = owner.getEmail();   // Print this or use as you want.

Hope this helps!

Regards,

Bindu

Former Member
0 Kudos

Thanks Bindu! That worked!

However can you pin point where was I going wrong? Is there something to do with user account home interface which I read somewhere doesn't exist.

And so whenever I have to get a user account bean, I should use IAPIaccountlocator.

Thanks a lot!

Answers (0)