Main Tables reference querry

Hi,
I am working on a respositry having two main tables. My question is:
If a repository has 2 main tables, with the 2nd being referred to by the 1st with a u201CLookup Mainu201D, if data changes in the 2nd main table,  does that flag the record(s) in the 1st main table as having been u201Cchangedu201D?
So u2026if a syndication was set up off of the 1st main table, will a record from there get syndicated automatically (if the import server and port has been configured to import on any change in the record) if the Lookup Main reference changed?
Regards,
Indraveer

Hey,
Any changes in Lookup table will not trigger syndication in Main table since the main table only refers to the lookup table via a pointer. A record is syndicated if this pointer is changed , in case of Main table looking into Look-up table, pointer is not changed, only the record in lookup table is changed (pointer of the lookup table is changed ofcourse, so it will trigger syndication of lookup table).
So in your case, the answer would be No.
Alternative approach would be to use Java API for this, you can read the event of lookup table syndication and trigger main table record for it.
We had a similar requirement and had to follow this path.
Thanks
Aamir

Similar Messages

  • How to map lookup main table field in another main table using MDM 7.1?

    We created a new SAP MDM 7.1 repository with multiple main tables.  The first main table is called ProductMaster table which contains Products information.  The ProductCode is the primary key and the only display field for the table during data loading process. The second main table is ProductByRegion table which has a main table lookup field ProductCode and a RegionId field.  These two fields (ProductCode and RegionId) combine as the PK for this main table.  Both main tables have key mapping enabled. 
    I was able to load ProductMaster table using Import Manager.  But Iu2019m having trouble to load data into ProductByRegion table using MDM Import Manager.  Although I have met all the 5 requirements below (excerpted from MDM Import Manager Reference Guide P.222), the ProductCode wonu2019t show up on the destination value pane.  If I mapped all productCode to NULL field, ProductCode wonu2019t load.  If I u2018Addu2019 all ProductCode to Destination Value pane, the Import Manager added duplicated rows to Product Master table while only loading 1 record to ProductByRegion table.  I canu2019t get ProductCode show up in Matching Destination Field list.  When I checked ProductMaster records in MDM Data Manager, I right-clicked on one of records, chose Edit Key Mappings, it didnu2019t show anything.  However, if I right-clicked on one of those duplicated rows, Edit Key Mapping shows remote system and key correctly.
    Where did I do wrong?  How can I fix the problem?
    Thank you for help in advance.
    From: SAP MDM Import Manager Reference Guide:
    Mapping to Main Table Lookup Destination Fields
    Import Manager handles main table lookup fields (Lookup [Main])
    differently than other MDM lookup fields. Specifically, Import Manager
    does not display the complete set of display field values of the records
    of the underlying lookup table. Instead, the values it displays for a main
    table lookup field are limited by both the key mappings for the lookup
    table and the values in the source file.
    Also, Import Manager does not automatically display the values of a
    Lookup [Main] destination field in the Destination Values grid when you
    select the field in the Destination Fields grid. Instead, for a main table
    lookup field value to appear in the Destination Values grid, all of the
    following conditions must be met:
    u2022 The lookup table must have key mapping enabled
    u2022 The lookup field must be mapped to a source field
    u2022 The source field must contain key values for the lookup table
    u2022 The destination value must have a key on the current remote system
    u2022 The destination valueu2019s key must match a source field value
    NOTE ►► The current remote system is the remote system that was
    selected in Import Manageru2019s Connect to Source dialog (see
    u201CConnecting to a Remote Systemu201D on page 416 for more information).
    Vicky

    Hi Michael,
    Thank you very much for your response.  I'm new to SAP MDM, I need some clarification and help regarding your solution. 
    I did use two maps to load ProductMaster and ProductByRegion separately.  Here were my steps:
    1. create main table ProductMaster with key mapping enabled at the table level and set ProductCode as unique and writable once (primary key).
    2. create a map to load ProductMaster record from a staging table located an oracle database.  But Key mapping didn't show anything when I looked at them using Data Manager.
    3. create main table ProductByRegion with a lookup field looking at ProductMaster table.  This field and RegionId combines as a unique field for ProductByRegion table. 
    4. create a map to load ProductByRegion table.  But ProductCode records only shows on the source pane not destination pane and can't be mapped properly.
    My questions:
    1. How can I "Ensure that you add key mapping info for all ProductMaster records" besides enabling Key Mapping on the table level?
    2. How can I define a concatenation of ProductCode and RegionId as a REMOTE KEY"?
    Thanks a lot for your help!
    Vicky

  • Error while inserting value Qualified field in the main table

    Hello,
    I am trying to populate Qualified field in the main table when a new record is inserted in the Products Repository.
    The field is Reference Price and its a qualified lookup field. I am using the below code to create qualified lookup value and create qualified link values.
    QualifiedLookupValue qlvRefPrice = new QualifiedLookupValue();
    TableId qltabid = repSchema.getTableId("ReferencePrices");
    FieldId qlfieldid = repSchema.getFieldId("ReferencePrices","RP_ReferncePrices");
    RecordId rdRefPrice = getRecordId(connPool,session,"RP",qlfieldid,qltabid);
    HashMap map = new HashMap();
    map.put(repSchema.getFieldId("ReferencePrices","StartDate_ReferencePrice"),new DateTimeValue(cal));
    map.put(repSchema.getFieldId("ReferencePrices","EndDate_ReferencePrice"),new DateTimeValue(cal));
    map.put(repSchema.getFieldId("ReferencePrices","ListPrice"),new FloatValue(Float.parseFloat("123.3")));
    map.put(repSchema.getFieldId("ReferencePrices","Currency"),new LookupValue(getLookupRecordId(connPool,session,"Currencies","Currency_Currencies","EUR")));
    QualifiedLinkValue qlvLinkValue = MdmValueFactory.createQualifiedLinkValue(rdRefPrice,map);
    qlvRefPrice.addValue(qlvLinkValue);
    emptyRecord.setFieldValue(fieldIdRefPriceHistory,qlvRefPrice);
    However when the createrecord command is executed I get the following error.
    java.lang.RuntimeException: No matching validation Id 97. at com.sap.mdm.internal.validation.ValidationInfoHelper.retrieveValidations(ValidationInfoHelper.java:71) at com.sap.mdm.data.commands.CreateRecordCommand.execute(CreateRecordCommand.java:246) at com.alcatel_lucent.productdetail.ProductItemDetail_Comp.createProduct(ProductItemDetail_Comp.java:2927) at com.alcatel_lucent.productdetail.wdp.InternalProductItemDetail_Comp.createProduct(InternalProductItemDetail_Comp.java:656) at com.alcatel_lucent.productdetail.ProductItemAddView.onActionSave(ProductItemAddView.java:971) at com.alcatel_lucent.productdetail.wdp.InternalProductItemAddView.wdInvokeEventHandler(InternalProductItemAddView.java:662) at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87) at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132) at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335) at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143) at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:332) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingPortal(ClientSession.java:761) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:696) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253) at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149) at com.sap.tc.webdynpro.clientserver.session.core.ApplicationHandle.doProcessing(ApplicationHandle.java:73) at com.sap.tc.webdynpro.portal.pb.impl.AbstractApplicationProxy.sendDataAndProcessActionInternal(AbstractApplicationProxy.java:869) at com.sap.tc.webdynpro.portal.pb.impl.localwd.LocalApplicationProxy.sendDataAndProcessAction(LocalApplicationProxy.java:77) at com.sap.portal.pb.PageBuilder.updateApplications(PageBuilder.java:1356) at com.sap.portal.pb.PageBuilder.SendDataAndProcessAction(PageBuilder.java:327) at com.sap.portal.pb.PageBuilder$1.doPhase(PageBuilder.java:869) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processPhaseListener(WindowPhaseModel.java:755) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doPortalDispatch(WindowPhaseModel.java:717) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:136) at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335) at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143) at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:332) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:741) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:694) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253) at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149) at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62) at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364) at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039) at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265) at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95) at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(AccessController.java:219) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)      
    I spoke to my MDM team and they say there is no validation which they have put for Reference Price field. I have tried inserting values in another field of type qualified lookup in the same main table and that works without any issue.
    The code is as below:
    QualifiedLookupValue qlvRating = new QualifiedLookupValue();
    TableId qlvtable = repSchema.getTableId("ProductRatings");
    FieldId qlvratinglink = repSchema.getFieldId("ProductRatings","RatingLink");                    
    RecordId rdidPR = getRecordId(connPool,session,"CI",qlvratinglink,qlvtable);
    wdComponentAPI.getMessageManager().reportSuccess("rdidPR "+rdidPR);
    HashMap mapPR = new HashMap();
    mapPR.put(repSchema.getFieldId("ProductRatings","AvailRating"),new LookupValue(getLookupRecordId(connPool,session,"AvailabilityRatings","AvailabilityRating_AvailabilityRatings","CI")));
    mapPR.put(repSchema.getFieldId("ProductRatings","EffectiveDate"),new DateTimeValue(cal));
    mapPR.put(repSchema.getFieldId("ProductRatings","FERAIndic"),new LookupValue(getLookupRecordId(connPool,session,"ReplacementIndicators","Code","FE")));
    mapPR.put(repSchema.getFieldId("ProductRatings","FERAOrdItem"),new LookupValue(getLookupRecordId(connPool,session,"ReplProducts","ProdID","100008200")));
    QualifiedLinkValue qlvLink = MdmValueFactory.createQualifiedLinkValue(rdidPR,mapPR);
    qlvRating.addValue(qlvLink);
    emptyRecord.setFieldValue(fieldIdRatingHistory,qlvRating);     
    I would really appreciate if someone can help in solving the issue.
    Thanks in advance,
    Aamod

    Hi Aamod,
    Sees that some validation/assignments are getting triggered as soon as you make changes to the record in MDM. Please check once after removing validations/workflow that you may have. This way you may debug the issue.
    Hope this helps!!
    Cheers,
    Arafat

  • Unable to delete Flat Table Field in Products (Main) Table..!!

    Hi Friends,
    I have created a flat table and assigned it to the main table as a field. Later i added data and also removed. Now , when i am trying to delete that field in the main table then i am getting the below error
    "<i><b>The field cannont be deleted until references to in the Family Tree are removed</b></i>"
    I checked in the Families, i havent found any entry.  I am new to the MDM.. I am unable to find the solution.
    Thanks,
    Raags

    I am able to solve problem. In the datamanager i found that the partition is done on this field. i removed it from family mode.
    thanks,
    raags

  • Oracle TopLink 10g Introductory Tutorial: No Table Reference available

    Hi,
    I'm trying to work through the Oracle TopLink 10g Introductory Tutorial (http://www.oracle.com/technology/products/ias/toplink/doc/10131/main/_tutorial/index.htm).
    At the point 'Map the Java Classes: Create One-to-One Mappings' (http://www.oracle.com/technology/products/ias/toplink/doc/10131/main/_tutorial/index.htm) I'm not able to select a table reference because there is no one available.
    As result i get the following message after generating 'Mapping Status Report':
    TopLink Map 'tut01Map' -> One of the packages is incomplete.
    Package example.model -> One of the descriptors in this package is incomplete.
    Descriptor Employee -> Some mappings are incomplete.
    Mapping address -> No table reference is selected.
    Mapping address -> Table reference is invalid because of the target table chosen.
    Mapping version -> Mapping references write lock field stored in cache, but is not read-only.
    Mapping phoneNumbers -> No table reference is selected.
    Mapping phoneNumbers -> Table reference is invalid because of the target table chosen.
    Descriptor PhoneNumber -> Some mappings are incomplete.
    Descriptor PhoneNumber -> The following primary key fields are unmapped: EMP_ID
    Descriptor PhoneNumber -> The following primary key fields have no writable mappings: EMP_ID
    Mapping owner -> No table reference is selected.
    Mapping owner -> Table reference is invalid because of the target table chosen.
    End TopLink Map 'tut01Map'
    Did I make a mistake or is there a wrong configuration? Please help.
    I'm using:
    JDeveloper 10.1.3.2.0
    MySQL 5.0.33 with Connector/J 5.0.5
    Windows XP
    Thanks, TGau
    Message was edited by:
    TGau
    Update

    Yes I did. But my database storage engine is set to MyISAM which don't support foreign keys. So this 'error' results from database configuration (Info: InnoDB do support foreign keys).
    I'm wondering why the queries didn't throw any errors. So the foreign key/reference part was just skipped.
    Thank you very much, rsapir.
    PS:
    How can I configure configure 'application side' references/associations? It is described in the TopLink Developers Guide on site 34-10 ... but I have no Add/New Buttons?

  • Automatic assignment of hierarchy field in the main table

    Hi,
    We are upgrading from SRM-MDM catalog 2.0 to SRM-MDM catalog 3.0 sp07 patch 10.
    In the main table, we have the standard field Hierarchy, that is a lookup on table Hierarchy.
    In order to value this field, we have a specific field in the Main table, the UNSPSC code, that is a lookup on a specific reference table. This reference table makes the link between UNSPSC codes and nodes of the Hierarchy table.
    After importing a new record that contains the UNSPSC code, we want to automatically assign a value to the hierarchy field in the Main table by the assignment's expression "[main table]UNSPSC code. [specific table]name of hierarchy. [Hierarchy table]name of hierarchy".
    When executing this assignment, we get the error "Assignment operation failed: A runtime error occurred while evaluating an assignment, validation or calculated field".
    Do you know if this kind of assignment is possible (it worked in MDM 5.5 but not anymore in 7.1) ? Or if there is a workaround ?
    Thanks for your kind help.
    Catherine

    Hi Mandeep,
    Thanks for your answer.
    But, I do not want to assign a specific value to the Hierarchy field in the Main table. I want to determine it via a specific table.
    Here is a sample of our data model to try to explain :
    Main table :
    item reference [Display field]
    hierarchy --- lookup on Hierarchy table
    UNSPSC code --- lookup on Specific reference table
    Hierarchy table :
    hierarchy name [Display field]
    hierarchy code
    Specific reference table, type flat :
    UNSPSC code [Display field]
    hierarchy name --- lookup on Hierarchy table
    After import, in the Main table, item reference and UNSPSC code are valued.
    In order to value the hierarchy field in the Main table, we would like to use the specific reference table :
    [Main table]UNSPSC code >>> [Specific reference table]hierarchy name >>> [Hierarchy]hierarchy name.
    This assignment works if the assignment field is a plain text field but not if it is the Hierarchy field of the Main table, which is on lookup on the Hierarchy table.
    Thanks for your help !
    Best regards,
    Catherine

  • MDM Main Table

    Hello MDM Experts,
    I'm new to MDM. When you create a new repository in MDM, MDM automatically creates a main table named Products. I do not want to use this as the main table an I have to create my own main table with diffrent attributes How do I delete this Products  table. Thanks.
    -Kan

    You cannot delete the main table.
    You can always rename the main table.
    When the repository is unloaded, you can re-name, add new fields to the main table.
    You can also create new sub tables.
    Please refer to the MDM Console Reference Guide.
    Hope this helps.
    Please mark helpful answers.

  • TableChanged() does not work with parrent table reference

    Hi,
    I used this example http://www.javalobby.org/articles/jtable/ where the cells refocus after updating, but I have rewrote it to my needs and the program throws nullpointerexception when I update any cell:(
    here is the tableChanged part of code:
        public class InteractiveTableModelListener implements TableModelListener {
            public void tableChanged(TableModelEvent evt) {
                if (evt.getType() == TableModelEvent.UPDATE) {
                    int column = evt.getColumn();
                    int row = evt.getFirstRow();
                    System.out.println("updated row: " + row + " column: " + column);
                   if((column + 1) >= model.getRowCount()){
                      table.removeColumnSelectionInterval(column,column);
                    }else{
                      table.setColumnSelectionInterval(column + 1, column + 1);
                    table.setRowSelectionInterval(row,row);
    }the table reference worked in the exaple but doesnt work in my program:(
    here is the init of the table in function initComponent:
            tableModel.addTableModelListener(new InteractiveTableModelListener());
            TableSorter sorter = new TableSorter(tableModel);
            JTable table = new JTable(sorter);the class is on the same level as the function
    i have searched all the internet for this with no results:(
    thank you for your advice!

    Yes, you are right, I wrote this post in a hurry and exhaused, that it does not work.
    I'm trying to write out a data file (now only a vector of data) in a JTable and I want to edit the rows and after I submit text in a cell, I want the caret to move one cell right, so the user can write another text, just like in MS Excel. At the end of the row the caret disapears but does not create another row.
    And I have problems with variable JTable table in the inner class that contains method tableChanged().
    Well After making an example I realized it worked and then I checked the example line by line and found out that I declare another JTable with the same name in the table initializing method,
    Then the variable couldnt work in tableChanged method... It was empty...
    I used your example from thread, you advised me:
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    public class TableProcessing extends JFrame implements TableModelListener
         // here I declare the table
            protected JTable table;
         public TableProcessing()
              String[] columnNames = {"Item", "Quantity", "Price", "Cost"};
              Object[][] data =
                   {"Bread", new Integer(1), new Double(1.11), new Double(1.11)},
                   {"Milk", new Integer(1), new Double(2.22), new Double(2.22)},
                   {"Tea", new Integer(1), new Double(3.33), new Double(3.33)},
                   {"Cofee", new Integer(1), new Double(4.44), new Double(4.44)}
              DefaultTableModel model = new DefaultTableModel(data, columnNames);
              model.addTableModelListener( this );
                    // here I declare it again, which is a MISTAKE
              JTable table = new JTable( model )
                   //  Returning the Class of each column will allow different
                   //  renderers to be used based on Class
                   public Class getColumnClass(int column)
                        return getValueAt(0, column).getClass();
                   //  The Cost is not editable
                   public boolean isCellEditable(int row, int column)
                        int modelColumn = convertColumnIndexToModel( column );
                        return (modelColumn == 3) ? false : true;
              table.setPreferredScrollableViewportSize(table.getPreferredSize());
              JScrollPane scrollPane = new JScrollPane( table );
              getContentPane().add( scrollPane );
          *  The cost is recalculated whenever the quantity or price is changed
         public void tableChanged(TableModelEvent e)
              System.out.println(e.getSource());
              if (e.getType() == TableModelEvent.UPDATE)
                   int row = e.getFirstRow();
                   int column = e.getColumn();
                   if (column == 1 || column == 2)
                                   // AND here is not initialised - throws NullPointerException
                        TableModel model = table.getModel();
                        int     quantity = ((Integer)model.getValueAt(row, 1)).intValue();
                        double price = ((Double)model.getValueAt(row, 2)).doubleValue();
                        Double value = new Double(quantity * price);
                        model.setValueAt(value, row, 3);
         public static void main(String[] args)
              TableProcessing frame = new TableProcessing();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible(true);
    }

  • Unable to read field value from main table - unexpected socket read error

    Hi Friends,
    While executing the below code, I am able to get the value of the field 'id' but i am unable to get the value for the 'materialnumber' field. i am getting the below exception
    +com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ProtocolException: java.io.IOException: Unexpected socket read.  Result is -1.
         at com.sap.mdm.data.commands.AbstractRetrieveLimitedRecordsCommand.execute(AbstractRetrieveLimitedRecordsCommand.java:158)
         at com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand.execute(RetrieveLimitedRecordsCommand.java:157)
         at updaterecords.main(updaterecords.java:126)
    Caused by: com.sap.mdm.internal.protocol.manual.ProtocolException: java.io.IOException: Unexpected socket read.  Result is -1.
         at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:100)
         at com.sap.mdm.data.commands.AbstractRetrieveLimitedRecordsCommand.execute(AbstractRetrieveLimitedRecordsCommand.java:146)
         ... 2 more
    Caused by: java.io.IOException: Unexpected socket read.  Result is -1.
         at com.sap.mdm.internal.net.DataSocket.receiveData(DataSocket.java:59)
         at com.sap.mdm.internal.net.ConnectionImpl.readInt(ConnectionImpl.java:417)
         at com.sap.mdm.internal.net.ConnectionImpl.nextMessage(ConnectionImpl.java:501)
         at com.sap.mdm.internal.net.ConnectionImpl.receiveMessage(ConnectionImpl.java:472)
         at com.sap.mdm.internal.net.ConnectionImpl.send(ConnectionImpl.java:209)
         at com.sap.mdm.internal.net.ReservedConnection.send(ReservedConnection.java:105)
         at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:97)
         ... 3 more+
    import com.sap.mdm.commands.AuthenticateUserSessionCommand;
    import com.sap.mdm.commands.CommandException;
    import com.sap.mdm.commands.CreateUserSessionCommand;
    import com.sap.mdm.commands.DestroySessionCommand;
    import com.sap.mdm.commands.GetRepositoryRegionListCommand;
    import com.sap.mdm.data.Record;
    import com.sap.mdm.data.RegionProperties;
    import com.sap.mdm.data.ResultDefinition;
    import com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand;
    import com.sap.mdm.ids.TableId;
    import com.sap.mdm.net.ConnectionException;
    import com.sap.mdm.net.ConnectionPool;
    import com.sap.mdm.net.ConnectionPoolFactory;
    import com.sap.mdm.schema.FieldProperties;
    import com.sap.mdm.schema.RepositorySchema;
    import com.sap.mdm.schema.commands.GetFieldListCommand;
    import com.sap.mdm.schema.commands.GetRepositorySchemaCommand;
    import com.sap.mdm.search.Search;
    import com.sap.mdm.server.DBMSType;
    import com.sap.mdm.server.RepositoryIdentifier;
    public class updaterecords {
         public static void main(String[] args) {
              try {               
                    String serverName = "159.112.6.26";
                    ConnectionPool connections = null;
                    try {
                         connections = ConnectionPoolFactory.getInstance(serverName);
                    } catch (ConnectionException e) {
                         e.printStackTrace();
                         return;
                   // specify the repository to use
                   // alternatively, a repository identifier can be obtain from the GetMountedRepositoryListCommand
                   String repositoryName = "DEMO";
                   String dbmsName = "MDMD";
                   RepositoryIdentifier reposId = new RepositoryIdentifier(repositoryName, dbmsName, DBMSType.ORACLE);
                   // get list of available regions for the repository
                   GetRepositoryRegionListCommand regionListCommand = new GetRepositoryRegionListCommand(connections);
                   regionListCommand.setRepositoryIdentifier(reposId);
                   try {
                        regionListCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
                   RegionProperties[] regions = regionListCommand.getRegions();
                   // create a user session
                   CreateUserSessionCommand sessionCommand = new CreateUserSessionCommand(connections);
                   sessionCommand.setRepositoryIdentifier(reposId);
                   sessionCommand.setDataRegion(regions[0]); // use the first region
                   try {
                        sessionCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
                   String sessionId = sessionCommand.getUserSession();
                   // authenticate the user session
                   String userName = "meter1";
                   String userPassword = "meter1";
                   AuthenticateUserSessionCommand authCommand = new AuthenticateUserSessionCommand(connections);
                   authCommand.setSession(sessionId);
                   authCommand.setUserName(userName);
                   authCommand.setUserPassword(userPassword);
                   try {
                        authCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
                   GetRepositorySchemaCommand cmd=new GetRepositorySchemaCommand(connections);
                   cmd.setSession(sessionId);
                   try{
                        cmd.execute();               
                   }catch(CommandException e){
                        System.out.println(e.getLocalizedMessage());
                   RepositorySchema repsch=cmd.getRepositorySchema();
                   // the main table, hard-coded
                   TableId mainTableId = new TableId(1);     
                   // specify the result definition (what to retrieve); in this example, nothing
                   ResultDefinition rd = new ResultDefinition(mainTableId);
                   // select all records
                   Search search = new com.sap.mdm.search.Search(mainTableId);
                   //get fields
                   GetFieldListCommand getFieldListCommand = new GetFieldListCommand(connections);
                   getFieldListCommand.setSession(sessionCommand.getUserSession());
                   getFieldListCommand.setTableId(mainTableId);
                   try {
                        getFieldListCommand.execute();
                   } catch (CommandException e) {
                        System.out.println(e);
                   FieldProperties[] lookupFields = getFieldListCommand.getFields();
                   // add fields to records to retrieve
                   rd.addSelectField(repsch.getFieldId("Products","Id"));
                   rd.addSelectField(repsch.getFieldId("Products","MaterialNumber"));                              
                   // retrieve the records
                   RetrieveLimitedRecordsCommand limitingCommand = new RetrieveLimitedRecordsCommand(connections);
                   limitingCommand.setSession(sessionId);
                   limitingCommand.setResultDefinition(rd);
                   limitingCommand.setSearch(search);
                   //limitingCommand.setPageSize(2000);
                   try {
                        limitingCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
                   System.out.println("Record count is " + limitingCommand.getRecords().getCount()+"\n");
                   Record[] records=limitingCommand.getRecords().getRecords();
    System.out.println(records[0].getFieldValue(repsch.getFieldId("Products","Id"))+ " \n");
    System.out.println(records[0].getFieldValue(repsch.getFieldId("Products","MaterialNumber"))+ " \n");
                   // finally destroy the session
                   DestroySessionCommand destroySessionCommand = new DestroySessionCommand(connections);
                   destroySessionCommand.setSession(sessionId);
                   try {
                        destroySessionCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
              } catch (Exception e) {
                   System.out.println(e.getLocalizedMessage());
                   e.printStackTrace();
    Kindly let me know where i am going wrong. MaterialNumber field is a TEXT not a lookup table field.  Above fields are from the main table.
    Thanks,
    Raags

    Hi Friends,
    I got the solution. It was the error because of not having a the below statement.
    limitingCommand.setPageSize(1);
    As i havent used that statement, it was trying to get 1000 records, and i dont know exactly what makes this to get that error. Anyhow., As i want to use for updation, i cn live with one record.
    Thanks,
    Raags

  • Retrieving lookup field values from a main table using MDM JAVA APIs

    Hi all,
    am trying to retrieve the main table data...., i could able to retrieve all the data except lookup field values..., iam facing some runtime exceptions and i dont know why exactly it is throwing this exception..., i pasted piece of code where exactly the error is and the exception also.
    in the below sode i set some result set definitions and passing them to retrieveLimitedRecordsCommand. it is showing some exception at retrieveLimitedRecordsCommand.execute(); command.
    //*** Code  ***//
      supportingMainResultDefinitions = new ResultDefinition[] { rdQual ,rdFlat, rdqFlat  };
                                            retrieveLimitedRecordsCommand.setResultDefinition(rd);
                                            retrieveLimitedRecordsCommand.setSearch(new Search(tableId));
                                            retrieveLimitedRecordsCommand.setSession(sessionId);
                                            retrieveLimitedRecordsCommand.setSupportingResultDefinitions(supportingMainResultDefinitions);
                                            try {
                                            retrieveLimitedRecordsCommand.execute();
                                                    PrintRecords.toConsole(retrieveLimitedRecordsCommand.getRecords());
                                                    } catch (CommandException e) {
                                                    e.printStackTrace();
    //***  Below is the Exception raised ***//
    java.lang.UnsupportedOperationException: Unexpected field type -1
            at com.sap.mdm.internal.schema.PropertiesHelper.createField(PropertiesHelper.java:274)
            at com.sap.mdm.internal.schema.PropertiesHelper.convertFrom(PropertiesHelper.java:281)
            at com.sap.mdm.internal.data.RecordMetadata.<init>(Unknown Source)
            at com.sap.mdm.internal.data.RecordsLoader.<init>(Unknown Source)
            at com.sap.mdm.internal.data.RecordsLoader.<init>(Unknown Source)
            at com.sap.mdm.internal.data.RecordResultSetHelper.convertFrom(Unknown Source)
            at com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand.execute(Unknown Source)
            at com.sap.mdm.apitutorial.lesson2.RecordsDisplay.getDisplayRecords(RecordsDisplay.java:303)
            at org.apache.jsp.Sample_jsp._jspService(Sample_jsp.java:190)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:534)
    If anyonw worked on this concept..., please provide me the solution
    Regards
    Praveen k

    Which version are you using?  Can you please try and narrow down to the offending field?  You can do this by limiting the fields you provide to ResultDefinition.

  • How to replace NULL values from main table

    Dear all,
    I like to remove the NULL values from a main table field. Or the question is how to replace any part of the string field in MDM repository main table field.
    e.g.   I have a middle name field partly the value is NULL in some hundreds of records, I like to replace NULL values with Space
    any recommendation.
    Regards,
    Naeem

    Hi Naeem,
    You can try using Workflows for automatically replacing NULLs with any specific value.
    What you can do is: Create a workflow and set trigger action as Record Import, Record Create and Record Update. So, that whenever any change will occur in the repository; that workflow will trigger.
    Now create an assignment expression for replacing NULLs with any specific value and use that assignment expression in your workflow by using Assign Step in workflow.
    For exiting records, you will have to replace NULLs manually using the process given by Preethi else you can export those records in an Excel spreadsheet which have NULLs and then replace all NULLs with any string value and then reimport those records in your MDM repository.
    Hope this will solve your problem.
    Regards,
    Varun
    Edited by: Varun Agarwal on Dec 2, 2008 3:12 PM

  • What are the main tables using in vendor performance report.

    what are the main tables using in vendor performance report.
    how many select statements are in ABAP reports.

    Refer the links -
    vendor performance report !!!
    vendor performance report
    vendor performance report
    I need standard vendor performance report
    Regards,
    Amit
    Reward all helpful replies.

  • PDF file Not opening in Main Table

    Hi,
    I have added PDF lookup field in my main Table in console.
    I m able to import PDF file in PDF table ( after making Allow Invalid PDFs as YES)
    I have also imported PDF file in Main table field.
    But here PDF file is not opening.
    I m able to open PDF file only in PDF table & not in main table.
    Also i am not able to Generate Thumbnail.
    I m getting error:
    Regenerating thumbnail for 'Mahi.pdf'...failed.
    Regeneration of thumbnails complete.
    Can anybody tell me what could be the problem?
    Thanks,
    Mahi

    Hi Maheshwari,
    I have added PDF lookup field in my main Table in console.
    I m able to import PDF file in PDF table ( after making Allow Invalid PDFs as YES)
    I have also imported PDF file in Main table field.
    But here PDF file is not opening.
    You can link the pdf to the Main tabel record by two ways:
    1. Using Import Manager
    2. Using Data Manager itself.
    I have just tried it by the second way and I am able to open the Pdf in the Main Table itself.
    PLease follow these step below:
    1. Import the Pdf in the Pdf table and store the Pdf in the repository itself by choosing the Option - +Store in Repository+
    2.Go to Main Table and double click on the Look up field on the right side. GO to the Data Group Tab and add the Data Group you have created.
    3. Then choose the pdf you want to choose for that particular main table record. You will find the PDf getting attached in the Main Table Record.
    4. Now try and open the Pdf, HopefullyYou will find it opening in the Main Table itself .
    Hope it helps.
    Thanks and Regards
    Nitin jain

  • Multiple Main Table Question

    I am new to MDM 7.1 & Multiple Main Tables. I have a very basic questionu2019
    My Requirement is that I have to keep Two Main Tables,
    1.      Manufacturer Parts Master Table and the key is Manufacturer Name + Manufacturer Part No (Two fields)
    2.      I  have another Main Table  called Manufacturer Parts Table and key will be Manufacturer Name + Manufacturer Part No (Two fields)
    My requirement is  that when I load data in to the 2nd Main table (Manufacturer parts Table) I have to validate against the Master table (Manufacturer Parts  Master Table) with the key combination of Manufacturer Name + Manufacturer Part No  and that this key combination must exists in the 1st table.( Manufacturer Parts Master Table.). If  not then it is an error.
    I know we can use the 1st table as lookup main table for the 2nd table but do we need to combine the key fields Manufacturer Name + Manufacturer Part No for both the tables to validate against the Manufacturer Parts Master table with the same key combination?.
    Anyone explains how I can do this?
    Also, Qualified tables still exits in MDM 7.1? OR we have to use  Tuples?

    Hi,
    1. Manufacturer Parts Master Table and the key is Manufacturer Name + Manufacturer Part No (Two fields)
    In Console: Say your 1st main table has Manufacturer Name + Manufacturer Part. No two fields which are Display fields. For this 1st Main table you should have your Edit Key mapping = Yes.
    In Import Manager: Your Remote Key in your MDM import Manager should be mapped with combination of these two fields using Partition Concept with some delimiter say ,
    e.g. for 1 record in your 1st main table when you right click on your Edit key mapping using MDM data Manager it has values as:
    RemoteSystem Key
    ABC MANF1,123
    So here Key is combination of Manufacturer Name + Manufacturer Part No (MANF1,123) which has delimiter ,
    2. I have another Main Table called Manufacturer Parts Table.
    In Console: For this 2nd Main table first of all, you will create a Field of type Lookup Main which is lookup to 1st main table say X. You will have some other field too in 2nd main table which is Display field and using it you can import data.
    In Import Manager: For 2nd Main table, your source fields again should be combination of Manufacturer Name + Manufacturer Part No using partition field concept with delimiter say , and map this Partition field here with field X which is lookup to main table. when you will do this you will see all your source values for this partition field gets mapped automatically for the records which are present in 1st main table and if there is any value which is not mapped it means that that manufacturer name + manufacturer Part no does not exist in 1st main table.
    You must set this property in Import Map, if you are importing data through Import server by right clicking on target mapped field X Set MDIS Unmapped Value handling = Fail which will take care if record exists in 1st main table then only record imported in 2nd main table else give error. As if record exists in 1st main table then while importing data through 2nd main table his value automatically gets mapped.
    Also, Qualified tables still exits in MDM 7.1? OR we have to use Tuples?
    For most of standard Master's e.g. Material SAP Note 1355137, Customer SAP Note 1412742: Tuple has been replaced using  Qualified table. But if you want, you can model data as per your requirement. You can still use Qualified table if business demands.
    Regards,
    Mandeep Saini

  • Display many fields of a lookup table in the main table

    Hello Experts,
    In MDM, I have a "Suppliers" table which is a lookup table. This table has 4 fields :
    - Supplier Name (Display Field)
    - Supplier Code
    - Email
    - Phone number
    In the main table, a field "Supplier" uses the "Suppliers" lookup table. This fields displays the "Supplier Name" of the "Suppliers" lookup table.
    Now I also want to display the "Email" and the "Phone Number" of the supplier. If I set these fields as Display Fields in the "Suppliers" lookup table, they appear concatenated in the main table, which I don't want.
    The only way I found to display those fields is to set 2 new fields in the main table as calculated fields, eg: IF(TRUE, Supplier.Email).
    Is there any way to display those fields w/o using calculated fields?
    Thanks for your help

    Hi Christian,
    Thanks for your help. Actually I am working on the SRM part of MDM, so I do not use portal to display data but the SRM-MDM UI on which I can not manage iViews.
    The need is to have, for each Material displayed, the name and the contact data of the Supplier. If I concatenate those data  the display is not very clear for the user. Eg:
    Supplier data: TOTO, contact_at_toto.com, 1234567890
    I would rather have :
    Supplier: TOTO
    EMail: contact_at_toto.com
    Phone Number: 1234567890
    As you said, the non automatic update of calculated fields is an issue in my case. So I am currently looking at assignments, which seems to be schedulable via a workflow but I don't know if it's a good mean?
    Best regards,
    Patrick

Maybe you are looking for