cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving GroupID from group Name

Former Member
0 Kudos

Hi,

I need to retrieve a GroupID giving the GroupName or group description.

Can anyone help on the API for this. I could not find any for this.

The groupID is autogenerated one similar to RecordId.

Thanks,

Padmaja

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi padmaja,

is your problem solved ?

if not why dont u try in this way?

The only way to get GroupId is you must know grouptype.There are three types available ,your groupName would be one among them.

see com.sap.mdm.group.GroupTypes - static int DATA_GROUP_TYPE

static int DATA_LOCATION_TYPE

static int VALIDATION_GROUP_TYPE

I guess you are using DATA_GROUP_TYPE , becase in dataManager DATA_GROUP_TYPE , so you can use it;

if not change the type;

once you find out of which type your GroupName belongs , follow as follows;

use RetrieveGroupTreeCommand

1 ) setGroupType(int groupType) // set GroupType

2 ) execute execute() method // run execute method

3 ) GroupNodeId getRootId() // get GroupRootId

if you still face problem, let me know;

Regards,

Rajasekhar K

DeeptiChavare
Active Participant
0 Kudos

Hi Padmaja,

You can use RetrieveGroupTreeCommand to get the groups.

Then use method getGroupTree() method which returns hierarchical structure of group. Then you can use getId() method to get groupNodeID.

Regards,

Deepti

Former Member
0 Kudos

Hi Deepti,

For RetrieveGroupTreeCommand the groupType is mandatory to be set for executing the command.

How can we know the groupType.

Thanks,

Padmaja

paulsauthoff1
Explorer
0 Kudos

Hi Padmaja

Check out the class 'com.sap.mdm.group.GroupTypes'. This gives three static options which cover the type of group you could be looking for.

The types apply to Validation Group, Data Group and Data Location.

If you knwo the name of the group you will probably know which type it is too, so just use the appropropriate static value

Regards

Paul