tag:blogger.com,1999:blog-55793395417556437922024-03-13T09:13:55.395-07:00SAP MDM Training-SAP MDM Tutorials,SAP MDM Jobs,SAP MDM Resumes-SAP MDMSAP MDM Training , SAP MDM Tutorials,SAP MDM Interview Questions,SAP MDM Certification Questions,SAP MDM Jobs,SAP MDM Resumes,SAP MDM Best Practice,SAP MDM Data Manger,SAP MDM Syndicator,SAP MDM Consolidation,SAP MDM Print Publisher,SAP MDM GDS,SAP MDM Repositoris, SAP Master Data Management Tutorialsand Many More...SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.comBlogger398125tag:blogger.com,1999:blog-5579339541755643792.post-6534514143810063532012-02-22T08:19:00.001-08:002012-02-22T08:19:53.547-08:00Enterprise Master Data Management - A cross-system master data process for supplier<h5 align="justify">Applies to:</h5> <p align="justify">ERP 6 EhP5 – Master Data Governance for Supplier</p> <h5 align="justify"><a name="EnterpriseMasterDataManagement-Across-systemmasterdataprocessforsupplier-Summary"></a>Summary</h5> <p align="justify">This article provides implementation details for a simplified cross system Supplier On-boarding scenario leveraging SAP’s Enterprise Master Data Management portfolio consisting of SAP NetWeaver Master Data Management (available since 2004) and SAP Master Data Governance (currently in Ramp-Up). The overarching process is modeled using SAP NetWeaver Business Process Management.</p> <h5 align="justify"><a name="EnterpriseMasterDataManagement-Across-systemmasterdataprocessforsupplier-Author(s):&nbsp;"></a>Author(s):  </h5> <p align="justify">Lars Rueter   <br /><b>Company :</b>    SAP AG, Germany    <br /><b>Created on:</b>    4. March 2011 <br /><b>Author(s) Bio</b> <br />Mr. Rüter works at SAP in the area of SAP Master Data Governance. In the past 11 years at SAP he has held different positions in Asia Pacific and EMEA. He has extensive experience in SAP's Master Data Management product portfolio, Java Development and SAP NetWeaver Portal. Mr Rüter has been involved in a large number of SAP implementations worldwide.</p> <h4 align="justify"><a name="EnterpriseMasterDataManagement-Across-systemmasterdataprocessforsupplier-Crosssystemcreatesupplierprocess"></a>Cross system create supplier process</h4> <p align="justify">In our example we will build a cross-system supplier self-service registration and approval process. A supplier registers via a website and enters some initial data such as company name, street, city and postal code. These global attributes are stored in NetWeaver MDM for further distribution to Non-SAP systems. When the supplier is approved by the master data specialist a change request is automatically generated in SAP Master Data Governance. A workflow in SAP Master Data governance ensures that all ERP specific attributes are maintained. After final approval in SAP Master Data Governance the new supplier is activated and distributed. After activation a notification is send to the original requester.</p> <p align="justify"><img src="https://weblogs.sdn.sap.com/weblogs/images/251934038/Fig1_700x500.jpg" /> <br /><b>Figure 1: High-level process overview</b></p> <p align="justify">In figure 2 below you see which systems are part of the process:</p> <ul> <li> <div align="justify">(A) SAP Master Data Governance – maintenance and distribution of ERP specific attributes </div> </li> <li> <div align="justify">(B) SAP NetWeaver MDM - maintenance and distribution of global attributes </div> </li> <li> <div align="justify">(C) NetWeaver CE – process runtime, process specific UIs, process worklist, web service consumption and provisioning </div> </li> <li> <div align="justify">(D) NetWeaver Developer Studio – process designtime </div> </li> </ul> <p align="justify"><img src="https://weblogs.sdn.sap.com/weblogs/images/251934038/Fig3_700x500.jpg" /> <br /><b>Figure 2: System Landscape</b></p> <p align="justify">As mentioned above the process was implemented using NetWeaver BPM for the design and execution of the cross-system process. But we also leverage the out-the-box governance process in Master Data Governance for maintenance of ERP specific attributes.</p> <p align="justify"><img src="https://weblogs.sdn.sap.com/weblogs/images/251934038/Fig2_700x500.jpg" /> <br /><b>Figure 3: Technical process overview</b></p> <p align="justify">The figure above provides a more technical process overview using the Business Process Modeling Notation (BPMN) notation from SAP NetWeaver BPM:</p> <ul> <li> <div align="justify">(1) The initial supplier registration web page triggers the start web-service of the BPM process </div> </li> <li> <div align="justify">(2) The global attributes from the registration web-page are used to create a new supplier record in SAP NetWeaver MDM </div> </li> <li> <div align="justify">(3) In this human interaction step a new supplier is being approved </div> </li> <li> <div align="justify">(4) BPM calls a SAP Master Data Governance Web Service to create a change request with the initial supplier data. This also triggers a SAP Business Workflow in SAP Master Data Governance. </div> </li> <li> <div align="justify">(5) This step in BPM is called an intermediate message event. The process waits for a message to come in from Master Data Governance before the flow commences. Early in the SAP Business Workflow process we have inserted a task to call BPM. In this call we transmit the ID of the change request. </div> </li> <li> <div align="justify">(6) BPM uses the change request ID from SAP Master Data Governance to send an e-mail to the original requestor. The e-mail contains a link to the SAP Business Workflow log. Using this link the original requestor can monitor the status of the change request in MDG. </div> </li> <li> <div align="justify">(7) After sending an e-mail the BPM process waits again for a message from SAP Master Data Governance. This time SAP Master Data Governance sends a message at the end of the SAP Business Workflow process and after the Supplier has been finally approved and activated. The message includes the final ID of the Business Partner in the primary persistence. </div> </li> <li> <div align="justify">(8) The last step in the BPM process informs the original requestor that the new Business Partner has been created and activated. </div> </li> </ul> <h4 align="justify"><a name="EnterpriseMasterDataManagement-Across-systemmasterdataprocessforsupplier-ImplementationSteps"></a>Implementation Steps</h4> <p align="justify">Integration between NetWeaver MDM and BPM has already been sufficiently documented on SDN. In this section the focus is on the integration between SAP Master Data Governance and NetWeaver BPM. Therefore we look specifically at the three integration points numbered step 4, step 5 and step 7 in figure 3 above. In step 4 we show how the inbound communication to SAP Master Data Governance was realized using a standard Web Service. The steps 5 and 7 are technically very similar in the sense that they both use a web service client proxy to transmit process status information from the SAP Business Workflow back to SAP NetWeaver BPM. </p> <h5 align="justify"><a name="EnterpriseMasterDataManagement-Across-systemmasterdataprocessforsupplier-UsingtheinboundBusinessPartnerWebService"></a>Using the inbound Business Partner Web Service</h5> <p align="justify">The ESR Web Service used to create a Business Partner in our scenario is called <em>BusinessPartnerSUITEBulkReplicateRequest_In</em>. In order to leverage this Web Service to automatically create a change request and key-mapping in SAP Master Data Governance , the method INBOUND_PROCESSING of BAdI MDG_SE_BP_BULK_REPLRQ_IN in Enhancement Sport MDG_SE_SPOT_BPBUPA has to be implemented. </p> <p align="justify"><b>IF_MDG_SE_BP_BULK_REPLRQ_IN~INBOUND_PROCESSING</b></p> <div align="justify"> <pre>METHOD if_mdg_se_bp_bulk_replrq_in~inbound_processing.<br /><br /> DATA ls_user_setting TYPE mdg_user_proxy_setting.<br /> DATA lt_user_setting TYPE mdg_user_proxy_setting_t.<br /> DATA lv_crtype TYPE mdg_sup_change_req.<br /><br /> if in-message_header-business_scope-id-content = 'BPM'.<br /><br /> ls_user_setting-field_name = 'PROXY_PERSISTANCE'.<br /> ls_user_setting-field_value = '1'.<br /> APPEND ls_user_setting TO lt_user_setting.<br /> ls_user_setting-field_name = 'SUPPLIER_CHANGE'.<br /><br /> SELECT SINGLE usmd_creq_type INTO lv_crtype FROM usmd1601 WHERE usmd_process = 'SUP1'.<br />*<br /> ls_user_setting-field_value = lv_crtype.<br /> APPEND ls_user_setting TO lt_user_setting.<br /><br /><br /> CALL METHOD cl_mdg_bp_bupa_si_in=>if_mdg_upload_proxy~setup_for_file_upload<br /> EXPORTING<br /> iv_instance = 1<br />* IO_UPLOAD_DIALOG =<br /> it_user_setting = lt_user_setting.<br /><br /> endif.<br /><br /><br />ENDMETHOD.</pre><br /></div><br /><br /><p align="justify">The code first checks the <em>scope-id</em>-element in the message header. The SAP Master Data Governance load will only continue if the <em>scope-id</em>-element is set to <em>BPM</em>. The proxy implementation of the inbound service uses the context of the SAP Master Data Governance-file-upload-framework to determine how the incoming data has to be processed. We use the enhancement spot to set the file upload framework context in such a way that the incoming data is stored in the SAP Master Data Governance staging area and a change request of type SUPPL01 (Create Supplier) is being created. If key-mapping information was send as part of the Web Service call, the key-mapping for the new supplier will automatically be updated. <br /><br /> <br />The ABAP code in the Enhancement Sport looks for the first process type <em>SUP1</em> in table USMD1601 and takes the change request type from that line. In our example LRDEMO will be selected as change request type when the web service is called (refer to table USMD1601 in figure 4 below). You may have to adapt the ABAP code to ensure your custom change request type (as defined in the following section _ Customizing the governance process_) is correctly assigned in the Enhancement Spot.</p><br /><br /><p align="justify"><img src="https://weblogs.sdn.sap.com/weblogs/images/251934038/Fig4_orig.png" /><br /><br /> <br /><b>Figure 4: Table USMD1601</b><br /><br /> <br />An example XML document to test the web service is attached to this wiki. </p><br /><br /><p align="justify"><img border="0" alt="" align="absMiddle" src="http://wiki.sdn.sap.com/wiki/images/icons/emoticons/information.gif" width="16" height="16" /><br /><br /> <br /><b>Test your scenario – Inbound Web Service</b><br /><br /> <br />You should now test if the implementation is working. Using a Web Service test tool such as the SAP Web Service Navigator you can call the Web Service. After successful execution you should find a new change request in the POWER -List (Personal Object Work Entity Repository). You can access the POWER-List via the supplier role in SAP Master Data Governance.</p><br /><br /><h5 align="justify"><a name="EnterpriseMasterDataManagement-Across-systemmasterdataprocessforsupplier-Customizingthegovernanceprocess"></a>Customizing the governance process</h5><br /><br /><p align="justify">Your Web Service is working? Good! Your inbound connection to SAP Master Data Governance is now ready. Next we need to establish the outbound connection to NetWeaver BPM. In our example we extend the governance process for create supplier by two additional SAP Business Workflow tasks. Each of the two tasks sends a message to NetWeaver BPM.</p><br /><br /><p align="justify">Since we do not want to modify the SAP delivered workflow template and change request type, we first create a copies.</p><br /><br /><ul><br /> <li><br /> <div align="justify">Look up the id of the workflow template for <em>Create Supplier</em>: Open MDG IMG activity <em>Create Change Request Type</em> and find the row with change request type SUPPL01 (Create Supplier). In the same row you find the workflow template id for this change request type. </div><br /> </li><br /><br /> <li><br /> <div align="justify">Open the <em>Workflow Builder</em> (transaction swdd) and create a copy of the SAP delivered workflow template for <em>Create Supplier</em> (use the workflow template id from the previous step). Do not forget to save and activate you new workflow template. </div><br /> </li><br /><br /> <li><br /> <div align="justify">In MDG IMG activity <em>Create Change Request Type</em> create a copy of the SAP delivered change request type SUPPL01 (Create Supplier). Assign the new workflow template id from the previous step to the new change request. In our example we have created a custom change request type LRDEMO which is linked to workflow template WS99900008 (Firgure 5 below). </div><br /> </li><br /></ul><br /><br /><p align="justify"><img src="https://weblogs.sdn.sap.com/weblogs/images/251934038/Fig5_700x500.jpg" /><br /><br /> <br /><b>Figure 5: IMG activity Create Change Request Type</b></p><br /><br /><ul><br /> <li><br /> <div align="justify">In MDG IMG activity <em>Define workflow step numbers</em> create a copy of the rows from the SAP delivered workflow template for the create supplier workflow template. In your copied rows change the workflow template id to the id of your custom workflow template. </div><br /> </li><br /></ul><br /><br /><p align="justify"><img src="https://weblogs.sdn.sap.com/weblogs/images/251934038/Fig6_700x500.jpg" /><br /><br /> <br /><b>Figure 6: IMG activity Define Workflow Step Numbers</b></p><br /><br /><ul><br /> <li><br /> <div align="justify">To ensure the receiver determination will work for your new change request type enhance the BRF+ table GET_AGENT. Start transaction BRF+ and search for <em>MDG</em> as shown in figure 7 below. </div><br /> </li><br /></ul><br /><br /><p align="justify"><img src="https://weblogs.sdn.sap.com/weblogs/images/251934038/Fig8_700x500.jpg" /><br /><br /> <br /><b>Figure 7: BRF+ Search</b><br /><br /> <br />Navigate to the GET_AGENT table as shown in figure 8. Create one row in the table for each workflow step. In column CREQUEST_TYPE enter the name of your custom change request type. In columns OTYPE and OBJID enter the object type (eg. user / organization) and corresponding value respectively.</p><br /><br /><p align="justify"><img src="https://weblogs.sdn.sap.com/weblogs/images/251934038/Fig7_700x500.jpg" /><br /><br /> <br /><b>Figure 8: BRF+ table get_agent</b></p><br /><br /><p align="justify"><img border="0" alt="" align="absMiddle" src="http://wiki.sdn.sap.com/wiki/images/icons/emoticons/information.gif" width="16" height="16" /><br /><br /> <br /><b>Test your scenario – custom change request type</b><br /><br /> <br />This a good point to test your new change request type and workflow template. From the supplier role menu in SAP Master Data Governance choose the <em>Create Supplier</em> menu item. You should see your custom change request type in the drop down box of the create supplier screen. Select your custom change request type. Enter the new business partner details and approve the individual workflow steps until activation. At the end of the workflow you should have created a new Business Partner in the primary persistence. You can check by doing a search for the business partner id. You may have to change the receiver determination in BRF+ to ensure you can approve all the workflow steps.</p><br /><br /><p align="justify"><img border="0" alt="" align="absMiddle" src="http://wiki.sdn.sap.com/wiki/images/icons/emoticons/information.gif" width="16" height="16" /><br /><br /> <br /><b>Test your scenario – inbound web service with custom change request type</b><br /><br /> <br />If you have confirmed that your new change request type and workflow template are working, repeat the test using the <em>BusinessPartnerSUITEBulkReplicateRequest_In</em> web service. Verify that after calling the web service a change request is created and the associated custom workflow is started. You can use transaction swud to find the workflow instance.</p><br /><br /><h5 align="justify"><a name="EnterpriseMasterDataManagement-Across-systemmasterdataprocessforsupplier-ExchangingprocesscontextinformationbetweenSAPBusinessWorkflowandNetWeaverBPM"></a>Exchanging process context information between SAP Business Workflow and NetWeaver BPM</h5><br /><br /><p align="justify">In our example we decided to implement the exchange of process context information between NetWeaver BPM and SAP Business Workflow using asynchronous web services. In particular for exchanging the <em>MDG change request id</em> and <em>business partner id</em>. In NetWeaver BPM two <em>Trigger Events</em> were created (wsdl1, wsdl2) for this purpose. The consumption side is technically realized by generating an ABAP proxy for each service and calling this proxy from a task in the SAP Business Workflow. In step 5 (figure 3) we are using the Web Service call to transfer the <em>change request-id</em> to the SAP NetWeaver BPM context. In step 7 (figure 3) we transfer the <em>business partner id</em> after activation in the back end. After transferring the <em>change request id</em> step 5 (figure 3) we can use the <em>change request id</em> in NetWeaver BPM to generate an URL to the SAP Business Workflow log for this change request. We use this URL in our BPM process to send an e-mail notification to the original requestor with the link to the workflow log. </p><br /><br /><p align="justify"><img border="0" alt="" align="absMiddle" src="http://wiki.sdn.sap.com/wiki/images/icons/emoticons/information.gif" width="16" height="16" /><br /><br /> <br /><b>Generating a SAP Business Workflow log URL from a change request id in SAP MDG</b><br /><br /> <br /><tt>https://</tt> <tt><HOSTNAME></tt> <tt>:</tt> <tt><PORT></tt> <tt>/sap/bc/webdynpro/sap/usmd_crequest_protocol2?SAP-CLIENT=</tt> <tt><CLIENT></tt> <tt>&SAP-LANGUAGE=EN&CREQUEST=</tt> <tt><insert the change request number here></tt></p><br /><br /><p align="justify">For sending the <em>change request id</em> to NetWeaver BPM a task was added after the <em>Set Initial Status of Change Request</em> task at the beginning of the workflow (figure 9). In the object method section of the task maintenance screen (figure 10) a custom class and method is selected. The called method calls the web service proxy to transmit the <em>change request id</em>. To be able to select your custom class from the workflow task it must implement the interfaces BI_OBJECT, BI_PRESISTENT and IF_WORKFLOW (figure 13). You can find more information regarding ABAP OO for workflow in the references section at the bottom of the article.</p><br /><br /><p align="justify"><img src="https://weblogs.sdn.sap.com/weblogs/images/251934038/Fig9_700x500.jpg" /><br /><br /> <br /><b>Figure 9: Create business partner workflow with custom task</b></p><br /><br /><p align="justify"><img src="https://weblogs.sdn.sap.com/weblogs/images/251934038/Fig9a_700x500.jpg" /><br /><br /> <br /><b>Figure 10: Custom task maintenance</b></p><br /><br /><p align="justify">For sending the <em>change request id</em> to NetWeaver BPM a task was added after the <em>Set Initial Status of Change Request</em> task at the beginning of the workflow (figure 9). In the object method section of the task maintenance screen (figure 10) a custom class and method is selected. The called method calls the web service proxy to transmit the <em>change request id</em>. To be able to select your custom class from the workflow task it must implement the interfaces BI_OBJECT, BI_PRESISTENT and IF_WORKFLOW (figure 13). You can find more information regarding ABAP OO for workflow in the references section at the bottom of the article.</p><br /><br /><p align="justify">After successful activation of the Business Partner we can send the <em>Business Partner Id</em> to NetWeaver BPM. A new task was created after the <em>Set Status of Change Request</em> close to the end of the process (figure 11). In the task maintenance (figure 12) we assign a custom method that in turn uses the web service proxy to call NetWeaver BPM.</p><br /><br /><p align="justify"><img src="https://weblogs.sdn.sap.com/weblogs/images/251934038/Fig10_700x500.jpg" /><br /><br /> <br /><b>Figure 11: Create business partner workflow with custom task</b></p><br /><br /><p align="justify"><img src="https://weblogs.sdn.sap.com/weblogs/images/251934038/Fig10a_700x500.jpg" /><br /><br /> <br /><b>Figure 12: Custom task maintenance</b></p><br /><br /><p align="justify"><img src="https://weblogs.sdn.sap.com/weblogs/images/251934038/Fig11_700x500.jpg" /><br /><br /> <br /><b>Figure 13: Interface tab of the class that gets called from the custom workflow task</b></p><br /><br /><p align="justify"><img border="0" alt="" align="absMiddle" src="http://wiki.sdn.sap.com/wiki/images/icons/emoticons/information.gif" width="16" height="16" /><br /><br /> <br /><b>Test your scenario – complete process</b><br /><br /> <br />You can now call the inbound SAP Master Data Governance web service. In turn a change request will be created. The <em>change request id</em> will be transmitted to NetWeaver BPM. After approval and activation of the Business Partner the <em>Business Partner id</em> is transmitted to NetWeaver BPM. You can use transaction sxi_monitor to view incoming and outgoing messages.</p><br /><br /><h5 align="justify"><a name="EnterpriseMasterDataManagement-Across-systemmasterdataprocessforsupplier-NetWeaverBPMimplementationconsiderations"></a>NetWeaver BPM implementation considerations</h5><br /><br /><p align="justify">While the focus of this article is not so much on NetWeaver BPM, but more on the interfaces of SAP Master Data Governance one important aspect with regard to intermediate message events in NetWeaver BPM should be mentioned here. In NetWeaver BPM it is necessary to define a message correlation between the incoming messages from SAP Master Data Governance and the process instance in NetWeaver BPM. Any unique id (eg. process id) can be used for this purpose. The unique id can be send as part of the <em>BusinessPartnerSUITEBulkReplicateRequest_In</em> web service call, for example in the message header. Subsequent calls from SAP Master Data Governance to NetWeaver BPM can then transmit this unique id as part of the message payload. NetWeaver BPM uses the unique id to find the right process instance for the incoming message.</p><br /><br /><h4 align="justify"><a name="EnterpriseMasterDataManagement-Across-systemmasterdataprocessforsupplier-Summary"></a>Summary</h4><br /><br /><p align="justify">In this article it was shown how SAP Master Data Governance can be used as part of a NetWeaver BPM cross-system master data process. The article also highlights how the capabilities of the build in governance processes can be easily extended using SAP NetWeaver BPM. The combination of SAP Master Data Governance with SAP NetWeaver BPM and SAP NetWeaver Master Data Management addresses a wide range of scenarios in the area of Enterprise Master Data Management.</p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-64156290932713282612012-02-08T10:28:00.001-08:002012-02-08T10:28:53.940-08:00Search In a MDM Repository<p>Following code snippet shows the step to search inside MDM repository. It searches the string inside field Vendors in the table Vendors under repository Vendor1 . </p> <pre>public class Connection {     private SimpleConnection simpleConnection;     private String serverName = " ";     private String repositoryName="Vendor1";     private String dbServerName = " ";     private DBMSType dbmsType = DBMSType.MS_SQL;     private RegionProperties dataRegion = new RegionProperties();     private String userSession;     private String repositorySession;     private String userName="Admin";     private String password="mdm";     private RepositorySchema schema;     private RepositoryIdentifier repositoryID;     public void getConnection() {         try {             if (simpleConnection == null) {                 simpleConnection =                     SimpleConnectionFactory.getInstance(serverName);             }         } catch (Exception e) {             //              }     }         public void closeConnection( )       {         //@@begin closeConnection()         try{             if(simpleConnection!=null){                 DestroySessionCommand destroySessionCommand=new DestroySessionCommand(simpleConnection);                 destroySessionCommand.setSession(userSession);                 destroySessionCommand.execute();                 userSession=null;                 simpleConnection.close();             }         }catch(Exception e){<br />//                    }         //@@end       }           public void getAuthenticatedUserSession( )       {         //@@begin getAuthenticatedUserSession()         /*             * Create and authenticate a new user session to an MDM repository             */            repositoryID=new RepositoryIdentifier(repositoryName,dbServerName,dbmsType);            CreateUserSessionCommand createUserSessionCommand=new CreateUserSessionCommand(simpleConnection);            createUserSessionCommand.setRepositoryIdentifier(repositoryID);            createUserSessionCommand.setDataRegion(dataRegion);            try {                createUserSessionCommand.execute();                    userSession=createUserSessionCommand.getUserSession();// Get the session identifier               /* Authenticate User Session */            TrustedUserSessionCommand trustedUserSessionCommand=new TrustedUserSessionCommand(simpleConnection);            trustedUserSessionCommand.setUserName(userName);                      trustedUserSessionCommand.setSession(userSession);            try {                trustedUserSessionCommand.execute();                userSession=trustedUserSessionCommand.getSession();            } catch (CommandException e1) {                /* Trusted Connection is not accepted */                AuthenticateUserSessionCommand authenticateUserSessionCommand=new AuthenticateUserSessionCommand(simpleConnection);                authenticateUserSessionCommand.setSession(userSession);                authenticateUserSessionCommand.setUserName(userName);                authenticateUserSessionCommand.setUserPassword(password);                authenticateUserSessionCommand.execute();                    }                   SetUnicodeNormalizationCommand unicodeNormalizationCommand=new SetUnicodeNormalizationCommand(simpleConnection);            unicodeNormalizationCommand.setSession(userSession);            unicodeNormalizationCommand.setNormalizationType(SetUnicodeNormalizationCommand.NORMALIZATION_COMPOSED);            unicodeNormalizationCommand.execute();            }catch (CommandException e2) {<br />//                         }       }           public void setRegionProperties( )       {         //@@begin setRegionProperties()         dataRegion.setRegionCode("engUSA");         // Set the locale on data region         dataRegion.setLocale(new Locale("en", "US"));         // Set the name of data region         dataRegion.setName("US");         //@@end       }     public void setRepositoryInfo( java.lang.String repositoryName, java.lang.String userID, java.lang.String password )      {        //@@begin setRepositoryInfo()        this.repositoryName=repositoryName;        this.userName=userID;        this.password=password;            //@@end      }           public void getAuthenticatedRepositorySession( )     {       //@@begin getAuthenticatedRepositorySession()           try{               CreateRepositorySessionCommand repositorySessionCommand=new CreateRepositorySessionCommand(simpleConnection);               repositorySessionCommand.setRepositoryIdentifier(repositoryID);               repositorySessionCommand.execute();               repositorySession=repositorySessionCommand.getRepositorySession();                       AuthenticateRepositorySessionCommand authenticatedRepositorySession=new AuthenticateRepositorySessionCommand(simpleConnection);               authenticatedRepositorySession.setSession(repositorySession);               authenticatedRepositorySession.setUserName(userName);               authenticatedRepositorySession.setUserPassword(password);               authenticatedRepositorySession.execute();                       GetRepositorySchemaCommand repositroySchemaCommand=new GetRepositorySchemaCommand(simpleConnection);               repositroySchemaCommand.setSession(repositorySession);               repositroySchemaCommand.execute();               schema=repositroySchemaCommand.getRepositorySchema();                           }catch(CommandException e){<br />//                        }catch(Exception e){<br />//                        }               //@@end     }         public com.sap.mdm.ids.FieldId getFieldID( java.lang.String tableName, java.lang.String fieldCode )       {         //@@begin getFieldID()             return schema.getField(tableName,fieldCode).getId();             //@@end       }           public com.sap.mdm.ids.TableId getTableID( java.lang.String tableName )       {         //@@begin getTableID()         return schema.getTable(tableName).getId();         //@@end       }           public void searchRepository() {             //@@begin searchRepository()             ResultDefinition resultDef =                 new ResultDefinition(schema.getTable("Vendors").getId());             resultDef.addSelectField(schema.getField("Vendors", "Name").getId());             //resultDef.addSelectField(new FieldId(15));             FieldSearchDimension searchDimension =                 new FieldSearchDimension(                     schema.getField("Vendors", "Name").getId());             TextSearchConstraint constraint =                 new TextSearchConstraint("ABC", TextSearchConstraint.CONTAINS);             Search search = new Search(schema.getTable("Vendors").getId());             //search.addSearchItem(searchDimension,constraint);             RetrieveLimitedRecordsCommand limitedRecordsCommand =                 new RetrieveLimitedRecordsCommand(simpleConnection);             limitedRecordsCommand.setSearch(search);             limitedRecordsCommand.setSession(userSession);             limitedRecordsCommand.setResultDefinition(resultDef);             try {                 limitedRecordsCommand.execute();             } catch (CommandException e) {                 //                          }             //return limitedRecordsCommand.getRecords();             RecordResultSet recordSet = limitedRecordsCommand.getRecords();             String recordAsString = null;             String fieldValue = null;             for (int i = 0; i < recordSet.getCount(); i++) {                 recordAsString = "";                 FieldId[] returnedFields = recordSet.getRecord(i).getFields();                 for (int j = 0; j < returnedFields.length; j++) {                     if (recordSet                         .getRecord(i)                         .getFieldValue(returnedFields[j])                         .isNull()) {                         fieldValue = " |";                     } else {                         fieldValue =                             recordSet.getRecord(i).getFieldValue(returnedFields[j])                                 + "|";                     }                                         recordAsString += fieldValue;                     System.out.println(recordAsString);                 }             }         }                 public static void main (String[] args)                 {             Connection test=new Connection();             test.getConnection();             test.setRegionProperties();             test.setRepositoryInfo("Vendor1","Admin","mdm");             test.getAuthenticatedUserSession();             test.getAuthenticatedRepositorySession();             test.searchRepository();             test.closeconnection();              }<br /><br />}</pre> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-77369217229976696392012-02-08T10:25:00.003-08:002012-02-08T10:25:56.535-08:00Code to Get List of Validation in a Table<p>Following code snippet finds out the list of Validation from a Table. </p> <pre>package com.sap.infosys.mdm.validationcheck;<br /><br />import com.sap.mdm.commands.AuthenticateUserSessionCommand;<br />import com.sap.mdm.commands.CommandException;<br />import com.sap.mdm.commands.CreateUserSessionCommand;<br />import com.sap.mdm.commands.DestroySessionCommand;<br />import com.sap.mdm.commands.GetRepositoryRegionListCommand;<br />import com.sap.mdm.data.RegionProperties;<br />import com.sap.mdm.ids.TableId;<br />import com.sap.mdm.net.ConnectionException;<br />import com.sap.mdm.net.ConnectionPool;<br />import com.sap.mdm.net.ConnectionPoolFactory;<br />import com.sap.mdm.server.DBMSType;<br />import com.sap.mdm.server.RepositoryIdentifier;<br />import com.sap.mdm.validation.ValidationProperties;<br />import com.sap.mdm.validation.ValidationPropertiesResult;<br />import com.sap.mdm.validation.commands.RetrieveValidationsCommand;<br /><br /><br />public class GetListOfValidations {     public static void main(String[] args) {         // create connection pool to a MDM server         String serverName = " ";         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 = "Vendor1";         String dbmsName = " ";         RepositoryIdentifier reposId =             new RepositoryIdentifier(repositoryName, dbmsName, DBMSType.MS_SQL);         // 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 = "Admin";         String userPassword = "mdm";         AuthenticateUserSessionCommand authCommand =             new AuthenticateUserSessionCommand(connections);         authCommand.setSession(sessionId);         authCommand.setUserName(userName);         authCommand.setUserPassword(userPassword);         try {             authCommand.execute();         } catch (CommandException e) {             e.printStackTrace();             return;         }         // the main table, hard-coded         TableId mainTableId = new TableId(1);         // Get the list of validations         RetrieveValidationsCommand objRtvVldCmd =             new RetrieveValidationsCommand(connections);         // set the user session         objRtvVldCmd.setSession(sessionId);         // get validation for the following tables.         objRtvVldCmd.setTableId(mainTableId);                 try {             objRtvVldCmd.execute();         } catch (CommandException e) {             e.printStackTrace();             return;         }         ValidationPropertiesResult objVldPropRslt =             objRtvVldCmd.getValidationPropertiesResult();         ValidationProperties[] validations = objVldPropRslt.getValidations();         //disply --> Validation ID | error/warning message | Validation Name         for (int i = 0; i < validations.length; i++) {             System.out.println(                 validations[i].getId()                     + " | "                     + validations[i].getMessage()                     + " | "                     + validations[i].getName());         }     }<br /><br />}</pre> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-472251800599946732012-02-08T10:25:00.001-08:002012-02-08T10:25:15.316-08:00A Class worth exploring for handling special characters in MDM<p>While development was going at full pace ,a small hurdle in form of special characters turned out to be a real speed breaker.The situtaion was that in MDM repository some field say Name contained  special chracters(Õ , û  ,Û)  in  other language like Hungarian,German ,French etc.Problem was I  logged into the Repository with english language with MDM JAVA API and  API was retrieving undesired value(O??,u??,U??) from the data manager .Although the Name string seems absolutely fine in the Data Manager.In short -value in MDM Data Manager for field name was Õ û  Û and output from API was O??u??U??</p> <p>To my rescue came this class which is worth exploring when you have a situation like above</p> <p> Class SetUnicodeNormalizationCommand</p> <p> After you establish your connection to the server through API and Authenticate User Session ,you need to work with this class.</p> <p>Connection to server would return an object of type ConnectionPool (call it connection)and UserSession authentication would return a string (call it session).Now write this piece of code</p> <p>SetUnicodeNormalizationCommand cmd = new SetUnicodeNormalizationCommand(connection);</p> <p>cmd.setSession(session);</p> <p>cmd.setNormalizationType(SetUnicodeNormalizationCommand.NORMALIZATION_COMPOSED);</p> <p>cmd.execute();</p> <p>This class will keep the special characters retrieval intact. </p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-21084980579124866542012-02-08T10:12:00.001-08:002012-02-08T10:12:29.942-08:00SRM-MDM Catalog version compatibility<h4>Purpose</h4> <p>The main objective of this page is to explain the compatibility between <b>SRM-MDM Catalog</b>, <b>Java API</b> and <b>MDM Server</b>. </p> <h4><a name="SRM-MDMCatalogversioncompatibility-Overview"></a>Overview</h4> <p>The application <b>SRM-MDM Catalog</b> is dependent on other two main applications or components, which are <b>MDM Server</b> and <b>MDM Java API</b>. The <b>compatibility</b> of these applications is informed in the <b>SRM-MDM Release Notes</b> available in <b>SAP Service Marketplace (Software Download Center)</b>:</p> <p><a href="https://service.sap.com/swdc">https://service.sap.com/swdc</a></p> <p>This document will present how to <b>check</b> the <b>versions</b> of each of these applications and it will also explain how to <b>correct</b> the compatibility in case there is a version mismatch. </p> <h4><a name="SRM-MDMCatalogversioncompatibility-Identifyingtheversionsofyourapplications"></a>Identifying the versions of your applications</h4> <p>You can get this information by accessing the <b>J2EE component info</b> page (http://<J2EE_SERVER>:<PORT>/sap/monitoring/ComponentInfo).</p> <p>The <b>Component name</b> of SRM-MDM is <b>SRM_MDM_CAT</b> and the <b>Component name</b> of MDM Java API is <b>MDM_JAVA_API</b>.</p> <p>In order to get the information of your <b>MDM Server</b>, please follow the steps below:</p> <p>1) Open the <b>SRM MDM utilities</b>:</p> <p>http://<J2EE_SERVER>:<PORT>/webdynpro/dispatcher/sap.com/tc~mdm~srmcat~uiutil/Utilities</p> <p>2) Choose "<b>Connection Test</b>"</p> <p>3) Provide the host name or IP of your MDM server (MDM server)</p> <p>4) Click on "<b>Start Testing</b>" button</p> <p><img src="http://wiki.sdn.sap.com/wiki/download/attachments/257754671/conn+test.JPG?version=1&modificationDate=1321270683339" /></p> <h4><a name="SRM-MDMCatalogversioncompatibility-Checkingthecompatibilityofyourapplications"></a>Checking the compatibility of your applications</h4> <p>Find the <b>latest release note</b> according to your <b>SRM-MDM Support Package (SP)</b> and open this note.</p> <p>You will find in the note the <b>SRM-MDM Catalog SP</b> and Patch as well as the <b>MDM Server SP</b>. The version of <b>MDM Java API</b> should be the same as <b>MDM Server</b> since they are distributed together, as part of the same release.</p> <p>See the image below for more information:</p> <p><img src="http://wiki.sdn.sap.com/wiki/download/attachments/257754671/att1.png?version=1&modificationDate=1320856102209" /></p> <p>If the version of these three components is not compatible then it is probable that you will face issues during the usage of <b>SRM-MDM Catalog</b>.</p> <p>Example of <b>compatible versions</b>:</p> <p>SAP Note <a href="https://service.sap.com/sap/support/notes/1505367">1505367</a> mention SRM-MDM Catalog 3.0 SP08 Patch 01 is compatible with MDM Server 7.1 SP05.</p> <p>Your <b>component versions</b>:</p> <p>SRM_MDM_CAT:3.0 SP8 (1000.3.0.8.123.123456789)</p> <p>MDM_JAVA_API: 710 SP5 (1000.710.0.5.123.123456789)</p> <p>MDM Server: MDM Server 7.1 SP5 (Check)</p> <p>Example of <b>incompatible versions</b>:</p> <p>SAP Note <a href="https://service.sap.com/sap/support/notes/1642907">1642907</a> mention SRM-MDM Catalog 3.0 SP11 Patch 01 is compatible with MDM Server 7.1 SP07.</p> <p>Your <b>component versions</b>:</p> <p>SRM_MDM_CAT:3.0 SP11 (1000.3.0.8.123.123456789)</p> <p>MDM_JAVA_API: 710 SP4 (1000.710.0.4.123.123456789)</p> <p>MDM Server: MDM Server 7.1 SP4 (Check)</p> <h4><a name="SRM-MDMCatalogversioncompatibility-Solvingtheincompatibilityofyourapplications"></a>Solving the incompatibility of your applications</h4> <p>In case you have a <b>version mismatch</b> you should update your applications according to <b>the latest release note</b> for <b>SRM-MDM</b>. In case you don’t want to update your <b>MDM Server</b> than use the latest release note according to your SRM-MDM SP. Note that <b>some errors</b> are corrected in <b>higher releases</b> so it is not guaranteed that your issue will be solved by updating to the latest release of your SP.  </p> <p>In order to update your application components go to Software Download Center, click on "<b>Support Packages and Patches</b>" (top menu) and then click on "<b>Search for Support Packages and Patches</b>" (left menu). Search for "<b>SAP MDM CATALOG</b>" and click on oyr SRM-MDM version. For more information please check note <a href="https://service.sap.com/sap/support/notes/1476694">1476694</a>.</p> <h3><a name="SRM-MDMCatalogversioncompatibility-RelatedContent"></a>Related Content</h3> <h4><a name="SRM-MDMCatalogversioncompatibility-RelatedDocuments"></a>Related Documents</h4> <h4><a name="SRM-MDMCatalogversioncompatibility-RelatedNotes"></a>Related Notes</h4> <p><b>SAP Note</b>: <a href="https://service.sap.com/sap/support/notes/1650896">1650896</a> - <b>SRM-MDM “Login Failed” error</b></p> <p><b>SAP Note</b>: <a href="https://service.sap.com/sap/support/notes/1476694">1476694</a> - <b>Change in SRM-MDM Catalog 3.0 components in SMP</b></p> <p><b>SAP Note</b>: <a href="https://service.sap.com/sap/support/notes/1663002">1663002</a> - <b>SRM-MDM Catalog "Repository Locked"</b></p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-91482081834586593882012-02-08T10:11:00.003-08:002012-02-08T10:11:35.084-08:00Code to Get List of Validation in a Table<p>Following code snippet finds out the list of Validation from a Table. </p> <pre>package com.sap.infosys.mdm.validationcheck;<br /><br />import com.sap.mdm.commands.AuthenticateUserSessionCommand;<br />import com.sap.mdm.commands.CommandException;<br />import com.sap.mdm.commands.CreateUserSessionCommand;<br />import com.sap.mdm.commands.DestroySessionCommand;<br />import com.sap.mdm.commands.GetRepositoryRegionListCommand;<br />import com.sap.mdm.data.RegionProperties;<br />import com.sap.mdm.ids.TableId;<br />import com.sap.mdm.net.ConnectionException;<br />import com.sap.mdm.net.ConnectionPool;<br />import com.sap.mdm.net.ConnectionPoolFactory;<br />import com.sap.mdm.server.DBMSType;<br />import com.sap.mdm.server.RepositoryIdentifier;<br />import com.sap.mdm.validation.ValidationProperties;<br />import com.sap.mdm.validation.ValidationPropertiesResult;<br />import com.sap.mdm.validation.commands.RetrieveValidationsCommand;<br /><br /><br />public class GetListOfValidations {     public static void main(String[] args) {         // create connection pool to a MDM server         String serverName = " ";         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 = "Vendor1";         String dbmsName = " ";         RepositoryIdentifier reposId =             new RepositoryIdentifier(repositoryName, dbmsName, DBMSType.MS_SQL);         // 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 = "Admin";         String userPassword = "mdm";         AuthenticateUserSessionCommand authCommand =             new AuthenticateUserSessionCommand(connections);         authCommand.setSession(sessionId);         authCommand.setUserName(userName);         authCommand.setUserPassword(userPassword);         try {             authCommand.execute();         } catch (CommandException e) {             e.printStackTrace();             return;         }         // the main table, hard-coded         TableId mainTableId = new TableId(1);         // Get the list of validations         RetrieveValidationsCommand objRtvVldCmd =             new RetrieveValidationsCommand(connections);         // set the user session         objRtvVldCmd.setSession(sessionId);         // get validation for the following tables.         objRtvVldCmd.setTableId(mainTableId);                 try {             objRtvVldCmd.execute();         } catch (CommandException e) {             e.printStackTrace();             return;         }         ValidationPropertiesResult objVldPropRslt =             objRtvVldCmd.getValidationPropertiesResult();         ValidationProperties[] validations = objVldPropRslt.getValidations();         //disply --> Validation ID | error/warning message | Validation Name         for (int i = 0; i < validations.length; i++) {             System.out.println(                 validations[i].getId()                     + " | "                     + validations[i].getMessage()                     + " | "                     + validations[i].getName());         }     }<br /><br />}  </pre> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-6652769466048434932012-02-08T10:11:00.001-08:002012-02-08T10:11:03.261-08:00CreateRecordCommand Vs CreateRecordsCommand<p>Given the shortcomings of Import Manager of rejecting a complete input excel spreadsheet, in case of even a single spurious record and lack of comprehensive error reporting to track reasons for file rejection or all errors. All these and more combined together, gave me a reason to develop a prototype, which overcomes shortcomings of using Import Manager to import data into MDM repository using Excel spreadsheets</p> <p>In this blog I will discuss two important API classes, CreateRecordCommand and CreateRecordsCommand , and in following blogs will detail the complete design using which you can have your own customised Import Manager, capable of Importing data from excel spreadsheet into MDM repository with comprehensive error reporting.</p> <p>Browsing through the MDM Java API documentation I found two classes for creating records in the repository:</p> <ul> <li>CreateRecordCommand & </li> <li>CreateRecordsCommand </li> </ul> <p> While the first command is used to create individual records in the repository, the following CreateRecordsCommand is used for mass record creation.</p> <p>It is a single Record Object which is a required parameter for CreateRecordCommand, we need to set an array of Record objects (records for mass creation) for CreateRecordsCommand. </p> <p>Using CreateRecordCommand you can get 'recordId' of the newly created record but using CreateRecordsCommand the API provides us various methods to retrieve</p> <ul> <li>FailedRecordMessages </li> <li>Succeeded Record recordIds </li> <li>Failed and Succeeded Record Arrays, containing corresponding indexes in the records array initially passed into CreateRecordsCommand </li> <li>Array of all records passed into CreateRecordsCommand </li> </ul> <p>Please use the link of MDM Java API javadoc link <a href="http://help.sap.com/javadocs/MDM/SP06P2/index.html">http://help.sap.com/javadocs/MDM/SP06P2/index.html</a> to find out specific methods for CreateRecordsCommand, which can be used to retrieve specific information in order to generate better reports with exception/error messages.</p> <p>Signing off for now....... till my next page in this series.</p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-72991736256660113732012-02-08T10:07:00.001-08:002012-02-08T10:07:58.130-08:00Search In a MDM Repository<p>Following code snippet shows the step to search inside MDM repository. It searches the string inside field Vendors in the table Vendors under repository Vendor1 . </p> <pre>public class Connection {     private SimpleConnection simpleConnection;     private String serverName = " ";     private String repositoryName="Vendor1";     private String dbServerName = " ";     private DBMSType dbmsType = DBMSType.MS_SQL;     private RegionProperties dataRegion = new RegionProperties();     private String userSession;     private String repositorySession;     private String userName="Admin";     private String password="mdm";     private RepositorySchema schema;     private RepositoryIdentifier repositoryID;     public void getConnection() {         try {             if (simpleConnection == null) {                 simpleConnection =                     SimpleConnectionFactory.getInstance(serverName);             }         } catch (Exception e) {             //              }     }         public void closeConnection( )       {         //@@begin closeConnection()         try{             if(simpleConnection!=null){                 DestroySessionCommand destroySessionCommand=new DestroySessionCommand(simpleConnection);                 destroySessionCommand.setSession(userSession);                 destroySessionCommand.execute();                 userSession=null;                 simpleConnection.close();             }         }catch(Exception e){<br />//                    }         //@@end       }           public void getAuthenticatedUserSession( )       {         //@@begin getAuthenticatedUserSession()         /*             * Create and authenticate a new user session to an MDM repository             */            repositoryID=new RepositoryIdentifier(repositoryName,dbServerName,dbmsType);            CreateUserSessionCommand createUserSessionCommand=new CreateUserSessionCommand(simpleConnection);            createUserSessionCommand.setRepositoryIdentifier(repositoryID);            createUserSessionCommand.setDataRegion(dataRegion);            try {                createUserSessionCommand.execute();                    userSession=createUserSessionCommand.getUserSession();// Get the session identifier               /* Authenticate User Session */            TrustedUserSessionCommand trustedUserSessionCommand=new TrustedUserSessionCommand(simpleConnection);            trustedUserSessionCommand.setUserName(userName);                      trustedUserSessionCommand.setSession(userSession);            try {                trustedUserSessionCommand.execute();                userSession=trustedUserSessionCommand.getSession();            } catch (CommandException e1) {                /* Trusted Connection is not accepted */                AuthenticateUserSessionCommand authenticateUserSessionCommand=new AuthenticateUserSessionCommand(simpleConnection);                authenticateUserSessionCommand.setSession(userSession);                authenticateUserSessionCommand.setUserName(userName);                authenticateUserSessionCommand.setUserPassword(password);                authenticateUserSessionCommand.execute();                    }                   SetUnicodeNormalizationCommand unicodeNormalizationCommand=new SetUnicodeNormalizationCommand(simpleConnection);            unicodeNormalizationCommand.setSession(userSession);            unicodeNormalizationCommand.setNormalizationType(SetUnicodeNormalizationCommand.NORMALIZATION_COMPOSED);            unicodeNormalizationCommand.execute();            }catch (CommandException e2) {<br />//                         }       }           public void setRegionProperties( )       {         //@@begin setRegionProperties()         dataRegion.setRegionCode("engUSA");         // Set the locale on data region         dataRegion.setLocale(new Locale("en", "US"));         // Set the name of data region         dataRegion.setName("US");         //@@end       }     public void setRepositoryInfo( java.lang.String repositoryName, java.lang.String userID, java.lang.String password )      {        //@@begin setRepositoryInfo()        this.repositoryName=repositoryName;        this.userName=userID;        this.password=password;            //@@end      }           public void getAuthenticatedRepositorySession( )     {       //@@begin getAuthenticatedRepositorySession()           try{               CreateRepositorySessionCommand repositorySessionCommand=new CreateRepositorySessionCommand(simpleConnection);               repositorySessionCommand.setRepositoryIdentifier(repositoryID);               repositorySessionCommand.execute();               repositorySession=repositorySessionCommand.getRepositorySession();                       AuthenticateRepositorySessionCommand authenticatedRepositorySession=new AuthenticateRepositorySessionCommand(simpleConnection);               authenticatedRepositorySession.setSession(repositorySession);               authenticatedRepositorySession.setUserName(userName);               authenticatedRepositorySession.setUserPassword(password);               authenticatedRepositorySession.execute();                       GetRepositorySchemaCommand repositroySchemaCommand=new GetRepositorySchemaCommand(simpleConnection);               repositroySchemaCommand.setSession(repositorySession);               repositroySchemaCommand.execute();               schema=repositroySchemaCommand.getRepositorySchema();                           }catch(CommandException e){<br />//                        }catch(Exception e){<br />//                        }               //@@end     }         public com.sap.mdm.ids.FieldId getFieldID( java.lang.String tableName, java.lang.String fieldCode )       {         //@@begin getFieldID()             return schema.getField(tableName,fieldCode).getId();             //@@end       }           public com.sap.mdm.ids.TableId getTableID( java.lang.String tableName )       {         //@@begin getTableID()         return schema.getTable(tableName).getId();         //@@end       }           public void searchRepository() {             //@@begin searchRepository()             ResultDefinition resultDef =                 new ResultDefinition(schema.getTable("Vendors").getId());             resultDef.addSelectField(schema.getField("Vendors", "Name").getId());             //resultDef.addSelectField(new FieldId(15));             FieldSearchDimension searchDimension =                 new FieldSearchDimension(                     schema.getField("Vendors", "Name").getId());             TextSearchConstraint constraint =                 new TextSearchConstraint("ABC", TextSearchConstraint.CONTAINS);             Search search = new Search(schema.getTable("Vendors").getId());             //search.addSearchItem(searchDimension,constraint);             RetrieveLimitedRecordsCommand limitedRecordsCommand =                 new RetrieveLimitedRecordsCommand(simpleConnection);             limitedRecordsCommand.setSearch(search);             limitedRecordsCommand.setSession(userSession);             limitedRecordsCommand.setResultDefinition(resultDef);             try {                 limitedRecordsCommand.execute();             } catch (CommandException e) {                 //                          }             //return limitedRecordsCommand.getRecords();             RecordResultSet recordSet = limitedRecordsCommand.getRecords();             String recordAsString = null;             String fieldValue = null;             for (int i = 0; i < recordSet.getCount(); i++) {                 recordAsString = "";                 FieldId[] returnedFields = recordSet.getRecord(i).getFields();                 for (int j = 0; j < returnedFields.length; j++) {                     if (recordSet                         .getRecord(i)                         .getFieldValue(returnedFields[j])                         .isNull()) {                         fieldValue = " |";                     } else {                         fieldValue =                             recordSet.getRecord(i).getFieldValue(returnedFields[j])                                 + "|";                     }                                         recordAsString += fieldValue;                     System.out.println(recordAsString);                 }             }         }                 public static void main (String[] args)                 {             Connection test=new Connection();             test.getConnection();             test.setRegionProperties();             test.setRepositoryInfo("Vendor1","Admin","mdm");             test.getAuthenticatedUserSession();             test.getAuthenticatedRepositorySession();             test.searchRepository();             test.closeconnection();              }<br /><br />}</pre> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-74407660156138639272012-02-08T10:06:00.001-08:002012-02-08T10:07:20.954-08:00A Class worth exploring for handling special characters in MDM<p align="justify">While development was going at full pace ,a small hurdle in form of special characters turned out to be a real speed breaker.The situtaion was that in MDM repository some field say Name contained  special chracters(Õ , û  ,Û)  in  other language like Hungarian,German ,French etc.Problem was I  logged into the Repository with english language with MDM JAVA API and  API was retrieving undesired value(O??,u??,U??) from the data manager .Although the Name string seems absolutely fine in the Data Manager.In short -value in MDM Data Manager for field name was Õ û  Û and output from API was O??u??U??</p> <p align="justify">To my rescue came this class which is worth exploring when you have a situation like above</p> <p align="justify"> Class SetUnicodeNormalizationCommand</p> <p align="justify"> After you establish your connection to the server through API and Authenticate User Session ,you need to work with this class.</p> <p align="justify">Connection to server would return an object of type ConnectionPool (call it connection)and UserSession authentication would return a string (call it session).Now write this piece of code</p> <p align="justify">SetUnicodeNormalizationCommand cmd = new SetUnicodeNormalizationCommand(connection);</p> <p align="justify">cmd.setSession(session);</p> <p align="justify">cmd.setNormalizationType(SetUnicodeNormalizationCommand.NORMALIZATION_COMPOSED);</p> <p align="justify">cmd.execute();</p> <p align="justify">This class will keep the special characters retrieval intact. </p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-49522091148339444152012-02-08T09:54:00.001-08:002012-02-08T09:54:32.063-08:00How do you implement a MDM Connection Help Class?<ul> <li>In the exmaple Master Data Data Read class we used another class, ZCL_MDM_CONN_POOL_ROOT, to establish the connection to MDM.  This is just a reusable utility class that caches the API connection and contains logic to map the SAP logon langauge to the MDM Language. </li> <li>The complete source code of this class can be <a href="http://abap-sdn-examples-tpj.googlecode.com/files/CLAS_ZCL_MDM_CONN_POOL_ROOT.slnk">downloaded here</a>. </li> <li>Class Properties: <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/38676/MDM_Pool_Properties.jpg?version=1&modificationDate=1184696888603" /></li> <li>Class Private Types: <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/38676/MDM_Pool_Private_Types.jpg?version=1&modificationDate=1184696888614" /></li> <li>Class Attributes: <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/38676/MDM_Pool_Attributes.jpg?version=1&modificationDate=1184696865663" /></li> <li>Class Methods: <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/38676/MDM_Pool_Methods.jpg?version=1&modificationDate=1184696888623" /></li> <li>GET_MDM_CONNECTION <pre>METHOD get_mdm_connection.<br />*@78\QImporting@ LANGUAGE TYPE SYLANGU DEFAULT SY-LANGU<br />*@78\QImporting@ UNAME TYPE SYUNAME DEFAULT SY-UNAME<br />*@78\QImporting@ REPOSITORY TYPE MDM_LOG_OBJECT_NAME<br />*@78\QImporting@ USE_CONNECTION_POOL TYPE BOOLEAN DEFAULT ABAP_TRUE<br />*@7B\QReturning@ VALUE( API ) TYPE REF TO CL_MDM_GENERIC_API<br />*@03\QException@ CX_MDM_MAIN_EXCEPTION<br /><br /> IF use_connection_pool = abap_true.<br /> DATA wa_api LIKE LINE OF api_cache.<br /> READ TABLE api_cache INTO wa_api<br /> WITH KEY language = language<br /> uname = uname<br /> repository = repository.<br /> IF sy-subrc = 0.<br />****Cached Connection Record is found, make sure the API reference is bound<br /> IF wa_api-api IS BOUND.<br /> api = wa_api-api.<br /> GET TIME STAMP FIELD wa_api-last_access.<br /> MODIFY TABLE api_cache FROM wa_api.<br /> ELSE.<br />****Not bound - Delete the Connection Record and Create a New Instance<br /> DELETE api_cache WHERE language = language<br /> AND uname = uname<br /> AND repository = repository.<br /> api = zcl_mdm_conn_pool_root=>create_mdm_connection(<br /> language = language<br /> uname = uname<br /> repository = repository<br /> use_connection_pool = use_connection_pool ).<br /> ENDIF.<br /> ELSE.<br />****No Cached Record - Create a New Instance<br /> api = zcl_mdm_conn_pool_root=>create_mdm_connection(<br /> language = language<br /> uname = uname<br /> repository = repository<br /> use_connection_pool = use_connection_pool ).<br /> ENDIF.<br /> ELSE.<br />****By Pass the Connection Pool and create a one-off Instance<br /> api = zcl_mdm_conn_pool_root=>create_mdm_connection(<br /> language = language<br /> uname = uname<br /> repository = repository<br /> use_connection_pool = use_connection_pool ).<br /> ENDIF.<br /><br />ENDMETHOD.</pre><br /> </li><br /><br /> <li>CREATE_MDM_CONNECTION <br /> <pre>METHOD create_mdm_connection.<br />*@78\QImporting@ LANGUAGE TYPE SYLANGU DEFAULT SY-LANGU<br />*@78\QImporting@ UNAME TYPE SYUNAME DEFAULT SY-UNAME<br />*@78\QImporting@ REPOSITORY TYPE MDM_LOG_OBJECT_NAME<br />*@78\QImporting@ USE_CONNECTION_POOL TYPE BOOLEAN DEFAULT ABAP_TRUE<br />*@7B\QReturning@ VALUE( API ) TYPE REF TO CL_MDM_GENERIC_API<br />*@03\QException@ CX_MDM_MAIN_EXCEPTION<br /><br /> DATA mdm_language TYPE mdm_cdt_language_code.<br /> mdm_language = zcl_mdm_conn_pool_root=>expand_mdm_language( language ).<br /><br />**** Instantiate the API with our repository key from the dialog<br /> CREATE OBJECT api<br /> EXPORTING<br /> iv_log_object_name = repository.<br />****Connect to the Repository<br /> api->mo_accessor->connect( mdm_language ).<br /><br /> IF use_connection_pool = abap_true.<br /> DATA wa_api LIKE LINE OF api_cache.<br /> wa_api-api = api.<br /> wa_api-language = language.<br /> wa_api-uname = uname.<br /> wa_api-repository = repository.<br /> GET TIME STAMP FIELD wa_api-last_access.<br /> INSERT wa_api INTO TABLE api_cache.<br /> ENDIF.<br /><br />ENDMETHOD.</pre><br /> </li><br /><br /> <li>EXPAND_MDM_LANGUAGE <br /> <pre>METHOD expand_mdm_language.<br />*@78\QImporting@ LANGUAGE TYPE SYLANGU DEFAULT SY-LANGU Language Key of Current Text Environment<br />*@7B\QReturning@ VALUE( MDM_LANGUAGE ) TYPE MDM_CDT_LANGUAGE_CODE MDM: CDT language code<br /><br /> CASE language.<br /> WHEN c_english.<br /> mdm_language-language = 'eng'.<br /> mdm_language-country = 'US'.<br /> mdm_language-region = 'USA'.<br /> when c_german.<br /> mdm_language-language = 'ger'.<br /> mdm_language-country = 'DE'.<br />* mdm_language-region = 'USA'.<br /> WHEN OTHERS.<br />****Use the repository Default<br /> CLEAR mdm_language.<br /> ENDCASE.<br /><br />ENDMETHOD.</pre><br /> </li><br /></ul> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-59283181504678631822012-02-08T09:53:00.001-08:002012-02-08T09:53:43.727-08:00How do you implement the processing for Master Data Read Class Parameters?<ul> <li>In the example Master Data Read Class that we have been looking at, the processing is generic.  In other words there is no statement in the application coding that specifies the MDM Repository, Table or Field name.  The values are supplied via parameters so that this same class can be used for more than one Master Data Characteristic. </li> <li>You can see the area where you can supply these parameters in the following screen shot. It is the field labeled Master Data Read Class Parameters: <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/38675/Master_Data_Read_Class.jpg?version=1&modificationDate=1184690734582" /></li> <li>Although this is a single field, it can hold more than one value.  This is done by associating a data dictionary structure with the parameter inside the coding o the Master Data Read Class.  For the purposes of MDM Integration, you probably want a structure something like the one used this example implementation: <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/38675/ZRSMD_RS_S_MDM.jpg?version=1&modificationDate=1184690930923" /></li> <li>This way when you click on the pencil icon next the parameter field, a dialog pops up with the individual field selections as defined by your structure.  This even supports value input help for the individual fields. <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/38675/Read_Parameters.jpg?version=1&modificationDate=1184691007824" /></li> <li>So, how can this functionality be built into the Master Data Read Class?  It requires the implementation of another interface in your class - IF_RSMD_RS_GENERIC.  The sample Master Data Read Class, which can be <a href="http://abap-sdn-examples-tpj.googlecode.com/files/CLAS_ZCL_RSMD_RS_GENERIC_MDM.slnk">downloaded here</a>, contains an implementation of this interface for the purposes of processing the MDM Repository, Table and Field as parameters. </li> <li>In the Method GET_STRUCTURE_NAME, you must specify the name of the data dictionary sturcture you are going to use: <pre>method if_rsmd_rs_generic~get_structure_name.<br /> e_struct_name = 'ZRSMD_RS_S_MDM'.<br />endmethod.</pre><br /> </li><br /><br /> <li>But the most important processing are the GET and SET Methods. This is where you must supply the logic to map the data from the single parameter string into the individual fiels of your structure and vise versa: <br /> <pre>method if_rsmd_rs_generic~get_parameter.<br /> field-symbols: <l_s_struc> type zrsmd_rs_s_mdm.<br /> assign e_r_struc->* to <l_s_struc>.<br /> <l_s_struc> = o_s_gendomain.<br />endmethod.<br /><br />method if_rsmd_rs_generic~set_parameter.<br /> field-symbols: <l_s_struc> type zrsmd_rs_s_mdm.<br /> assign i_r_struc->* to <l_s_struc>.<br /> o_s_gendomain = <l_s_struc>.<br />endmethod.<br /><br />method if_rsmd_rs_generic~get_parameterstring.<br /> data: l_parameterstring type rsmdrclpa.<br /><br />*===Create the paramater string from the generic table structure===<br /> l_parameterstring+0(32) = o_s_gendomain-object_name.<br /> l_parameterstring+32(34) = o_s_gendomain-table .<br /> l_parameterstring+66(34) = o_s_gendomain-query_field.<br /><br />*===Export the parameter string====<br /> e_parameterstring = l_parameterstring.<br />endmethod.<br /><br />method if_rsmd_rs_generic~set_parameterstring.<br /> data: l_parameterstring type rsmdrclpa.<br /><br /> l_parameterstring = i_parameterstring.<br />*===Create the structure from the parameterstring===<br /> o_s_gendomain-object_name = l_parameterstring+0(32).<br /> o_s_gendomain-table = l_parameterstring+32(34).<br /> o_s_gendomain-query_field = l_parameterstring+66(34).<br />endmethod.</pre><br /> </li><br /></ul> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-83408412613593132542012-02-08T09:52:00.001-08:002012-02-08T09:52:35.927-08:00How do you implement the Master Data Read Class?<ul> <li>Master Data Read Classes have one basic requirement - They must implement the IF_RSMD_RS_ACCESS interface. </li> <li>There are several examples of how implement a Master Data Read Class provided by SAP - like CL_RSMD_RS_GENERIC_DOMAIN and CL_RSMD_RS_GENERIC_TABLE.  For creating your own custom Master Data Read Class, it probably makes sense to start by copying from one these existing classes and only adjusting for your specific processing. </li> <li>The complete source code (in SAPlink format) for an example implementation of a Master Data Read Class that uses MDM and the MDM ABAP APIs can be downloaded from <a href="http://abap-sdn-examples-tpj.googlecode.com/files/CLAS_ZCL_RSMD_RS_GENERIC_MDM.slnk">here</a>. </li> <li>Of all the methods in the sample class the most important from the standpoint of the MDM integration is the GET_TEXT method. The example implementation supports the retrieval of STRING or INTEGER based supporting values for a given key from MDM: </li> </ul> <pre>METHOD if_rsmd_rs_access~get_text.<br /><br /> DATA: object_name TYPE mdm_log_object_name,<br /> table TYPE mdm_table_code,<br /> query_field TYPE mdm_field_code,<br /> l_s_chavlinfo TYPE rsdm_s_chavlinfo,<br /> l_not_assigned TYPE rs_txtlg,<br /> l_initial_val TYPE rsd_chavl.<br /><br /> object_name = o_s_gendomain-object_name.<br /> table = o_s_gendomain-table.<br /> query_field = o_s_gendomain-query_field.<br /><br /><br /> DATA lt_result_set_definition TYPE mdm_field_list_table.<br /> DATA ls_result_set_definition LIKE LINE OF lt_result_set_definition.<br /> DATA lt_result_set TYPE mdm_result_set_table.<br /> DATA ls_result_set LIKE LINE OF lt_result_set.<br /> DATA lt_result_set2 TYPE mdm_result_set_table.<br /> DATA ls_result_set2 LIKE LINE OF lt_result_set2.<br /> DATA ls_remote_key_filter TYPE mdm_client_system_key_query.<br /> DATA api TYPE REF TO cl_mdm_generic_api.<br /> DATA language TYPE mdm_cdt_language_code.<br /> DATA keys TYPE mdm_keys.<br /> DATA exception TYPE REF TO cx_mdm_main_exception.<br /> FIELD-SYMBOLS <field_value> TYPE ANY.<br /> FIELD-SYMBOLS: <wa_field> TYPE mdm_cdt_text,<br /> <wa_string> TYPE string,<br /> <wa_integer> TYPE mdm_gdt_integervalue,<br /> <wa_taxonomy> TYPE mdm_taxonomy_entry,<br /> <wa_int> TYPE mdm_gdt_integervalue.<br /> TYPE-POOLS: mdmif.<br /><br /> TRY.<br /><br /> DATA wa_cache LIKE LINE OF me->data_cache.<br /> READ TABLE data_cache INTO wa_cache<br /> WITH KEY object_name = object_name<br /> table = table<br /> query_field = query_field.<br /> IF sy-subrc = 0.<br /> keys = wa_cache-keys.<br /> lt_result_set = wa_cache-lt_result_set.<br /> ELSE.<br /><br /> api = zcl_mdm_conn_pool_root=>get_mdm_connection( repository = object_name ).<br /><br /> DATA: result_set TYPE mdm_search_result_table.<br /> CALL METHOD api->mo_core_service->query<br /> EXPORTING<br /> iv_object_type_code = table<br />* iv_hits_max = 1<br /> IMPORTING<br /> et_result_set = result_set.<br /><br />****The results of a query only return the record keys - no details<br />****We then have to use a call to the method RETRIEVE to read<br />****the record details.<br /> DATA: result TYPE mdm_search_result.<br /> READ TABLE result_set INDEX 1 INTO result.<br /> IF sy-subrc = 0.<br /> keys = result-record_ids.<br /> ENDIF.<br /><br /> CHECK keys IS NOT INITIAL.<br />****We only need the output field we are interested read from MDM<br />****By using the result_set_definition parameter, we can control this<br />****and only retrieve that single column<br /> ls_result_set_definition-field_name = query_field.<br /> APPEND ls_result_set_definition TO lt_result_set_definition.<br /> CALL METHOD api->mo_core_service->retrieve<br /> EXPORTING<br /> iv_object_type_code = table<br /> it_result_set_definition = lt_result_set_definition<br /> it_keys = keys<br /> IMPORTING<br /> et_result_set = lt_result_set.<br /><br /> CLEAR wa_cache.<br /> wa_cache-object_name = object_name.<br /> wa_cache-table = table.<br /> wa_cache-query_field = query_field.<br /> wa_cache-keys = keys.<br /> wa_cache-lt_result_set = lt_result_set.<br /> APPEND wa_cache TO data_cache.<br /> ENDIF.<br /><br />*===Get the Initial Value Text===<br /> CALL METHOD _textpool_read<br /> EXPORTING<br /> i_repid = 'SAPLRSDM'<br /> i_key = '001'<br /> IMPORTING<br /> e_text = l_not_assigned.<br /><br /> FIELD-SYMBOLS: <wa_result> LIKE LINE OF lt_result_set.<br /> FIELD-SYMBOLS: <wa_pair> TYPE mdm_name_value_pair,<br /> <wa_key> LIKE LINE OF keys.<br /><br />*===Append the text values in c_t_chavlinfo===<br /> DATA: tabix TYPE sy-tabix.<br /> DATA l_integer TYPE mdm_gdt_integervalue.<br /> FIELD-SYMBOLS: <l_s_chavlinfo> TYPE rsdm_s_chavlinfo.<br /> LOOP AT c_t_chavlinfo ASSIGNING <l_s_chavlinfo><br /> WHERE i_read_mode = rsdm_c_read_mode-text.<br /> CLEAR <l_s_chavlinfo>-c_rc.<br /> IF <l_s_chavlinfo>-c_chavl IS INITIAL<br /> OR <l_s_chavlinfo>-c_chavl EQ rsd_c_initial<br /> OR <l_s_chavlinfo>-c_chavl < 1.<br /> <l_s_chavlinfo>-e_chatexts-txtsh = l_not_assigned.<br /> <l_s_chavlinfo>-e_chatexts-txtmd = l_not_assigned.<br /> <l_s_chavlinfo>-e_chatexts-txtlg = l_not_assigned.<br /> ELSE.<br /> l_integer = <l_s_chavlinfo>-c_chavl.<br /> READ TABLE keys ASSIGNING <wa_key> FROM l_integer.<br /> tabix = sy-tabix.<br /> READ TABLE lt_result_set ASSIGNING <wa_result> INDEX tabix.<br /> IF sy-subrc = 0.<br /> READ TABLE <wa_result>-name_value_pairs ASSIGNING <wa_pair><br /> WITH KEY code = query_field.<br /> IF sy-subrc = 0.<br />****The data for the column could be one of various data types<br />****The value itself is returned as TYPE REF TO DATA and must<br />****be cast into a more specific data type before it can be processed.<br /> CASE <wa_pair>-type.<br /> WHEN 'STRING'.<br /> ASSIGN <wa_pair>-value->* TO <wa_string>.<br /> WRITE <wa_key> TO l_s_chavlinfo-c_chavl LEFT-JUSTIFIED.<br /> <l_s_chavlinfo>-e_chatexts-txtsh = <wa_string>.<br /> <l_s_chavlinfo>-e_chatexts-txtmd = <wa_string>.<br /> <l_s_chavlinfo>-e_chatexts-txtlg = <wa_string>.<br /> WHEN 'INTEGER'.<br /> ASSIGN <wa_pair>-value->* TO <wa_integer>.<br /> WRITE <wa_key> TO l_s_chavlinfo-c_chavl LEFT-JUSTIFIED.<br /> <l_s_chavlinfo>-e_chatexts-txtsh = <wa_integer>.<br /> <l_s_chavlinfo>-e_chatexts-txtmd = <wa_integer>.<br /> <l_s_chavlinfo>-e_chatexts-txtlg = <wa_integer>.<br /> ENDCASE.<br /> ENDIF.<br /> ENDIF.<br /> ENDIF.<br /> ENDLOOP.<br /> ENDTRY.<br />ENDMETHOD.</pre> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-35281487716704201622012-02-08T09:51:00.001-08:002012-02-08T09:51:53.760-08:00Connectivity - BI-MDM Integration<h4>BI/MDM Frequently Asked Questions</h4> <h5><a name="Connectivity-BI-MDMIntegration-GeneralQuestions"></a>General Questions</h5> <ul> <li>What types of BI/MDM Integration Scenarios are possible? <br />There are two main types of BI/MDM Integration Scenarios that are currently being rolled out to customers. The first scenario starts with existing data in BI and uses that as the starting point to generate and populate an MDM Repostiory. The second type is integration during the BI data staging. </li> </ul> <ul> <li>How does the Data Staging scenario work? <br />There are actually two types of the data staging scenario. In each scenario, customers can use existing functionality with BI to access details from MDM to supplement the data that is being loaded into BI. An example might be a feed from an ERP system to a BI system. In this feed there might just be a master data key, like customer number. However using access to MDM, details about this customer, like their sales region, can be read and stored in the BI system or used at runtime inside BI queries. </li> </ul> <ul> <li>What technology is necessary for the Data Staging Scenario? <br />The data staging scenario utilizes the MDM ABAP API to be able to read directly from MDM (in realtime) using ABAP coding. A good overview of the <a href="http://wiki.sdn.sap.com/wiki/display/SAPMDM/Connectivity+-+ABAP+API">MDM ABAP API</a> in general is a requirement for starting this scenario. Also anyone interested in implementing this scenario should study <a href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/00c49ffb-e5e5-2910-73ba-c85af1da5b0a">this video</a>. The video shows the basics of setting up the MDM ABAP API all the way through implementing one of the data staging scenarios. </li> </ul> <ul> <li>How do you use the MDM API during a Data Load? <br />For this situation you need to create an ABAP routine as the transformation rule type. <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/38657/Rule_Type_Maintenance.jpg?version=1&modificationDate=1184618841924" /> <br />During the editing of the Rule Type, you can choose Routine. You then can custom code an ABAP Routine that reads data from MDM using the MDM ABAP API. <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/38657/Rule_Type_Routine.jpg?version=1&modificationDate=1184619076050" /> </li> </ul> <ul> <li>How do you use the MDM API for building a Remote Master Data Characteristic? <br />This scenario is a little less "free form" than the data loading routine. Here you use the existing BI functionality for <a href="http://help.sap.com/saphelp_nw70/helpdata/en/58/a4513ce4af0a40e10000000a114084/frameset.htm">master data characteristics</a> and simply supply a custom implementation for the characteristic. <br />As you maintain the characteristic, from the Master data/texts tab, you can choose a <a href="http://help.sap.com/saphelp_nw70/helpdata/en/71/f470375fbf307ee10000009b38f8cf/frameset.htm">Master Data Read Class</a>. For this you create and then use a class special suited to reading the master data values from MDM. <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/38657/Master_Data_Read_Class.jpg?version=1&modificationDate=1184620532729" /> </li> </ul> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-7767731796936791622012-02-08T09:48:00.001-08:002012-02-08T09:48:45.745-08:00Connectivity - BI-MDM Integration<h4>BI/MDM Frequently Asked Questions</h4> <h5><a name="Connectivity-BI-MDMIntegration-GeneralQuestions"></a>General Questions</h5> <ul> <li>What types of BI/MDM Integration Scenarios are possible? <br />There are two main types of BI/MDM Integration Scenarios that are currently being rolled out to customers. The first scenario starts with existing data in BI and uses that as the starting point to generate and populate an MDM Repostiory. The second type is integration during the BI data staging. </li> </ul> <ul> <li>How does the Data Staging scenario work? <br />There are actually two types of the data staging scenario. In each scenario, customers can use existing functionality with BI to access details from MDM to supplement the data that is being loaded into BI. An example might be a feed from an ERP system to a BI system. In this feed there might just be a master data key, like customer number. However using access to MDM, details about this customer, like their sales region, can be read and stored in the BI system or used at runtime inside BI queries. </li> </ul> <ul> <li>What technology is necessary for the Data Staging Scenario? <br />The data staging scenario utilizes the MDM ABAP API to be able to read directly from MDM (in realtime) using ABAP coding. A good overview of the <a href="http://wiki.sdn.sap.com/wiki/display/SAPMDM/Connectivity+-+ABAP+API">MDM ABAP API</a> in general is a requirement for starting this scenario. Also anyone interested in implementing this scenario should study <a href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/00c49ffb-e5e5-2910-73ba-c85af1da5b0a">this video</a>. The video shows the basics of setting up the MDM ABAP API all the way through implementing one of the data staging scenarios. </li> </ul> <ul> <li>How do you use the MDM API during a Data Load? <br />For this situation you need to create an ABAP routine as the transformation rule type. <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/38657/Rule_Type_Maintenance.jpg?version=1&modificationDate=1184618841924" /> <br />During the editing of the Rule Type, you can choose Routine. You then can custom code an ABAP Routine that reads data from MDM using the MDM ABAP API. <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/38657/Rule_Type_Routine.jpg?version=1&modificationDate=1184619076050" /></li> </ul> <ul> <li>How do you use the MDM API for building a Remote Master Data Characteristic? <br />This scenario is a little less "free form" than the data loading routine. Here you use the existing BI functionality for <a href="http://help.sap.com/saphelp_nw70/helpdata/en/58/a4513ce4af0a40e10000000a114084/frameset.htm">master data characteristics</a> and simply supply a custom implementation for the characteristic. <br />As you maintain the characteristic, from the Master data/texts tab, you can choose a <a href="http://help.sap.com/saphelp_nw70/helpdata/en/71/f470375fbf307ee10000009b38f8cf/frameset.htm">Master Data Read Class</a>. For this you create and then use a class special suited to reading the master data values from MDM. <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/38657/Master_Data_Read_Class.jpg?version=1&modificationDate=1184620532729" /></li> </ul> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-63340510365963441722012-02-08T09:44:00.001-08:002012-02-08T09:44:32.535-08:00What is the MDM ABAP API?<h5>What is the MDM ABAP API?</h5> <p>Historically most ERP based master data resides in existing ABAP Systems. Also the majority of the business logic in that is consuming the master data also resides in ABAP based systems.  Therefore it makes sense to extend the accessiblity of SAP NetWeaver MDM to allow for easy accessiblity from ABAP.</p> <p>That is the goal of the MDM ABAP API (MDM4A).  MDM4A takes the same read, modify, search, and Administrative functionalities of the established COM and Java APIs (MDM4J) and brings them to the ABAP World.</p> <p>By using MDM4A, ABAP developers do not have to learn the SAP NetWeaver MDM specific data types.  MDM4A does the job of mapping all the data types and structures for the developer. It translates the structures such as data arrays into ABAP constructs like Internal Tables. </p> <p>MDM also takes a different approach to passing language specific data. It might be important to note that all the data is passed through MDM4A via Unicode (UTF-8) regardless of the settings in the AS-ABAP system (Unicode vs. Non-Unicode). The MDM4A layers also do all the work of translating this data into the code page of the current system. Even on Unicode systems, a translation from UTF-8 to UTF-16 must occur.</p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-24567728607583896732012-02-08T09:43:00.001-08:002012-02-08T09:43:53.619-08:00What is the Architecture of MDM4A?<h5 align="justify">What is the Architecture of MDM4A?</h5> <p align="justify">MDM4A is made up of three major parts:</p> <ul> <li> <div align="justify">Generic API </div> </li> <li> <div align="justify">Provider Framework </div> </li> <li> <div align="justify">C-Kernel </div> </li> </ul> <p align="justify">The Generic API is a release independent interface into the SAP NetWeaver MDM API.  It is the only layer that application developers should ever directly interact with.  It is comprised of publically available Function Modules and Classes.</p> <p align="justify">The Provider Framework is the release specific implementation of the SAP NetWeaver MDM API.  As new releases or support packages of MDM are released, new matching version fo the provider framework will be created. <img src="https://weblogs.sdn.sap.com/weblogs/images/251694270/MDM_Architecture_Diagram.jpg" /></p> <p align="justify">However the features of the provider framework are always abastracted by the Generic API, causing the least amount of changes to the consuming applications as possible.  This protects the application developer from changes within MDM breaking their applications. The Provider Framework is not intended for direct access by SAP's Customers or Partners.  The MDM 5.5 SP4 class for the provider framework is CL_MDM_PROVIDER_SP4_PL00.</p> <p align="justify">The Generic API and the Provider Framework are both delivered as part of a SAINT Package (SAP Add-on installed into the system via transaction SAINT). <br /><img src="https://weblogs.sdn.sap.com/weblogs/images/251694270/MDM_SP_Level.jpg" /></p> <p align="justify">Finally there are new Kernel Libraries written in C that are an integrated part of the ABAP stack that provide the low level communication interface to MDM. The C-Kernel is an integrated part of the AS-ABAP Kernel. The file dw_mdm.dll is part of the core disp+work package of the Kernel and is installed into /usr/sap/<SID>/DVEBMGS<Instance Number>/exe just like the rest of the Kernel</p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-77752709279044983702012-02-08T09:42:00.003-08:002012-02-08T09:42:59.556-08:00What Codepage is used by MDM4A?<h5 align="justify">What Codepage is used by MDM4A?</h5> <p align="justify">MDM4A is always a Unicode based interface regardless of the codepage used by the ABAP system.  Althought a Unicode ABAP system is UTF-16, the MDM4A interface is UTF-8.  Therefore regardless of the ABAP system codepage, a codepage conversion must take place. The codepage conversion is done within the inner layers of the MDM4A.  However on non-Unicode ABAP systems if you attempt to process characters from MDM that are outside your current codepage, this will produce a CX_SY_CONVERSION_CODEPAGE shortdump.</p> <p align="justify">In non-Unicode ABAP systems, the best way to avoid such errors is to match the logon langauge of the ABAP system to the langauge used to connect to MDM. </p> <div align="justify"> <pre>DATA ls_language TYPE mdm_cdt_language_code.<br />ls_language-language = 'eng'.<br />ls_language-country = 'US'.<br />ls_language-region = 'USA'.<br />lr_api->mo_accessor->connect( ls_language ).</pre><br /></div> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-25922561816270453822012-02-08T09:42:00.001-08:002012-02-08T09:42:10.219-08:00What causes the CRC Check Error?<p>What does it mean when I receive the following error message:</p> <p><b>  Server return code 0x8002000E: File failed a crc check</b></p> <p>This probably means that there is a mismatch between the release/patch level of the MDM Server and the ABAP API Add-In or Java API add-in (e.g MDMJAVAAPI04_0.sca).</p> <p>Although a single ABAP system with the MDM API Add-In could potentially interface with multiple MDM Servers on different release levels, the ABAP MDM API Add-In release level/patch level must always match at least that of the most release level of any MDM Server it connects to. In other words, the ABAP side the MDM APIs (provided via an ABAP Add-In) is backwards compatible, but not forwards compatible.</p> <p>Lets say for instance that you are running the MDM Server at 5.5 SP4 Patch 0. This would show up as something like 5.5.32.56 in the release level dialog on the MDM Server Console. Your ABAP system should have installed at least the same patch level. If you update your MDM Server to 5.5 SP4 Patch 1 (version 5.5.33.13), then patch one of the MDM ABAP API Add-on must be applied as well. Patches for the MDM ABAP API Add-on can be downloaded from the Service Marketplace.</p> <p>You also need to make sure that your have configured the correct MDM Provider for your particular repository in the MDM Configuration with the ABAP System (Transaction MDMAPIC). </p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-42986005406921776242012-02-08T09:40:00.001-08:002012-02-08T09:40:23.495-08:00How do you use the Function Module-Based version of MDM4A?<h5>How do you use the Function Module-Based version of MDM4A?</h5> <p>There are function groups that map directly to the main Interfaces of the provider class. The processing logic is the same (the class-based interface is called from within the Function Modules). Several of the Key Function Modules are "Remote Enabled". Because they are remote enabled, they can also very quickly be generated into Web Services.</p> <p><b>Function Group/Class Interface Mapping</b> <br />FG_MDM_ACCESSOR = IF_MDM_ACCESSOR <br />FG_MDM_ADMIN_API = IF_MDM_ADMIN <br />FG_MDM_CONFIG_MONITOR = IF_MDM_API_CONFIG <br />FG_MDM_CORE_SERVICE_API = IF_MDM_CORE_SERVICES <br />FG_MDM_META_API = IF_MDM_META</p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-11427514469391444412012-02-08T09:39:00.001-08:002012-02-08T09:39:30.705-08:00How do you use the Class-Based version of MDM4A?<h5>How do you use the Class-Based version of MDM4A?</h5> <p>For all class-based access to MDM4A you only interact with the object CL_MDM_GENERIC_API. Internally the Abstract Provider will be instantiated with the release specific provider. All access to the functionality of MDM4A is done through the instances of the main group of Interfaces exposed by the Generic API</p> <p>The object CL_MDM_GENERIC_API has attributes that hold object references to the 5 major parts of the API: <br /><img src="https://weblogs.sdn.sap.com/weblogs/images/251694270/MDM_API_Class_API.jpg" /></p> <p><b>IF_MDM_ACCESSOR</b> <br />This interface controls the opening and closing of a connection to a repository. <br />For many of the other API Methods, you must first have created a connection to a repository via this interface.</p> <p><b>IF_MDM_ADMIN</b> <br />This interface provides access to Admin functions similar to those available via the MDM Console. It includes User (creation, password set, role maintenance) and Repository (Mount or Load Repositories) Administration.</p> <p>The IF_MDM_ADMIN interface poses an interesting situation. Many of the functions here could be automated and then batch scheduled using the local ABAP Scheduler or the Netweaver Central Scheduler by Redwood. It would also be quite easy to use IF_MDM_ADMIN to batch create users (based upon their existence or role assignment in AS-ABAP) for the MDM Server.</p> <p><b>IF_MDM_API_CONFIG</b> <br />This interface allows you to read the configuration entries from Transaction <em>MDMAPIC</em> for one repository or all of them at once. See the Data Dictionary structures <b>MDM_REPOSITORY</b>, <b>MDM_CONNECTION</b>, <b>MDM_DBMS</b>, and <b>MDM_PROVIDER</b> for the data supplied by this Interface.</p> <p><b>IF_MDM_CORE_SERVICES</b> <br />This is the main interface to directly manipulate the data within a repository. <br />It includes Check In/Out, Client System Keys, Update, Delete, Creation, and Query of data.</p> <p>Many of the Core Services have a second method that ends in _SIMPLE. For instance there is UPDATE and UPDATE_SIMPLE. The "Simple" methods accept data dictionary structures that match the format of the repository table that you want to manipulate. This provides an easier interface into the API but requires the creation of a matching structure in the ABAP Data Dictionary.</p> <p>The field names in the ABAP Data Dictionary Structure must be the same as the Name in the MDM Repository (case-sensitive). You are also restricted to only using the MDM API Data Types. Keep in mind that in ABAP there is no NULL state for a value. Any NULL value from MDM will be returned through the simple data types using the initial value for the underlying Data Dictionary Domain. Use of the specific methods instead of the SIMPLE ones will avoid this issue.</p> <p><b>IF_MDM_META</b> <br />This interface provides methods that allow you to change the metadata of a repository. Many of these methods require that the repository be unloaded before they can be performed.</p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-68260965286614528282012-02-08T09:38:00.003-08:002012-02-08T09:38:47.525-08:00How do you configure the connection to MDM from ABAP?<h5>How do you configure the connection to MDM from ABAP?</h5> <ul> <li><a href="http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=3493#HowdoyouconfiguretheconnectiontoMDMfromABAP%3F-ServerConfiguration">Server Configuration</a></li> <li><a href="http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=3493#HowdoyouconfiguretheconnectiontoMDMfromABAP%3F-DBMSConfiguration">DBMS Configuration</a></li> <li><a href="http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=3493#HowdoyouconfiguretheconnectiontoMDMfromABAP%3F-ABAPImplementationforMDMVersion">ABAP Implementation for MDM Version</a></li> <li><a href="http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=3493#HowdoyouconfiguretheconnectiontoMDMfromABAP%3F-MDMRepository">MDM Repository</a></li> </ul> <p>All Configuration is done from Transaction Code <em>MDMAPIC</em> and is broken into 5 main sections:</p> <ul> <li>MDM Repositories </li> <li>MDM Server Connections </li> <li>MDM DBMS Hosts </li> <li>ABAP Implementation for MDM Version Support </li> <li>MDM API Trace Configuration </li> </ul> <p><img src="https://weblogs.sdn.sap.com/weblogs/images/251694270/MDM_Config1.jpg" /></p> <p>All access via MDM4A is always done for a particular repository. The class based API is instantiated for a particular repository. You can not switch to a different repository within an instance. You must create a separate instance to access a different repository.</p> <p>In all calls to the function module based API, the repository must be passed in through the mandatory parameter IV_LOG_OBJECT_NAME. Therefore all the configuration in MDMAPIC really revolves around the repository as its central object. Although we will create Server and Database configuration entries it is the Repository entry that drives all configuration through the API.</p> <h6><a name="HowdoyouconfiguretheconnectiontoMDMfromABAP?-ServerConfiguration"></a>Server Configuration</h6> <p>First define the TCP/IP communication settings for connection to the MDM Server. Then enter the Server Hostname and the Port for communications. Typically the MDM server runs on Port 20005. The name in the MDM Connection field is arbitrary and only know to the ABAP side of the interface.</p> <p>Be careful when defining the host name for systems that may have more than one hostname alias. During the connection to the repository via MDM4A, a list of all repositories and their hostname according to the MDM Server will be retrieved. The local customizing will be checked against this list. If the hostnames do not match, then the connection will be rejected. Therefore the use of IP addresses for the hostname is technically possible, but will always lead to a configuration mismatch and rejection.</p> <h6><a name="HowdoyouconfiguretheconnectiontoMDMfromABAP?-DBMSConfiguration"></a>DBMS Configuration</h6> <p>Repositories may reside on a DBMS that is a different physical system than the MDM server itself, therefore it needs its own configuration entry. The Drop Down Box for DB Type will show all support DBMS types. The name in the MDM DBMS field is arbitrary and only know to ABAP, much like the server name field in the Server Configuration.</p> <h6><a name="HowdoyouconfiguretheconnectiontoMDMfromABAP?-ABAPImplementationforMDMVersion"></a>ABAP Implementation for MDM Version</h6> <p>Different releases of SAP NetWeaver MDM may require technical differences in the Low Level Provider Class. This configuration will allow you to assign a provider class to a set of repository configuration settings. You must select a class that is derived from the Abstract class CL_MDM_ABSTRACT_PROVIDER. The class provided for SP04 is CL_MDM_PROVIDER_SP04_PL00.</p> <p>Remember as a developer you should only program against the Generic API and not this lower level provider framework. Otherwise incompatible changes may be introduced by SAP during version changes that break your application coding. The Generic API will use this configuration in order to call the correct logic for the version of MDM that it must connect with.</p> <h6><a name="HowdoyouconfiguretheconnectiontoMDMfromABAP?-MDMRepository"></a>MDM Repository</h6> <p>We tie all our config. together by specifying for a repository what server, DBMS, and Provider it should use. The Object name is arbitrary and only know to ABAP - although it is used as the key to read all the configuration. The MDM Repository must be the real repository name as it is displayed from the MDM Console.</p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-55341313520819664052012-02-08T09:38:00.001-08:002012-02-08T09:38:00.855-08:00How do I connect to a Repository using the Class-Based MDM4A?<h5 align="justify">How do I connect to a Repository using the Class-Based MDM4A?</h5> <p align="justify">This is a simple example that only focuses on a few things: Instantiating the MDM4A, making a connection to a repository and exception handling.</p> <div align="justify"> <pre>DATA api TYPE REF TO cl_mdm_generic_api.<br />DATA log_object_name TYPE mdm_log_object_name.<br />DATA language TYPE mdm_cdt_language_code.<br />DATA exception TYPE REF TO cx_mdm_main_exception.<br /><br />log_object_name = 'API_CRUD_1'.<br />language-language = 'eng'.<br />language-country = 'US'. language-region = 'USA'.<br /><br />TRY.<br /> CREATE OBJECT api<br /> EXPORTING<br /> iv_log_object_name = log_object_name.<br /> api->mo_accessor->connect( language ).<br />****Do Something<br /> api->mo_accessor->disconnect( ).<br /><br /> CATCH cx_mdm_usage_error INTO exception.<br />****Other Exceptions...<br /> CLEANUP.<br /> TRY.<br /> api->mo_accessor->disconnect( ).<br /> CATCH cx_root.<br /> ENDTRY.<br />ENDTRY.<br /><br />IF NOT exception IS INITIAL.<br /> MESSAGE exception TYPE 'E'.<br />ENDIF.</pre><br /></div><br /><br /><p align="justify"><b>LOG_OBJECT_NAME</b> is initialized with the key for our repository customizing (from Transaction <em>MDMAPIC</em>). That is only value you have to specify. All the other connection information will be looked up for you by the MDM4A.</p><br /><br /><p align="justify">We create the instance of the MDM4A by calling the <em>CREATE OBJECT</em> for our instance of <b>CL_MDM_GENERIC_API</b>. We only must pass in the configuration key. You could still have configuration, authorization, or trusting errors; but these exceptions will not be thrown until we connect to the repository in the next step.</p><br /><br /><p align="justify">Through the API we have access to instances of all 5 of the major interfaces (MO_ACCESSOR=IF_MDM_ACCESSOR, MO_CORE_SERVICE=IF_MDM_CORE_SERVICE, MO_ADMIN=IF_MDM_ADMIN, MO_META=IF_MDM_META, and MO_API_CONFIG=IF_MDM_API_CONFIG). We use <em>api->mo_accessor</em> to establish a connection to our repository. It is this point where the first communication connection is made.</p><br /><br /><p align="justify">First a list of repositories is retrieved from the MDM Server. This list is matched against our configuration settings to make sure the configuration is correct. Next a connection to the repository is made. The current AS-ABAP User (<b>SY-UNAME</b>) is passed through the interface call without specifying a password. At this point the Trusted Status of the AS-ABAP Server is also checked against the MDM Server allow.ip/deny.ip configuration files.</p><br /><br /><p align="justify">All processing logic is left out of this example. At the point marked "Do Something" you would place the specific logic.<br /> <br />Once finished with processing, you should disconnect from the MDM server explicitly with a call to the Accessor method <em>DISCONNECT</em>. If you end your application without disconnecting, the connection will remain open until it is cleaned up after its timeout. This will tie up system resources on the MDM Server unnecessarily.</p><br /><br /><p align="justify">All of our logic is placed within a single <em>TRY...ENDTRY</em> block. That way all errors will trigger into a single exception block. Only one Exception is shown here to save space. There is one super exception that can be caught to get all possible MDM4A specific exceptions - <b>CX_MDM_MAIN_EXCEPTION</b>. Inheriting from this exception are 5 more specific exceptions: <b>CX_MDM_KERNEL</b> (Exceptions within the Kernel layer for the MDM4A), <b>CX_MDM_NOT_SUPPORTED</b> (Exceptions if a method is called that isn't supported by the current release-specific provider that you are using), <b>CX_MDM_PROVIDER</b> (Exceptions generated within the Provider Layer of MDM4A), <b>CX_MDM_SERVER_RC_CODE</b> (Exceptions generated on the MDM Server. The MDM Server specific Return Code and explanatory text are passed back through this exception), and <b>CX_MDM_USAGE_ERROR</b> (Exceptions produced by incorrect usage of an MDM4A interface).</p><br /><br /><p align="justify">It is important to note the use of the <em>CLEANUP</em> event within the <em>TRY...CATCH</em> Block. Regardless of what type of exception occurred, processing can not continue. However we still want to be sure to close the interface connection and free up the resources allocated to it. Therefore we also call the Accessor <em>DISCONNECT</em> here. This logic path only occurs if an exception is caught. If errors occur within this Disconnect, there isn't really anything that can be done about it therefore the logic catches all exceptions (<b>CX_ROOT</b>) and ignores them.</p><br /><br /><p align="justify">Finally we process an error message with the text from the exception with the last block of coding.</p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-48920256871380926842012-02-08T09:37:00.001-08:002012-02-08T09:37:07.350-08:00How does Authentication work in MDM4A?<h5 align="justify">How does Authentication work in MDM4A?</h5> <p align="justify">All authentication between the MDM server and the ABAP system via the MDM4A requires a Server Trust relationship. The SAP NetWeaver MDM Server(s) must trust their AS-ABAP counterparts. Trusting is configured via two files on the SAP NetWeaver MDM server - allow.ip and deny.ip This files contain the IP addresses of the AS-ABAP systems that you want to control access from.</p> <p align="justify">The Files allow.ip and deny.ip should normally be placed directly into the same folder that holds your mds.ini (MDM Server Configuration) file. However if you need to place them in a different location (perhaps a centralized network share) you can configure their location in the mds.ini file. Use the entry TrustFiles Dir=<directory> to specify this location.</p> <p align="justify">Allow.ip and deny.ip must be flat, text only files.</p> <p align="justify">It is possible to wildcard the entries in allow.ip and deny.ip using the * character. You can NOT just specify * to allow all possible IP addresses. You must at least specify one subnet --ie. at least 10.*</p> <p align="justify">Instead of listing each IP address directly, users will most likely take advantage of the wildcard. If you want to allow access from all but a few IP address you can combine the allow.ip and deny.ip entries. For instance you may wish to allow all servers from the 192.168.0.* range. However their may be a single "unsafe" machine in this subnet. You could then place the IP address of this "unsafe" machine within the deny.ip file. This can be useful to keep development or test servers from accidentally updating data in a production repository.</p> <p align="justify">Any IP address not found in the allow.ip file (or if no allow.ip file can be read) will cause all requests will be refused.</p> <p align="justify">Comments can be placed in the allow.ip and deny.ip files using the # character in the first column.</p> <p align="justify">Once the server trust relationship is established, authentication is quite simple. Because there is a trusting relationship, no passwords must be passed through MDM4A. The AS-ABAP user identity (SY-UNAME) will automatically be passed through the MDM4A interface. A repository user with the same ID must exist on the SAP NetWeaver MDM server side for a role to be assigned to the request. Alternatively, User Mapping is possible using the LDAP Connectivity of the SAP NetWeaver MDM Server.</p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-26478934983908604342012-02-08T09:36:00.001-08:002012-02-08T09:36:27.398-08:00How can I change the timeout parameter?<p>You have exceeded the MDM ABAP API Communication timeout and recieved an error message, however your process does indeed take longer than the default time.</p> <p>The timeout parameter is set and controlled by the ABAP side of the communication. The default value of the timeout is 30000 milliseconds. The timeout parameter is controlled by the ABAP Profile Parameter mdm/network_timeout. For more details see <a href="https://service.sap.com:443/sap/support/notes/HOME:968804">OSS Note 968804</a>.</p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0tag:blogger.com,1999:blog-5579339541755643792.post-58239812118700599062012-02-08T09:35:00.001-08:002012-02-08T09:35:46.034-08:00TIP ~ MDM ABAP-API ~ Things to Remember (for Starters)<p>This is something I found with MDM ABAP APIs and thought to share. It will be quite old and small thing for experts but I guess still a little good for starters.</p> <hr /> <p><b>1.  The *Table code* is case sensitive in MDM ABAP API. If you add *CUSTOMERS* in your console, please use *CUSTOMERS* only in the ABAP API program. Please do not use *Customers* or *customers. Another example is *Customer_MDM* , so dont use *Customer_mdm* etc.*</b></p> <p><img src="http://wiki.sdn.sap.com/wiki/download/attachments/71281/1.jpg?version=1&modificationDate=1205132314967" /> <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/71281/Right.JPG?version=3&modificationDate=1205134653046" /> Works - Only Code of Table is case-sensitive: not Table Name.</p> <p><img src="http://wiki.sdn.sap.com/wiki/download/attachments/71281/2.jpg?version=1&modificationDate=1205132314951" /> <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/71281/Wrong.JPG?version=2&modificationDate=1205133843008" /> Not Works  -  Code needs to be exact, its case-sensitive.</p> <hr /> <p><b>2.   The User-ID is always capital since ECC uses caps for user-Id. Please use *MDMUSER* as console and not *mdmuser</b>. <b>*mdmuser* will give exception that *User is not found</b>.**</p> <p><img src="http://wiki.sdn.sap.com/wiki/download/attachments/71281/3.jpg?version=1&modificationDate=1205132314940" /> <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/71281/Copy+of+Right.JPG?version=1&modificationDate=1205134696046" /> Works - Only Name of User is case-sensitive! <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/71281/4.jpg?version=1&modificationDate=1205132314930" /> <br /><img src="http://wiki.sdn.sap.com/wiki/download/attachments/71281/Copy+of+Wrong.JPG?version=1&modificationDate=1205134696035" /> Not Works  -  Name needs to be in capital letters, its case-sensitive.</p> <hr /> <p><b>Same is true for Table Fields as well.</b></p> <p>In the end, its also a tip that Please Use the <b>ABAP API How to Guides</b> provided. I must admit that they are really helpful and even helped me in solving a simple customer requirement. Cheers !</p> SAP BPC Tutorialshttp://www.blogger.com/profile/03728936382387993855noreply@blogger.com0