cancel
Showing results for 
Search instead for 
Did you mean: 

Java API search options

Former Member
0 Kudos

Hi all,

I want to do search functionality on a repository through Java API but I don't found any documents on than can any one give me documents on that.

I tried to do with keyword search but not getting on which field it is searching and how it is searching.

Thanks

Ninad

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ninad,

try this:


Search search = new Search(tableId);
search.addSearchItem(new FieldSearchDimension(fieldId), new TextSearchConstraint("searchText", TextSearchConstraint.STARTS_WITH));

RetrieveLimitedRecordsCommand cmd = new RetrieveLimitedRecordsCommand(connection);
cmd.setSearch(search);
cmd.setResultDefinition(...);
cmd.setSession(...);
cmd.execute();

Have a look at these examples as well:

https://websmp101.sap-ag.de/~sapidb/011000358700000535912007E

Regards

Roger

Former Member
0 Kudos

Hi Roger,

Thanks a lot for your suggestion but I tried but getting some problems in it is there any help document for the kind of search you have given?

And also for keyword search because in keyword search I don't specify any field so not getting on which field it is searching?

Thanks

Ninad

namrata_d
Active Participant
0 Kudos

Hi Ninad,

In the FieldSearchDimension you specify the FieldID i.e the field on which the search is to be made and then the SearchConstraint on it.

So the RetrieveLimitedRecords Command searches for the all those records on which the SearchDimension criteria is set.

Thanks

Namrata