Java API: Limiting search to a specific set of records ids?

Hello.
I'm trying to find a way to do the following: run a search (a pretty simple search, just check for a specific value in a specific field), but instead of running the search on an entire table I want to limit it to a specific set of record-ids, the point being that I know which record-ids I want to search on (I'm getting them from a listener event) and I'd like to make the search more effective.
Any ideas?
Thanks,
Alon

Alon,
Are you on SP6? If so, have you tried the [RetrieveRecordsByIdCommand|http://help.sap.com/javadocs/MDM/SP06/com/sap/mdm/data/commands/RetrieveRecordsByIdCommand.html]?
Regards,
Doug

Similar Messages

  • Java API: Parallel Search limit per CatalogData instance (MDM4J)?

    MDM4J (legacy API) Experts,
    Have you ever run into a limit on the number of Searches than can be performed in parallel, using the same MDM session (i.e. one CatalogData instance)? 
    We've been consistently getting an error at > 60 searches.
    The maxConnection parameter in the Login() method doesn't appear to help - set it to 100, and we still top out at 60.
    If you've found a way to increase this threshold, I'm very interested in the how-to!
    Cheers,
    ...Dee

    Hi Walter,
    thanks for the info.
    I guess christmas is not the good time to work on serious code
    In fact after going thro' the API i was able to figure out the code to write it. Just so that i would be helpful to others i am putting it here..
    this link will give you a good understanding of how to get the Qualifiers.
    http://help.sap.com/saphelp%5Fmdm550/helpdata/en/46/2b62d0f2b54f07e10000000a114a6b/content.htm
    Read the brief explaination at the end after the block diagram, it will help save you lots of time
               RetrieveRecordsByIdCommand recordCommand = new RetrieveRecordsByIdCommand(connection);
               recordCommand.setSession(sessionId);
               recordCommand.addId(recordId);
               recordCommand.execute();
               RecordResultSet rs = recordCommand.getRecords();
               Record rec = rs.getRecord(0);
               QualifiedLookupValue qlv = (QualifiedLookupValue)rec.getFieldValue(field);
               QualifiedLinkValue[] links = qlv.getQualifiedLinks();
    hope it helps others.
    Cheers
    Kiran

  • Issue with ENEQuery java api and searching terms with accented characters

    Hi,
    we are using ENEQuery to query the mdex engine. When search terms contain accented characters (like á,í etc), even though the terms are decoded (using java.net.URLDecoder), the term gets send to dgraph is encoded. for e.g a search for "sofá", from the dgraph logs "sof%c3%a1" and fetch in 0 results
    ENEQuery query = new ENEQuery();
    final ERecSearchList searches = new ERecSearchList();
    final ERecSearch eRecSearch = new ERecSearch("search interface name", "term");
    searches.add(eRecSearch);
    query.setNavERecSearches(searches);
    Any suggestions?
    Thanks

    Hi,
    Does your indexed data (which you hope to match) contain "sofá" or "sofa" (no diacritic)? If the latter, and in-general, you may benefit from the dgidx flag --diacritic-folding* as described in documentation "Mapping accented characters to unaccented characters".  If you are running the latest version, this is all that should be required to generate a match.
    Best
    Brett

  • How to create Smart Folder that limits search to a specific folder or drive

    I've been playing with Smart Folders in Leopard 10.5.5. I would like to create a smart folder that limit the search to only a specific folder where I keep all of my work related files. I cannot figure a way how to do this.
    Any suggestions?
    Thanks.
    Bud James

    1.) Performed Archive and Install. This did not correct the problem.
    2.) Performed clean install to new hard drive. This corrected the problem.
    3.) Performed a user migration (to the fresh new OS and new HD) using the migration utility and the problem returned.
    So it seems pretty clear that there is something related to my user identity that is causing the problem. I called Apple tech support but they were not able to resolve the problem.
    Sure, I can just create a new user and spend the next week or so reinstalling a bunch of software...but certainly based on the description of the problem (and the trouble shooting that I have already performed) someone at Apple should be able to pinpoint what files I need to delete or replace to correct this problem.

  • MDM 5.5 SP04 Java API and Web Service Documentation

    Is there documentation available that reflects the SP04 changes to the Java API, and the web services that are now available?
    As of this morning, service marketplace contained spotty SP04 docs.
    Thanks in advance,
    Mike

    Mike,
    A cookbook would be wonderful (I think our developers would throw a party)!
    An updated object model (as a preface to the user guide) for the legacy API (MDM4J.jar) AND the new "rebranded" API (mdm-*.jar) would also work.
    I've been reduced to comparing the SP3 & SP4 javadocs
    One fun approach that appears to be working for us, is to model each process using the DataManager, and try to duplicate that exactly via the corresponding API objects (e.g. the simple Connect-Find Table-Search Table-View Result Set-View Record-CheckOut/Upsert/Validate/CheckIn dance).  New features in the DataManager reveal themselves a little more readily
    Good luck,
    ...Dee

  • Trigger validations MDM JAVA API

    Hi all,
    I got an issue trying to invoke the validations in the MDM Web Dynpro using the JAVA API; first of al I m creating the record before the user can edit it; in that first moment, the record is checked out and the validations are not executed, that is right, but later, when the user is editing the record, we want to force the user to type all the information using only a specific event (Save button) but even if the record is correct, the validations messages are still showing in the user interface.
    try {
        ModifyRecordCommand cmd = new ModifyRecordCommand(connectionPool);
        cmd.setRecord(material);
        cmd.setSession(usrSessionIdAdm);
        cmd.execute();
    } catch (ValidationException e) {
        RetrieveValidationsCommand valComm = new RetrieveValidationsCommand(connectionPool);
        valComm.setSession(usrSessionIdAdm);
        valComm.setTupleDefinitionId(tdIdTuple);
        valComm.execute();
        ValidationPropertiesResult valResult = valComm.getValidationPropertiesResult();
        ValidationProperties[] valProp = valResult.getValidations();
    Any idea about how to do it?
    Thank you!
    Claudia
    Edited by: Claudia Gómez on Mar 6, 2012 7:24 PM

    HI,
    are you using MDM Webdynpro component?
    you can call validation via the item detail interface,  no need to call via this command.
    Best regards,
    John

  • Intermedia Java API ?

    Does Intermedia provide a Java API to search for database data or documents from a Java client, something similar to what iFS provide ?
    The only Java API I could find was used for media files (audio, image, video).
    Thanks,
    Franck.

    Sorry, old email address.
    [email protected]

  • How to search with multiple constraints in the new java API?

    I'm having a problem using the new MDM API to do searches with multiple constraints.  Here are the classes I'm trying to use, and the scenario I'm trying to implement:
    Classes:
    SearchItem: Interface
    SearchGroup: implements SearchItem, empty constructor,
                 addSearchItem (requires SearchDimension and SearchConstraint, or just a SearchItem),
                 setComparisonOperator
    SearchParameter: implements SearchItem, constructor requires SearchDimension and SearchConstraint objects
    Search: extends SearchGroup, constructor requires TableId object
    RetrieveLimitedRecordsCommand: setSearch method requires Search object
    FieldDimension: constructor requires FieldId object or FieldIds[] fieldPath
    TextSearchConstraint: constructor requires string value and int comparisonOperator(enum)
    BooleanSearchConstraint: constructor requires boolean value
    Scenario:
    Okay, so say we have a main table, Products.  We want to search the table for the following:
    field IsActive = true
    field ProductColor = red or blue or green
    So the question is how to build this search with the above classes?  Everything I've tried so far results in the following error:
    Exception in thread "main" java.lang.UnsupportedOperationException: Search group nesting is currently not supported.
         at com.sap.mdm.search.SearchGroup.addSearchItem(Unknown Source)
    I can do just the ProductColor search like this:
    Search mySearch = new Search(<Products TableId>);
    mySearch.setComparisonOperator(Search.OR_OPERATOR);
    FieldDimension myColorFieldDim = new FieldDimension(<ProductColor FieldId>);
    TextSearchConstraint myTextConRed = new TextSearchConstraint("red",TextSearchConstraint.EQUALS);
    TextSearchConstraint myTextConBlue = new TextSearchConstraint("blue",TextSearchConstraint.EQUALS);
    TextSearchConstraint myTextConGreen = new TextSearchConstraint("green",TextSearchConstraint.EQUALS);
    mySearch.addSearchItem(myColorFieldDim,myTextConRed);
    mySearch.addSearchItem(myColorFieldDim,myTextConBlue);
    mySearch.addSearchItem(myColorFieldDim,myTextConGreen);
    the question is how do I add the AND of the BooleanSearchConstraint?
    FieldDimension myActiveFieldDim = new FieldDimension(<IsActive FieldId>);
    BooleanSearchConstraint myBoolCon = new BooleanSearchConstraint(true);
    I can't just add it to mySearch because mySearch is using OR operator, so it would return ALL of the Products records that match IsActive = true.  I tried creating a higher level Search object like this:
    Search topSearch = new Search(<Products TableId>);
    topSearch.setComparisonOperator(Search.AND_OPERATOR);
    topSearch.addSearchItem(mySearch);
    topSearch.addSearchItem(myActiveFieldDim,myBoolCon);
    But when I do this I get the above "Search group nesting is currently not supported" error.  Does that mean this kind of search cannot be done with the new MDM API?

    I'm actually testing a pre-release of SP05 right now, and it still is not functional.  The best that can be done is to use a PickListSearchConstraint to act as an OR within a field.  But PickList is limited to lookup Id values, text attribute values, numeric attribute values and coupled attribute values.  It works for me in some cases where I have lookup Id values, but not in other cases where the users want to search on multiple text values within a single field.

  • Named Searches and Java API

    Hi All,
    Does anyone know if its possible to execute Named Searches using the Java API?  If so, how would you set up that call?
    Best Regards,
    Mark

    Hello Mark,
                     SAP does provide with some methods related to Named Searches just have a look at these links
    1. <a href="https://help.sap.com/javadocs/MDM/current/com/sap/mdm/search/SearchDimension.html#NAMED_SEARCH">Named search</a>
    2. <a href="https://help.sap.com/javadocs/MDM/current/com/sap/mdm/security/AccessPermission.html#NAMED_SEARCH_OBJECT">Named Search Object</a>
    3. <a href="https://help.sap.com/javadocs/MDM/current/com/sap/mdm/search/NamedSearchSearchDimension.html#NAMED_SEARCH_SEARCH_DIMENSION">Named Search Search Dimension</a>
    I hope this solves ur problem.
    Regards Dollar Man

  • Boolean Search Constraint in new Java API doesn't work for value of false

    I'm developing an application that interfaces with MDM via the new Java API.  We're on MDM version 5.5 SP 4 and have the latest patches installed.  I can do searches fine on the repository, but have run into one problem with the Boolean Search Constraint.  I have a set of records in the main table that have several boolean fields.  I've discovered that when searching these records using a Boolean Search Constraint on any of the fields, I'm always receiving records that match the boolean value of true.  This is even when I specify the Boolean Search Constraint value as false.  Is anybody else seeing this problem?

    It's a bug in MDM 5.5 SP04.  The fix is in MDM 5.5 SP05.

  • Keyword Search using the SOUNDS_LIKE modifier, Java API

    Hello guys:
    Does anyone have a piece of code that shows how can I do a search, using the keyword and the SOUNDS_LIKE mod, like on the Data Manager?
    I've seen the blog "Performing Free Form Searches with MDM Java API" but I'm afraid this doesn't apply (it's about free-form, as the name says)
    Thanks!
    Alejandro

    Hi Alejandro,
    maybe this piece of code helps you a bit. The most important is the static attribute SOUNDS_LIKE of the TextSearchConstraint class.
    Also try to find the MDM Java Example files @ service.sap.com/installMDM . There is a complete introduction on how to search against an MDM repository which is very useful.
              // assumption:
              // you have connected to some repository which contains a field "Material Number"
              // with a session and you have already read the MainTable properties to identify
              // the MainTableID, as well as some fields yo want to read.          
              // set search conditions
              Search search = new Search(<yourMainTableId>);
              String fieldname = "Material Number";
              ResultDefinition rd = new ResultDefinition(<yourMainTableId>);;
              FieldId field = <someFieldFromYourRepository>;
              rd.add(field);
              // add some additional fields you want to select here ...
              FieldSearchDimension searchDimension = new FieldSearchDimension(field);
              TextSearchConstraint searchString =     new TextSearchConstraint(materialNumber, TextSearchConstraint.SOUNDS_LIKE);
              search.addSearchItem(searchDimension, searchString);
              RetrieveLimitedRecordsCommand limitingCommand = new RetrieveLimitedRecordsCommand(<yourConnection>);
              limitingCommand.setSession(<yourSession>);
              limitingCommand.setResultDefinition(rd);
              limitingCommand.setSearch(search);
              limitingCommand.setPageSize(10);
              try {
                   limitingCommand.execute();
                   RecordResultSet rs = limitingCommand.getRecords();
              catch(Exception e){
                   e.printStackTrace();
    If you need more help, let me know
    Best regards,
    Martin

  • MDM java api search on Main table

    Hi All,
    I am developing MDM Web dynpro custom application using MDM java API 2. I am having difficulty while searching on main table by date field. The fields type in MDM as u201CTime Stampu201D how I make my search constraints. Please point me if there is any tutorial or sample code.
    Thanks
    John.

    Hi John,
    Try using the following code snippet.
    TableId tableId = schema.getTable("Products").getId();
    FieldId fieldId = schema.getField("Products", "Update_Date").getId();
    FieldSearchDimension searchDimension = new FieldSearchDimension(fieldId);
    Calendar cal = Calendar.getInstance();
    cal.set(2009, 11, 24);
    DateTimeSearchConstraint dateConstraint = new DateTimeSearchConstraint(cal, DateTimeSearchConstraint.GREATER_THAN);
    Search search = new Search(tableId);
    search.addSearchItem(searchDimension, dateConstraint);
    Here "Products" is the name of the table on which the search is done. "Update_Date" is a field of type Timestamp. I've hard-coded the date currently. You can use the various Date constructors to set the date dynamically.
    Regards,
    Anil Madhavan

  • Financial Analytics - limiting load to specific set of books

    Hi all,
    we are running POC for Financial Analytics BI Apps 7.9.6 and we are limiting load into OBAW tables to specific set of books from source EBS (using SET_OF_BOOKS_ID_LIST and $$FILTER_BY_SET_OF_BOOKS_ID DAC parameters) - I was a litlle bit digging in Informatica mappings definition and suprisingly found, that those parameters are just used for load of some fact tables (e.g. W_GL_BALANCE_F etc... ), but is not used to load corresponding dimension tables - like W_LEDGER_D or W_GL_ACCOUNT_D or W_GL_GROUP_ACCOUNT_D - which I would expect to be filtered by specified set of books as well - does anybody know, what tables are filtered by those parameters and what is the reason for not restricting all corresponding tables ?
    Thanks very much for your responses
    Michal Zima

    Hi Michal,
    I think you're saying that you noticed that the mappings/mapplets that load some of the tables (W_GL_ACCOUNT_D or W_GL_BALANCE_F, etc) are not using any logic to filter by your "set of books id list."
    Have you checked the mappings that load the staging and temp tables?
    For example: W_GL_BALANCE_F_TMP, W_GL_BALANCE_FS
    The reason you're not seeing the "set of books id list" might be that the logic was applied to one of the staging or temp tables (a source for the _f table). Thus it would be redundant to re-apply this logic.
    For example:
    Notice that SIL_GLBalanceFact uses W_GL_BALANCE_FS as a source table (and loads the W_GL_BALANCE_F table).
    But, SDE_ORA_GLBalanceFact is the mapping that loads the W_GL_BALANCE_FS table. The logic for "set of books id list" is included in this mapping (or actually, mapplet).
    Hope this helps!
    Thanks,
    Austin
    Edited by: Austin W on Nov 3, 2009 6:58 AM

  • EWS JAVA API 1.2 - Setting Meeting Organizer

    Hi,
    I am evaluating EWS java API ver 1.2 for a use case where we could save an appointment directly to the calendar of an organizer.
    Use Case:
    1. An appointment is created
    2. Appointment is sent from a generic mailbox (Service Account)
    3. Auto update the appointment in the organizer's calndar.
    In my case, the mailbox is not the organizer of the meeting and i should have the capability to set the organizer of a meeting to any person i would want to. Currently, i do not see this capability in the API and the organizer is documented as a read-only
    property.
    Could you please suggest on the following:
    1. How can my use case be implemented with current state of the API
    2. Is there a hook where i can customize the API to implement my use case
    3. Is the use case supported in the .Net version of the API

    >>I am using EWS JAVA API 1.2 to connect to Exchange 2007 SP3
    In your request you have set the server version to Exchange2010 eg
    ><t:RequestServerVersion Version="Exchange2010_SP2" /></soap:Header><soap:Body><m:GetFolder>
    So the server is reporting
    >>The specified server version is invalid.
    Which is correct for Exchange 2007 you need to set the server version to
    ><t:RequestServerVersion Version="Exchange2007_SP1" />
    (there are no EWS schema updates in 2007 SP2 or SP2 so this didn't change)
    Cheers
    Glen

  • Create Named Search with Java API

    Hi,
    is it possible to create or modify a named search with the Java API?
    Best regards,
    Roman

    Hi Olof,
    You can use the below code for searching a value in lookup table:
                   ResultDefinition objResultDefinition = new ResultDefinition(Lookup Table Id);
                   objResultDefinition.addSelectField(Lookup Field ID);
                   StringValue [] objStringValue = new StringValue[1];
                   objStringValue[0] = new StringValue("Value to search");
                   RetrieveRecordsByValueCommand objRetrieveRecordsByValueCommand = new RetrieveRecordsByValueCommand(objConnectionAccessor);
                   objRetrieveRecordsByValueCommand.setSession(strUserSessionID);
                   objRetrieveRecordsByValueCommand.setResultDefinition(objResultDefinition);
                   objRetrieveRecordsByValueCommand.setFieldId(lookup field id);
                   objRetrieveRecordsByValueCommand.setFieldValues(objStringValue);
                   objRetrieveRecordsByValueCommand.execute();
                   RecordResultSet objRecordResultSet = objRetrieveRecordsByValueCommand.getRecords();
    Now using the objRecordResultset in a loop you can get the record id by calling the getRecord(i).getId() method.
    Hope this helps!!
    Cheers,
    Arafat

Maybe you are looking for

  • How to capture SOAP fault when using "Do not use SOAP envelope" parameter

    Hi, we have a synchronous  RFC -> XI -> Web Service scenario. The Web Service requires some custom SOAP header elements for user authorization which forced us create the entire SOAP message in a message mapping and to set the "Do not use SOAP envelop

  • Text header in sapscript

    Dear all, I try to insert text object VBBK, ID "0002" for instance into my SAPscript form. I've succeed to do it for a given sales order (using include in SAPscript) but since the text name = my sales order, I'll find it in every sales orders. While

  • Are the photos in the file 'iphoto library' duplicates of whats already in the finder? Also what would happen if i were to delete it?

    So i found this iphoto library file and its a solid 10gb large, yet i still have all my photos seperate in my finder. I need to free up some space and i was wondering if i could delete this file without losing all my photos.

  • How to register .xsql as a XSQLservlet class?

    Hi, I run Sambar (www.sambar.com) as a webserver and servlet engine with an Oracle 8i (v8.1.5) database on Windows98. Also, jdk1.3 is installed. I have downloaded the Oracle XML software (XSU12 and xsqlservlet_v0_9_8_6) and installed both. OracleXML

  • Problems after installing ios 6

    I recently downloaded and installed IOS 6. There are several issues as follows: a) Adjustments is frozen. I got here in order to synchonize my Facebook ID and it is now frozen. b) Apps are not being updated. I have now 8 Apps that are supposedly bein