Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to retrieve records having same value using MDM Java API

Hi,

I am using the MDM Java APIs in my WebDynpro component to retrieve the records from the MDM Repository. The Java API version is 5.5.63.60

I have a product table and it has several records with same product name. If I use the 'RetrieveRecordsByValueCommand', I get only one record i.e., the first encountered record that matches the product name. But, I want to retrieve all the records having the same product name.

What is the retrieveCommand that I can use to retrieve all the records with the same value for a given field?

With Regards,

Yuvaraj

Tags:
Former Member
Former Member replied

Look at simple example:

        ResultDefinition rd = new ResultDefinition(tblCEMP);
        rd.setSelectFields(new FieldId[]{tblCEMP.BRANCHES, tblCEMP.FULL_NAME, tblCEMP.MAIL});

        Search srch = new Search(tblCEMP);
        SearchDimension sd = new FieldSearchDimension(tblCEMP.FULL_NAME);
        SearchConstraint sc = new TextSearchConstraint(strSearch, TextSearchConstraint.EQUALS);
        srch.addSearchItem(new SearchParameter(sd, sc));

        RetrieveLimitedRecordsCommand cmd = new RetrieveLimitedRecordsCommand(gate.getPool());
        cmd.setResultDefinition(rd);
        cmd.setSearch(srch);
        cmd.setSession(gate.getUsrSessionId());
        cmd.setPageSize(1);
        cmd.execute();
        cmd.setPageSize(cmd.getSearchTableMatchCount());
        cmd.execute();

        RecordResultSet recs = cmd.getRecords();

tblCEMP and gate it's my own objects not from Java API

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question