Professional Documents
Culture Documents
Applies to:
The developer community looking forward to utilize the features provided by MDM 7.1 For more information,
visit the Master Data Management homepage.
Summary
MDM 7.1 has come up with some unique features. In the coming series of documents I am trying to cover all
the basic features of MDM71. I would be putting up a series of documents covering all major aspects of
MDM Transactions using Java APIs. The first document of the series MDM71 Java API-Getting Started
covered how to create a trusted user session with MDM. In this section we will talk about how to retrieve
records from MDM repository. The word Retrieve and Search are technically the same and are used in the
same context. We will also see how to add filters to search and how to handle some of the common MDM
datatypes.
Author:
Nitin Mahajan
Author Bio
Nitin is associated with Infosys Technologies for over 6 years now with a vast experience on
Java/J2EE/Enterprise Portal/Java WebDynpro applications and since last 3 years has been a
vital part of the Infosys Enterprise Portal team mainly working in the java WebDynpro/portal
administration / NWDI tracks. For MDM 7.1 Nitin has been working on the ramp up version
since December 2008 and has attended the majority of ramp up customer sessions conducted by SAP.
Table of Contents
1 Getting a Head Start ....................................................................................... Error! Bookmark not defined.
2 The BASIC functions .......................................................................................................................................4
3 Assumptions ....................................................................................................................................................5
4 Repository Structure ........................................................................................................................................6
5 Retrieve MDM Record .....................................................................................................................................7
5.1 Use Filters in Search.................................................................................................................................8
5.1.1
5.1.2
Text Fields..................................................................................................................................................10
5.2.2
Lookup Fields.............................................................................................................................................10
5.2.3
Tuples ........................................................................................................................................................10
5.2.4
MultiTuple...................................................................................................................................................11
5.2.5
5.2.6
3 Assumptions
Considering the The user id used to create the connection / interaction is created in MDM and in Portal UME.
One should make sure the user id and password are CASE SENSITIVE in MDM, so please ensure this is
taken care of while creating users. We will have following constants that would be required for a MDM
transaction:
MDM SERVER NAME =
SERVER_NAME
DBMS TYPE
ORACLE
DATABASE SERVER
SERVER_NAME
//assuming db on the same server as mdm
USER ID
USER_ID
MDM System object is created on portal and connection test from portal is successful
Assume Portal System Object name mdm71 and system alias name mdm71alias
Trusted connection is setup between MDM and Portal
Follow MDM security guide to setup Trusted Connection
Taking into consideration the connection and session we created in the document MDM71 Java API-Getting
Started, we will use the values and attributes as generated in it. Here is the list of the output from the
document:
Connection Object
connecPool
Server Session Id
srvSessionId
Region Properties
regionProperties
Repository Identifier
repository
repSessionId
-
schema
usrSessionIdAdm
For the examples, we will use Customer Repository with minimum required fields. Our MDM Structure is
following
4 Repository Structure
Tables
Table Name
Table Code
Table Type
Customers
Customers
Main
Countries
Countries
Lookup
Tuples
Tuple Name
Tuple Code
Phone Number
Phone_Numbers
Field Type
Id
Id
AutoId
Business Name
Business_Name
Text
Country
Country
Lookup
Phone Number
Phone_Number
Tuple
Address
Addresses
MultiTuple
Field Code
Field Type
Name
Name
Text
Code
Code
Text
Field
Field
Code
Type
Phone Number
Number
Text
Extension
Extension
Text
Field
Type
Street
Street
Text
ZipCode
Zipcode
Text
Phone Number
Phone_Number
Tuple
Now you can use the records array to process the data as required.
Or if you know the index of the record or if you loop through the records array,
you can use
Record record = recordResultSet.getRecord(int index);
This is how you would prepare the search object. Depending on your requirement, you can set the search
constraint to various types
TextSearchConstraint.CONTAINS
TextSearchConstraint.BOOLEAN_SEARCH_CONSTRAINT
TextSearchConstraint.KEYWORD_SEARCH_CONTRAINT
TextSearchConstraint.ENDS_WITH
In the above piece of code, on the flip side, if your requirement is to search
all customers excluding the ones with business name SAP.
Use the following search constraint
TextSearchConstraint.EXCLUDES
To add multiple values to the search, prepare as many searchconstraints and keep
adding to the search object. It is advised to use SearchGroup if the search
constraints are too high.
If your field type on which you want to to filter the record is a lookup table.
Just use the QualifierSearchDimension intead.
The type of search constraint will change based on the data type and not the
field type.
In the methods discussed till now, we have used the example of main table as the search table. It is not that
you can retrieve only on the main table, you can have a search/retrieve done on the lookup tables also using
the same procedure.
Whenever
you
retrieve
value
from
MDM,
check
it
for
MDMValue
Type
6 Content to follow
The next document, we will talk about how to modify and delete a record / tuple value. MDM71 Java APIModify Delete MDM Records.doc.
Related Content
http://help.sap.com/javadocs/MDM71/current/API/index.html
For more information, visit the Master Data Management homepage.