Referencing the MDM Java API during development and runtime


SAP MDM Interview Questions and SAP MDM Tutorials

SAP MDM Interview Questions and SAP MDM Tutorials

How to reference the MDM Java API during development and runtime

Although there are several ways to include and reference the MDM Java API in your Java projects, I am describing here the best practice of doing it.

Use case

Typically your Java application will be deployed on the SAP NetWeaver Application Server, either as a J2EE or Web Dynpro application. The JAR files of the API should not be included in the application archive itself, but rather referenced only – both during development and runtime. The API is deployed as a library on the application server. This gives you the possibility to easily update the API:

  • On the application server by simply deploying a new version of the API. This can be done by an admin without the help of a developer.
  • On the machines used for development without the need to update several projects.
Download the MDM Java API

You find the JAR files in the archive MDMJavaAPI_Ver<build-number>.zip on the installation media you received. You can download it also, especially important after an update of the MDM Server, from the SAP Service Marketplace: http://service.sap.com/swdc

-> Download
-> Support Packages and Patches
-> Entry by Application Group
-> SAP NetWeaver
-> SAP MDM
-> SAP MDM 5.5
-> MDM JAVA API

During development in NWDS

  1. Unpack the archive with the JAR files and the Javadoc of the MDM Java API on your PC. Copy or move all the JAR files into any folder. Always use the same folder name every time you update to a new version. Example folder name: C:\MDMJavaAPI

  2. In the Preferences dialog of the NWDS, go to JavaClasspath Variables and create a new variable with the name SAP_MDM_JAVA_API and the path set to the folder of step 1.

  3. In the properties dialog of your NWDS project, go to Java Build PathLibraries and add each JAR file of the API using the Add Variable button. You need to select the variable created in step 2, click on Extend and select all 6 JAR files (mdm4j.jar, mdm-admin.jar, mdm-common.jar, mdm-core.jar, mdm-data.jar, mdm-protocol.jar).

  4. If you are developing an J2EE application: Open the deployment descriptor application-j2ee-engine.xml and create a reference to the MDM Java API using the values:

    SAP MDM Interview Questions and SAP MDM Tutorials

    SAP MDM Interview Questions and SAP MDM Tutorials

    – Reference target: com.sap.mdm.tech.mdm4j

    – Reference type: hard

    – Reference target type: library

    – Provider name: sap.com

  5. If you are developing a Web Dynpro application: Open the properties dialog of the project, go to Web Dynpro ReferencesLibrary Referencesand add a new entry for the MDM Java API using the name com.sap.mdm.tech.mdm4j.

Deploy on the application server

Deploy the MDM Java API using the SCA named MDMJAVAAPI<SP-number>_<Patch-number>.sca.

SAP MDM Interview Questions and SAP MDM Tutorials

SAP MDM Interview Questions and SAP MDM Tutorials

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
   Send article as PDF   
This entry was posted in SAP MDM Tutorials. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *