cancel
Showing results for 
Search instead for 
Did you mean: 

Search on Qualified Lookup Table using Java API 2

Former Member
0 Kudos

Hi MDM Gurus.

I'm looking for help on how to search MDM repository using new MDM Java API (Java API 2).

My code works fine for all Qualifier fields but I don't know how to create

SearchDimension and SearchConstraint for searching on NON qualified fields.

Using same code for non qualified filed in Qualified Lookup Table fails with exception:

- unable to find filed

- or incorrect filed type

Thx, marcin

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi marcin,

Tell me if this solution helped you or not.

Do you tried to fetch the value of a flat look up field from a main table or qualified table.

If yes then Can you please give me sample code or some hint regarding this.

When I tried to find the value of a flat look up field from the main table, I am getting the record id.

Regards,

Namrata Mahajan

paras_arora3
Participant
0 Kudos

Namrata,

You need to pass the record(fieldD Id) you get, to the method

"getLookupDisplayValue(fielid)" which is available in com.sap.mdm.data.record

String lookupDisplayValue = record.getLookupDisplayValue(fieldid);

Hope this will help

Paras

Points for helpful answers

Former Member
0 Kudos

Hi Marcin,

try this,

This is to search in the main table based on the Partner id.

Partner id is the Text Field in the main table.

// The main table, hard-coded

TableId mainTableId = new TableId(1);

// Specify the result definition (what to retrieve)

ResultDefinition rd = new ResultDefinition(mainTableId);

rd.addSelectField(Partner_Id);

// select all records

Search srch = new Search(mainTableId);

NumericSearchConstraint constr = new NumericSearchConstraint(<Numeric Search Criteria>,NumericSearchConstraint.EQUALS);

FieldSearchDimension fld_dim = new FieldSearchDimension(Partner_Id);

srch.addSearchItem(fld_dim,constr);

Hope this will help.

Do you know how to retrieve Flat lookUp fields in the main table

Former Member
0 Kudos

Hey can you tell me what is Java API 2?

I tried to find documents on the same...with no luck.

Regards,

Mausam

Former Member
0 Kudos

Hi Mausam,

please refer to new MDM Java API on help.sap.com/javadocs

Unfortunately there is no answer to my problem in javadoc's

Still waiting for some help - hope that I'm not the only one that is trying to use this new MDM Java API.

Regards, marcin

Former Member
0 Kudos

Hi Marcin,

I am looking for some samples to retrieve data from the lookup fields/tables and also i am looking for some samples to convert data between MDM and java types. Could you please help me out with the samples?

I would also appreciate if you could pass me some samples to create/update records using Java API 2.

Thanx, Guru

amolgupta
Active Contributor
0 Kudos

Hi Marcin,

(My request is the same as GURU's)

I am looking for some samples to retrieve data from the lookup fields/tables and also i am looking for some samples to convert data between MDM and java types. Could you please help me out with the samples?

I would also appreciate if you could pass me some samples to create/update records using Java API 2.

Thanx, Amol