cancel
Showing results for 
Search instead for 
Did you mean: 

Find the underlying datasource

Former Member
0 Kudos

Hi,

We have installed the SAP Netweaver2004s environemant with

a)Web AS Java

b)Web AS Java + ABAP

Is there anu API or UME API or any programmatic approch form where we can know if the underlying datasource is of what type.

I require this as based on the server configuration my code flow will change.

How this can be done.

Best Regards

Manoj

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Manoj,

Use the UME API, here is a sample code that checks to which datasource a group belongs to, amend it to your needs:


IGroup group = groupFact.getGroup(<group_id>);
String[] datasources = group.getAttribute(IPrincipal.DEFAULT_NAMESPACE, IPrincipal.DATASOURCE); 
if (datasources[0].equals("PRIVATE_DATASOURCE"))
{
    // This is a UME Group
}
else if (datasources[0].equals("R3_DATASOURCE"))
{
   // This is an ABAP Group
}

This code provides you with the data source id. To find out which data source id belongs to UME and which to ABAP user store have a look into your UME configuration file. Find more information on data sources in <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/e7/8f0440a832e369e10000000a155106/frameset.htm">here</a>.

Hope it helps,

Roy

Former Member
0 Kudos

Hi Roy,

The solution looks fine.

But here we have to have a group name to find out the underlying datasource.

Is it possible to get this information without using group name.

I mean getting ti directly form the system usign some api .

Best Regards

Manoj

Former Member
0 Kudos

Hi,

Well, you have to have an IPrincipal object in hand.

Check <a href="https://help.sap.com/javadocs/NW04S/current/se/com/sap/security/api/class-use/IPrincipal.html">here</a> on ways to get it.

Roy