cancel
Showing results for 
Search instead for 
Did you mean: 

Java MDM API Programming

Former Member
0 Kudos

Hi,

I am new to Java MDM API programming. I am developing Webdynpro application that has the following requirements.

1. Search the MDM database Main Table for records with field values that match the ones passed through View input fields

2. Get all values from Look up table to show it as Dropdown menu in View

3. Insert New Record to the Main table

4. Update a record that was retrived from above search

I went through various documentations but still couldnot accomplish much. Can any one of you give me some code sample for each of the 4 above mentioned requirement with some explanation, asap?

So far, I have this much of code working:

{

RegionProperties dataRegion = new RegionProperties();

dataRegion.setRegionCode("engUSA");

dataRegion.setLocale(new Locale("en", "US"));

dataRegion.setName("US");

ConnectionAccessor simpleConnection = SimpleConnectionFactory.getInstance("10.79.128.55");

CreateUserSessionCommand cmdGetUserSession = new CreateUserSessionCommand(simpleConnection);

RepositoryIdentifier repositoryID = new RepositoryIdentifier("VENDOR","MD1",DBMSType.ORACLE);

cmdGetUserSession.setRepositoryIdentifier(repositoryID);

cmdGetUserSession.setDataRegion(dataRegion);

cmdGetUserSession.execute();

String sessionId = cmdGetUserSession.getUserSession();

AuthenticateUserSessionCommand cmdAuthUserSession = new AuthenticateUserSessionCommand(simpleConnection);

cmdAuthUserSession.setSession(sessionId);

cmdAuthUserSession.setUserName("Admin");

cmdAuthUserSession.setUserPassword("");

cmdAuthUserSession.execute();

msgMgr.reportWarning("Authentication Complete") ;

}

Any help would be greatly appreciated. Rewards guarateed.

Thanks

Sudheer

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sudheer,

To work with MDM using the webdynpro screens as front end and your mdm backend systems you need to use the Java api connections.

These java api contains all the methods and classes to work on the mdm stored master data.

based on your mdm server version you will ahve to use the mdm java api and along with it comes all the relevant packages and classes to eb sued.

You can refer the below link which will guide you on this further:

https://help.sap.com/javadocs/MDM/current/index.html (java api codes)

http://help.sap.com/javadocs/MDM/SP06P2/index.html (Java Docs for SP06)

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b02f4f88-7bbb-2a10-67ad-d435b9f0... with Java Api)

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0eb1f75-136d-2a10-99b2-ea60f1de... (MDM with Java Api)

Hope It Helped

Thanks & Regards

Simona Pinto

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sudheer,

There is some amount of coding required to be done to perform mdm operations in portal.

I will give you the algorithm that needs to be followed which will help you program.

1. Use ConnectionPoolFactory to get the connection to mdm

2. Get the Repository Session after authenticating it you will have to use the below apis for the this

a) RepositoryIdentifier

b) GetRepositoryRegionListCommand

c) CreateUserSessionCommand

d) AuthenticateUserSessionCommand

3. Get the Repository Schema using the api GetRepositorySchemaCommand .

After the above steps you can proceed performing different MDM operations like the once you are trying.

After performing all the operations use DestroySessionCommand api to destroy the Repository session.

Below are the answers for the scenario that you are doing

1. Search the MDM database Main Table for records with field values that match the ones passed through View input fields

Use RetrieveRecordsByValueCommand api

2. Get all values from Look up table to show it as Dropdown menu in View

For this you will have to use RetrieveLimitedRecordsCommand api

3. Insert New Record to the Main table

Use CreateRecordCommand api

4. Update a record that was retrived from above search

Use ModifyRecordCommand api

Best of Luck

Regards

Former Member
0 Kudos

Hi,

Check the below threads containing the sample code for your requirement

- Search

- Lookup values

- Lookup Values

- READ,INSERT,MODIFY

Regards,

Jitesh Talreja