cancel
Showing results for 
Search instead for 
Did you mean: 

Get parent/child relationship records via Java API

Former Member
0 Kudos

Hi,

I have a Products table which consists of fields like Name, Manufacturer, Group etc.

It has a relationship of parent-child to itself, which means a product A may be made-up of product B, C and D (sub-components).

I need to search for product A's subcomponents's records using Java API.

Any help would be much appreciated.

Thanks.

- julius

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Julius,

you can refer to the following links:

[http://help.sap.com/saphelp_mdm550/helpdata/en/45/76bc4ed69b1956e10000000a11466f/frameset.htm]

[http://help.sap.com/saphelp_mdm550/helpdata/en/45/0068570b0c0487e10000000a155369/frameset.htm]

regards,

Krutarth

Former Member
0 Kudos

Hi Julius,

Follow this link to Retrive Relatioships.

http://help.sap.com/javadocs/MDM/SP04/com/sap/mdm/data/commands/RetrieveRelationshipsCommand.html

Plz reward if helpful

Regards,

Neethu Joy

Edited by: Neethu joy on Mar 6, 2008 7:16 AM

Former Member
0 Kudos

Julius,

If your underlying MDM data structure is hierarchical, then you would use HierGroupNode to unpack the parent/child relationships. Here is an example on how to parse the tree structure of a validation group:


public HierGroupNode[] getValidationGroups() {
	HierGroupNode[] groups = null;

	try {
		RetrieveGroupTreeCommand rgtcmd = new RetrieveGroupTreeCommand(
				connections);
		rgtcmd.setSession(sessionId);
		rgtcmd.setGroupType(RetrieveGroupTreeCommand.VALIDATION_GROUP_TYPE);
		rgtcmd.execute();

		HierGroupNode hgn = rgtcmd.getGroupTree();
		groups = hgn.getChildren();
	} catch (final CommandException e) {
		e.printStackTrace();
	}
	return groups;
}

I hope this helps.

Doug