cancel
Showing results for 
Search instead for 
Did you mean: 

MDM new Java API's and WebDynpro

Former Member
0 Kudos

Hi all

I am using MDM Java APIs(new). I also had not worked on MDM4J earlier.

Now the scenario is simple enough:

I have to search the Products table.

I have got the connection, established session , done user authentication and all.

Now the problem is setting the search parameter and constraint, that means i need to add some piece of code after this

Search search = new Search(mainTableId);

I am not able to figure out that.

Moreover when i get the resultset, how I retrieve the specific values (field wise) from it, i mean which methods to use (api).

If there is some reference guide for new API's ,it would be great (the one at service market place is corrupt, MDM 5.5 Java Library Reference Guide)

Any pointers are most welcome

Avinash

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Well I was also trying the same methods...and as I have the data in the form of a result set , it is more of a question of manipulating the result set to achieve the desired results.

Thanks Everyone

Former Member
0 Kudos

Hi,

The Javadoc for the MDM Java API contains a package called com.sap.mdm.examples, where you can find an example of what you are looking for.

Walter

namrata_d
Active Participant
0 Kudos

Hi Avinash,

The field values that are to be retrieved should be mentioned in ResultDefinition.

After the command is executed you can retrieve the value by rs.getRecord(i).getFieldValue(<FieldID>).toString()

For the LookUp flat values it will retrieve the RecordID of that value rather than the value itself. From the RecordID fetch the value using RetrieveRecordsByID command.

Thanks

Namrata

Greg_Austin
Active Participant
0 Kudos

Try going to www.service.sap.com/installMDM there are some examples and tutorials available. For what to put after creating the search look in the MDM API javadocs for SearchConstraint and SearchDimension which are the interfaces you will need. For example to search for all records where a text field is a particular string you would put.

FieldSearchDimension fsd = new FieldSearchDimension(<Field to search ID>);

TextSearchConstraint tsc = new TextSearchConstraint(<String to search for>, TextSearchConstraint.EQUALS);

search.addSearchItem(fsd,tsc);

Hope this helps,

Greg