cancel
Showing results for 
Search instead for 
Did you mean: 

SQL-Statement when using entry references

Former Member
0 Kudos

Hi,

I have created a sample entry type MX_TEST, which has an attribute MX_TEST_PERSONREFERENCE that links the entry type to an MX_PERSON object. When I enter an MX_TEST object, I can browser through all the person objects and select one.

However, I would like to limit the amount of person objects being displayed by defining a SQL statement in the attribute definition of MX_TEST_PERSONREFERENCE. Does anybody have a sample SQL statement that would return some MX_PERSON references? I have not found any information what that SQL statement needs to return and returng only the MSKEY doesn't seem to work.

In a next step I would like the SQL statement to be dependent on the current user. Is there a way to make the SQL statement user dependent e.g. by using a %MSKEY% variable in the SQL statement?

Thanks for you help in advance!

Best regards

Holger

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Holger,

Is this limit in SQL in general or in the NW IDM Interface?

You can use the built in value %ADMINMSKEY% which holds the MSKEY of the logged in user.

The following links might help as well:

http://help.sap.com/saphelp_nwidmic71/en/using_functions/internal_functions/dse_ugetapprovers.htm

/people/community.user/blog/2008/08/18/dynamic-resolution-of-approver-and-approvee-in-workflows

Cheers,

Matt

Former Member
0 Kudos

Hi Matt,

thanks a lot, that was a very useful link and answered the second part of my question.

So I'm still looking for a sample SQL statement for a custom attribute, that shows how I can retrieve entry references?

To give an example: my MX_TEST entry type might have a cost location associated. When assigning a MX_PERSON object to MX_TEST, I want the dialog box to show only persons that have the same cost location as the MX_TEST object.

Best regards

Holger

Former Member
0 Kudos

.

Edited by: Holger Flocken on Aug 24, 2009 5:28 PM

Former Member
0 Kudos

Ok, so let me make sure I understand you.

You want a query that will show all users in the same cost center as the logged in user for a specific entrytype?

Let me know if this is right.

Former Member
0 Kudos

Yes, thats right. But in the first step I would be happy to see a SELECT statement that fetches all users.