Skip to Content

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

Retrive values with a search criteria involving lookup field

Hi,

Say there is a table A, containing field 1, and field2

field1 and field 2 are Lookup[Flat]

My query is like :

select field 1 from A where field2 = "xyz"

i used the following:

FieldId fieldsId = repositorySchema.getField(table , field1).getId();

//Create the result definition for the search table

ResultDefinition rd = new ResultDefinition(ptTableId);

rd.addSelectField(fieldsId);

FieldId relName = repositorySchema.getField(table,field2).getId();

FieldSearchDimension fieldSearchDimension = new FieldSearchDimension(relName );

TextSearchConstraint textSearchConstraint =

new TextSearchConstraint("xyz", TextSearchConstraint.EQUALS);

Search search = new Search(ptTableId);

search.addSearchItem(fieldSearchDimension,textSearchConstraint);

I guess it fails since field2 type is LookupFlat and not text ???

Any help would be great.

Thanks,

Gayatri

Edited by: Gayatri Keshkamat on Sep 11, 2008 10:02 AM

Edited by: Gayatri Keshkamat on Sep 11, 2008 11:17 AM

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