on 09-14-2011 10:20 AM
Hello, experts!
How to search records from the main table for a whole tuple?
Main table has a field of type Tuple(multi-valued).
This tuple has several fields.
As a search parameter I have to use whole tuple. Not fields of this tuple.
Is it possible using MDM API?
Hi Vitaly,
Please go though section 5.2.3 for information on Tuples
Hope this helps.
Thanks,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this -
http://help.sap.com/javadocs/MDM71/com/sap/mdm/search/TupleSearch.html
TupleSearch
public TupleSearch(TableId searchTableId,
FieldId[] fieldPath,
TupleRecordId tupleRecordId)Defines a tuple value search for the second level tuple records and beyond.
Parameters:
searchTableId - a search table
fieldPath - a list of field, the first being a field from the search table and sequence fields being the tuple fields down the hierarchy
tupleRecordId - a parent tuple record
http://help.sap.com/javadocs/MDM71/com/sap/mdm/data/commands/RetrieveLimitedTupleValuesCommand.html
getTupleSearch
public TupleSearch getTupleSearch()Returns the search criteria. The search criteria specifies the search table and what to search for.
Returns:
the search criteria
-
setTupleSearch
public void setTupleSearch(TupleSearch tupleSearch)Sets the search criteria (required). The search criteria specifies the search table and what to search for.
Parameters:
tupleSearch - the search criteria
Working with Tuples - http://help.sap.com/saphelp_mdm71/helpdata/en/f9/ff1d5f39c048eaa6e1eb7012004c32/content.htm
Thanks,
Shambhu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your reply, VermaShambhu.
class com.sap.mdm.search.TupleSearch has two constructors:
1) TupleSearch(TableId searchTableId, FieldId[] fieldPath, TupleRecordId tupleRecordId)
Defines a tuple value search for the second level tuple records and beyond.
2) TupleSearch(TableId searchTableId, FieldId fieldId, RecordId recordId)
Defines a tuple value search for the first level tuple records.
I need to search records from the main table which has tuple field. So I need to use the second constructor.
What is RecordId recordId in second constructor?
[ http://help.sap.com/javadocs/MDM71/com/sap/mdm/search/TupleSearch.htm]; says that recordId - a record. What does it mean?
Which recordId shoud I use if I search records from the main table?
I dont have a direct answer to your question but you will have to try out diff options or wait for some Portal expert reply to your question. Please go through the following information if it helps -
MDM tuples are basic, all-purpose data modeling building blocks that are used to structure and store MDM data.
A tuple is a record template that groups a set of related fields into a reusable object. For example, an address tuple might consist of fields such as street, city, state, ZIP and country. Tuples allow you to create nested structures, including deeply nested multi-level structures with a one-to-many relationship at every level.
For background information on tuples, see http://service.sap.com/installmdm71 ® MDM Console Reference Guide ® MDM Tuples.
The relevant APIs are contained in the com.sap.mdm.schema.commands and com.sap.mdm.schema packages.
· A tuple definition describes the structure and properties of the tuple subrecord. In the API, the tuple definition is represented by the TupleDefinitionProperties and TupleDefinitionSchema classes.
· A tuple field can be added to a table definition or to a tuple definition. The tuple field is represented by the TupleFieldPropertiesclass.
· A tuple record is an actual instance of a tuple field.
Tuple records cannot be shared with other records in a table. The lifetime of a tuple record is controlled by the table record to which it belongs. As a result, tuple records cannot exist independently from table records.
The tuple record is represented the by TupleValue and MultiTupleValue interfaces that extend the Mdmvalue.
Retrieving Tuple Values
To retrieve the TupleValue/MultiTupleValue interfaces, use one of the following two methods:
· Record.getFieldValue(tupleFieldId)
Use if the tuple record is part of an original table record that can be obtained using one of the record retrieving commands.
Thanks,
Shambhu.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.