MDM Connection API
Hi friends,
I am new to MDM, i just want to connect to standalone MDM. Can anyone please send me some Java API to connect to MDM. I have a jar file named MDM5J.jar.
Please help...
hi,
this is simpleConnection code to connect MDM server..
SimpleConnection connection = null;
try {
connection = SimpleConnectionFactory.getInstance("localhost");
} catch (ConnectionException e) {
e.printStackTrace();
use mdm-core.jar also...
Edited by: Vijaya Sekhar Reddy Alla on Mar 26, 2008 9:43 AM
Similar Messages
-
MDM Java API (Creation of table)
Hi,
can anyone help me for creation of tables in repository using MDM java API .
Can u Provide sample code for this.
Edited by: Srikanth Josyula on Jun 26, 2008 8:52 AMHi Srikanth,
Check with this code.It may be useful.
createflattable.java
Created on June 25, 2008, 5:08 PM
To change this template, choose Tools | Options and locate the template under
the Source Creation and Management node. Right-click the template and choose
Open. You can then make changes to the template in the Source Editor.
package tabletype;
import com.sap.mdm.commands.AuthenticateRepositorySessionCommand;
import com.sap.mdm.commands.CommandException;
import com.sap.mdm.commands.CreateRepositorySessionCommand;
import com.sap.mdm.commands.GetRepositoryRegionListCommand;
import com.sap.mdm.data.MultilingualString;
import com.sap.mdm.data.RegionProperties;
import com.sap.mdm.data.RegionalString;
import com.sap.mdm.net.ConnectionException;
import com.sap.mdm.net.ConnectionPool;
import com.sap.mdm.net.ConnectionPoolFactory;
import com.sap.mdm.schema.TableProperties;
import com.sap.mdm.schema.commands.CreateTableCommand;
import com.sap.mdm.schema.commands.GetFieldListCommand;
import com.sap.mdm.schema.commands.GetTableListCommand;
import com.sap.*;
import com.sap.mdm.server.DBMSType;
import com.sap.mdm.server.RepositoryIdentifier;
import java.util.Locale;
public class createflattable {
/** Creates a new instance of createflattable */
public createflattable() {
private static MultilingualString createMultilingualString(RegionProperties[] regionPropertiesList, String baseString)
MultilingualString mlString = new MultilingualString();
for (int i = 0; i < regionPropertiesList.length; i++)
Locale locale = regionPropertiesList<i>.getLocale();
//Locale locale = regionPropertiesList<i>.getLocale();
String regionCode = regionPropertiesList<i>.getRegionCode();
String string = baseString + "_" + locale.getLanguage() + "_" + locale.getCountry();
RegionalString regionalstring = new RegionalString(string, regionCode);
mlString.set(regionalstring);
return mlString;
private static TableProperties createFlatTable(RegionProperties[] regionPropertiesList)
//MultilingualString tableName = createMultilingualString(regionPropertiesList, "NewTable" + System.currentTimeMillis());
MultilingualString tableName = createMultilingualString(regionPropertiesList, "first"+System.currentTimeMillis());
System.out.println("table is" +tableName);
TableProperties table = new TableProperties(TableProperties.FLAT);
table.setName(tableName);
table.setCode("NewCode" + System.currentTimeMillis());
table.setKeyMappable(true);
table.setDescription("");
return table;
public static void main(String[] args) {
// System Name
String tag = "";
ConnectionPool connections = null;
try {
connections = ConnectionPoolFactory.getInstance(tag);
catch (ConnectionException e)
e.printStackTrace();
return;
//////////////// specify the repository to use
//RepositoryName
String repositoryName = "";
//DataBase Name
String dbmsName = "";
RepositoryIdentifier reposId = new RepositoryIdentifier(repositoryName, dbmsName, DBMSType.MS_SQL);
/////// create a repository session
CreateRepositorySessionCommand sessionCommand = new CreateRepositorySessionCommand(connections);
sessionCommand.setRepositoryIdentifier(reposId);
try {
sessionCommand.execute();
catch (CommandException e) {
e.printStackTrace();
return;
System.out.println("Currently connected to "+reposId);
String sessionId = sessionCommand.getRepositorySession();
/////////// authenticate the repository session
String userName = "";
String userPassword = "";
AuthenticateRepositorySessionCommand authCommand = new AuthenticateRepositorySessionCommand(connections);
authCommand.setSession(sessionId);
authCommand.setUserName(userName);
authCommand.setUserPassword(userPassword);
try {
authCommand.execute();
catch (CommandException e) {
e.printStackTrace();
return;
//////////////////// retrieve the list of tables
GetTableListCommand tableListCommand = new GetTableListCommand(connections);
tableListCommand.setSession(sessionId);
try {
tableListCommand.execute();
catch (CommandException e) {
e.printStackTrace();
return;
// get change stamp
// this is required when we make any kind of changes to the repository
int changeStamp = tableListCommand.getChangeStamp();
//////get repository regionlist
//A command for retrieving the list of regions supported by the repository.
// retrieve the available regions (languages) for the repository
// we need this to set up the table name for each region
GetRepositoryRegionListCommand gm = new GetRepositoryRegionListCommand(connections);
gm.setRepositoryIdentifier(reposId);
try {
gm.execute();
catch (CommandException e) {
e.printStackTrace();
return;
// RegionProperties[] rs = gm.getRegions();
RegionProperties[] regionPropertiesList = gm.getRegions();
TableProperties newtable = createFlatTable(regionPropertiesList);
CreateTableCommand c = new CreateTableCommand (connections);
c.setSession(sessionId);
c.setTable(newtable);
c.setInChangeStamp(changeStamp);
try {
c.execute();
System.out.println("sdf");
catch (CommandException e) {
e.printStackTrace();
return; -
ABAP MDM Connection Pool concept? Slow Performance in call
Hi,
I'm playing around with the MDM ABAP API, and I found the performance a bit disappointing.
I followed the guide "How To identify master data records using SAP MDM 5.5 ABAP API's" and wrote a test program.
The program makes a connection, triggers an MDM query, and disconnects.
CREATE OBJECT api
EXPORTING
iv_log_object_name = logical_object_name.
api->mo_accessor->connect( language ).
* Query parameters
ls_query-parameter_code = 'Material_Number'.
ls_query-operator = 'CS'.
ls_query-dimension_type = 1.
ls_query-constraint_type = 8.
ls_value = '70'.
GET REFERENCE OF ls_value INTO ls_query-value_low.
APPEND ls_query TO lt_query.
CLEAR ls_query.
* Search
CALL METHOD api->mo_core_service->query
EXPORTING
iv_object_type_code = 'Products'
it_query = lt_query
iv_hits_max = 10
IMPORTING
et_result_set = lt_result_set.
Connection is really fast (a split second)
First time triggered 'query' method took about 30-50 seconds.
Second time triggering 'query' method took a split second.
Further to my investigation, I found out the most expensive code lies in
CL_MDM_PROVIDER_SP04_PL03->IF_MDM_CORE_SERVICES~QUERY
*--- load field meta data ---*
IF mt_mdm_field_meta_data IS INITIAL
OR mt_field_meta_data IS INITIAL.
CALL METHOD me->_load_field_information.
ENDIF.
Within this method loadfield_information, it rips all the table and structure information
from MDM, and ALL language texts and so on.
It has many loops, and within the loops querying MDM for more information.
Is there anyway to speed this up?
Why aren't these data cached? (They don't change so often in a production environment)
I also found a shared memory class CL_MDM_METADATA_ACCESS but it is not used anywhere.
No shared memory area relevant is delivered by SAP as well.
Any ideas?
Cheers,
Michael.Hi Michael,
you're welcome.
I'm not sure how the Connection Pooling to MDM is really done by the ABAP APIs as I'm unfortunately not an API developer but just use the API for my programms.
What I learned during this process is that the repository meta data (meaning table descriptions, and so on) have to be loaded at least once for each connection. This makes sense because a repository can always be changed manually by any user. And I don't think that it would be faster to hold the meta data persistent in the ABAP layer because then you would need to compare the ABAP available meta information with the current meta information of the repository. This could take even longer.
I've solved this "issue" in a way that I really rely on the connection because a single connection is very stable. So I call the "CONNECT" only once in the very beginning, run through my coding and the very last step is the "DISCONNECT". As long as a connection is available, the meta data is cached in the API layer (at least this is the case for SP05).
BR Michael -
MDM ABAP API - Language information not valid for repository
Dear all,
We're programming an interface in SAP R/3 to MDM catalog through 'MDM ABAP API's'. Automatically, it creates an RFC connection to MMD, but we're getting the following connection errorwhen executing the API:
E MDM_ABAP_API 078 Language information ENG US USA not valid for MDM repository XXXYYYZZZ*.
*where XXXYYYZZZ is the repository name.
W'e've established the connection in R/3 through transaction MDMAPIC and we've created the same user in R/3 and MDM Console.
This is the code written on the program where we are defining the language (ENG), country (US) and region (USA).
*maintain logon language information
ls_repository_language-language = 'ENG'.
ls_repository_language-country = 'US'.
**no region information needed here
ls_repository_language-region = 'USA'.
How can I see the repository language definition?
Which are the correct codes to be used for language 'English', Country 'United States' and Region 'USA'? And for other countries, like spanish language, country Spain and Region ¿spain?
In fact, we copied this code from website:
http://help.sap.com/saphelp_nwmdm71/helpdata/en/44/93ad8931381053e10000000a422035/frameset.htm
Maybe the problem is that any RFC configuration is missing, and it has to be done in transaction SM59?
Thanks for your feecback,
Carlos Santamaría.The problem is now solved.
The correct languague information codes for Language Spanish, Country Spain and Region, are as follows:
Language: 'spa'
Country: 'ES'
Region: '___'
It is important to respect the CAPS, otherwise it doesn't work.
Regards,
Carlos Santamaría. -
How to use MDM ABAP API?
Hi Guys,
I want to use ABAP API for manipulating MDM records(EX Adding two field values and assign into another field value).
Can anybody guide me step by step process?
Best Regards
Devaraj PKHi Devraj,
Please go through this pdf:
1. How To identify identical master data records using SAP MDM 5.5 ABAP APIs
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e060251e-b58d-2910-02a2-c9a1d60d9116
2. MDM ABAP API
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/00c49ffb-e5e5-2910-73ba-c85af1da5b0a
http://help.sap.com/saphelp_mdm550/helpdata/en/44/93aa6831381053e10000000a422035/content.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/connectivity-ABAP+API&
Pls rewrds if found helpful.
BR,
Alok Sharma -
MDM ABAP API ISSUE ( server is getting down )
Hi Folks,
I am trying to retrieve matching results using MDM ABAP API.
I am spiting source and target records into lot of blocks dynamically
in program. I am getting output 2 to 3 times if i can run program
sequential after that server is getting down (before running program
i am completely going out and rerunning).After server bring's up
running couple of times and server getting down.
Please help me how can i solve this issue.
Thanks,
Anil.Hi Anil,
You can have a look at the below links can cross check the steps you have performed in establishing the connection correctly:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/00c49ffb-e5e5-2910-73ba-c85af1da5b0a
ABAP APIs: Error "The connection is not trusted"
Comaptible ABAP APIs for MDM 5.5 SP6 Patch 1
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/tip%2b%2bMDM%2bABAP-API%2b%2bThings%2bto%2bRemember%2b(for%2bStarters)
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e060251e-b58d-2910-02a2-c9a1d60d9116
Hope It Helped
Thanks & Regards
Simona Pinto -
Deployment Issue with MDM Java API exposed as Webservice using EJBS
Hi Experts,
I am implementing MDM Java APIS in Stateless session bean.Exposed that bean as Webservice and using that webservice in
Webdynpro through Adaptive Webservice Model.
I am facing following issue:
Webservice works fine after deployment,after some number of execution webservice stops working and gives exception.After
Redeployment of the Webservice, it starts working again works fine some number of execution.
I am Using new MDMJava API.
MDM Server Details: MDM 5.5 SP06
I am using following code for connetion
//////////////*************Getting Connection************///////
ConnectionPool pool = null;
String sessionId = null;
try {
pool = ConnectionPoolFactory.getInstance("Server Ip");
} catch (ConnectionException e1) {
System.out.println(e1.getMessage());
//////////////*************Repository Session************///////
CreateRepositorySessionCommand repSeession =
new CreateRepositorySessionCommand(p_pool);
repSeession.setRepositoryIdentifier(p_repId);
try {
repSeession.execute();
} catch (CommandException e2) {
System.out.println(e2.getMessage().toString());
String repIID = repSeession.getRepositorySession();
// Authenticate Repository
AuthenticateRepositorySessionCommand autRepSeesion =
new AuthenticateRepositorySessionCommand(p_pool);
try {
autRepSeesion.setSession(repSeession.getRepositorySession());
autRepSeesion.setUserName(p_user);
autRepSeesion.setUserPassword(p_Password);
autRepSeesion.execute();
} catch (CommandException e3) {
System.out.println(
"RepSession Seesion" + e3.getMessage().toString());
return autRepSeesion.getSession();
//////////////*************user Session************///////
GetRepositoryRegionListCommand regionListCommand =
new GetRepositoryRegionListCommand(p_pool);
regionListCommand.setRepositoryIdentifier(p_repId);
try {
regionListCommand.execute();
} catch (CommandException e) {
System.out.println(e.getMessage().toString());
RegionProperties[] regions = regionListCommand.getRegions();
// create a user session
CreateUserSessionCommand UsersessionCommand =
new CreateUserSessionCommand(p_pool);
UsersessionCommand.setRepositoryIdentifier(p_repId);
UsersessionCommand.setDataRegion(regions[0]);
// use the first region
try {
UsersessionCommand.execute();
} catch (CommandException e) {
System.out.println("UserSession" + e.getMessage().toString());
String UsersessionId2 = UsersessionCommand.getUserSession();
AuthenticateUserSessionCommand authUserCommand =
new AuthenticateUserSessionCommand(p_pool);
authUserCommand.setSession(UsersessionCommand.getUserSession());
authUserCommand.setUserName(p_userId);
authUserCommand.setUserPassword(p_password);
try {
authUserCommand.execute();
} catch (CommandException e) {
System.out.println("User Seesion" + e.getMessage().toString());
return authUserCommand.getSession();
//////////////*************Destroy Session************///////
DestroySessionCommand destroySessionCommand =
new DestroySessionCommand(p_pool);
destroySessionCommand.setSession(p_repsession);
try {
destroySessionCommand.execute();
} catch (CommandException e) {
e.printStackTrace();
destroySessionCommand.setSession(p_Uesrsession);
try {
destroySessionCommand.execute();
} catch (CommandException e) {
e.printStackTrace();
Do we need to relase the connection pool object also?
Can anyone help me with the code how that can be achived?
Please Reply if anyone has come accross similar issue or know what can be the solution.
Thanks in Advance.
Regards Shruti
Edited by: Shruti Shah on Dec 18, 2008 12:52 PMHi Nitin,
Thanks for the prompt Response.
Even I am guessing that its becose of Connection pool.
I am destroying session as follows
DestroySessionCommand destroySessionCommand =
new DestroySessionCommand(p_pool);
destroySessionCommand.setSession(p_repsession);
try {
destroySessionCommand.execute();
} catch (CommandException e) {
e.printStackTrace();
destroySessionCommand.setSession(p_Uesrsession);
try {
destroySessionCommand.execute();
} catch (CommandException e) {
e.printStackTrace();
But I didnot find any method by which i can close realsse connection from connection pool.
It would be great if you can help me how close or realese those connection.In MDM Console i am able to see those sessions even after destroying them.
Regards Shruti. -
Hi All,
We have installed MDMTECH_554_700 on our 2004s.
We also configured all post installation steps like
1)MDM Repositories
2)MDM Server Connections
3)Mdm Dbms Hosts
4)ABAP Implementation for MDM Version Support
5)MDM API Trace Configuration.
It seems all connection settings are fine.Is there anyway to test the connection properties/configuration?
We tried to execute MDM_ADMIN_RETRIEVE_ALL_REPS with
1) MDM Connection which we created in the above configuration steps.(i.e..,MDMTECH_554_700)
We are getting like "Error in repository configuration: MDMTECH_554_700 not found"
Please help us.You actually named your logical object name, MDMTECH_554_700? The logical object name that the function module is looking for is actually the key name that you supplied in transaction MDMAPIC when you setup your MDM Repository.
Also to use MDM_ADMIN_RETRIEVE_ALL_REPS, you also want to supply the DBMS information as well since you want cross repository information.
Actually the function module that I use to test MDM API ABAP connections is MDM_ADMIN_RETRIEVE_USERS. It has a simplier interface, in that you only have to specify the logical object name.
If you have any problems determining what the logical object name refers to, feel free to send me an email (it is in my SDN business card and also not too difficult to figure out standard SAP addresses). If you email me some screen shots of you configuration in MDMAPIC, I can tell you what value you should be using. -
How to access the SAP MDM destinations using mdm java api in 7.1
hi,
I have SAP MDM 7.1 SP11 and SAP Portal 7.3 and developing the custom webdynpro application using the JAVA MDM API. I want configure the SAP MDM destinations in SAP Portal .
How to access the MDM destinations in java code using API? and how to create the connection with MDM using the MDM destinations.
Please provide the code for access the SAP MDM destinations in java code using MDM java api and creating the connection to MDM.
ThanksJun,
Thanks for the reply and api information.
I have got this api information from the following sap documentation. But i am looking for the code by implementing this class and creating the mdm connection.
Creating an MDM Connection Using Java Code - SAP NetWeaver Master Data Management (MDM) - SAP Library
if any thing can you share it.
Thanks -
Inetgrating MDM Java API's with Java proxies on XI side
Hello friends
Can anyone help me on integrating MDM JAVA API's used for talking to MDM Server and the Javaproxies we generate from the XI side.I am having an application class inside the Java API's (it contains the main function)which triggers the functionality on the MDM side.But how to trigger it from the Java proxies side??I can get the different fields that I have to send in the impl.java program of my generated proxy,but how to trigger the MDM Java API's from inside this.Also there is one problem I needed to pass the datatype fields from the Javaproxy(XI)side to the CRUDMAINTABLERecord program..Since importing the javaproxy package is giving me an error(I don't know why)I don't know how to pass these datatypes to the CRUD program.Please help me out on this urgently.Thank you all in advance.Hi Deepthi,
I had used the below code for retrieving the workflow's id's
RetrieveWorkflowsCommand RetriveworksFlows = new RetrieveWorkflowsCommand(connections);
RetriveworksFlows.setSession(session);
try{
RetriveworksFlows.execute();
catch(Exception e)
WorkflowProperties[] workflowpro = RetriveworksFlows.getWorkflows();
WorkflowId[] workflowid = new WorkflowId[workflowpro.length];
for(int n=0;n<workflowpro.length;n++)
workflowid[n] = workflowpro[n].getId();
String workfloName = workflowpro[n].getLaunchType()+"";
System.out.println("id--"workflowid"name"+workfloName);
and for creating the workflow job id i had written the below code
CreateWorkflowJobCommand workflowjobcommand = new CreateWorkflowJobCommand(connections);
workflowjobcommand.setWorkflowId(workflowid[0]);
workflowjobcommand.setRecordIds(recordId);
workflowjobcommand.setSession(session);
try{
workflowjobcommand.execute();
catch(Exception e)
then to start the workflow what i have to do .
please expain me -
Read data from MDM For Lookup and Flat table using MDM ABAP API
Hi,
I have requriment to read data from MDM from FLAT and Lookup table using MDM ABAP API. My design is like this ,
I have one ITEMS (Main table in MDM) and inside that i have one Lookup flat table ITEM_TYPE , my requriment is to read Item number and its related Item type.
From ABAP.
Please help if any body has any idea.
Regards,
ShyamHI Guys,
I found my solution by myself. Below is the solution , hope this will help others:-
Retrieve data from MDM using MDM ABAP API.
Step- 1. Create structure in SAP with the same name as that of MDM field code for MDM Main table.
Step-2. Create another structure in SAP having all lookup fields of MDM , fieldname in ECC must be same as that of MDM field
code.
Step-3.Create structure in SAP for individual lookup field(Single Field only) with the same name as MDM Field code.
Step-4.
DATA: IT_QUERY TYPE STANDARD TABLE OF MDM_QUERY, "MDM_QUERY_TABLE,
WA_QUERY TYPE MDM_QUERY,
WA_CDT_TEXT TYPE MDM_CDT_TEXT,
IT_RESULT_SET_KEY TYPE MDM_SEARCH_RESULT_TABLE,
WA_RESULT_SET_KEY TYPE MDM_SEARCH_RESULT,
WA_STRING TYPE STRING.
DATA:<Internal table> TYPE STANDARD TABLE OF <SAP Str Having all LOOKup Fields>
DATA: :<Internal table>TYPE STANDARD TABLE OF <SAP Str one LOOKup field>,
<Workarea> LIKE LINE OF :<Internal table>.
*PASS LOGICAL OBJECT NAME.
V_LOG_OBJECT_NAME = 'Logical object name defined in Customization'.
Define logon language, country & region for server
WA_LANGUAGE-LANGUAGE = 'eng'.
WA_LANGUAGE-COUNTRY = 'US'.
WA_LANGUAGE-REGION = 'USA'.
TRY.
CREATE OBJECT LR_API
EXPORTING
IV_LOG_OBJECT_NAME = V_LOG_OBJECT_NAME.
ENDTRY.
CONNECT to repository. Apply particular logon language info
CALL METHOD LR_API->MO_ACCESSOR->CONNECT
EXPORTING
IS_REPOSITORY_LANGUAGE = WA_LANGUAGE.
*NOW PASS ITEM NO AND GET KEY FROM MDM.
CLEAR WA_QUERY.
WA_QUERY-PARAMETER_CODE = <MDM FIELD CODE>. "Field code
WA_QUERY-OPERATOR = 'EQ'. "Contains
WA_QUERY-DIMENSION_TYPE = 1. "Field search
WA_QUERY-CONSTRAINT_TYPE = 8. "Text search
WA_STRING = <Field Value>.
GET REFERENCE OF WA_STRING INTO WA_QUERY-VALUE_LOW.
APPEND WA_QUERY TO IT_QUERY.
CLEAR WA_QUERY.
*PASS ITEM NUMBER AND GET RELATED KEY FROM MDM.
TRY.
CALL METHOD LR_API->MO_CORE_SERVICE->QUERY
EXPORTING
IV_OBJECT_TYPE_CODE = <MDM Main Table>
IT_QUERY = IT_QUERY
IMPORTING
ET_RESULT_SET = IT_RESULT_SET_KEY.
CATCH CX_MDM_COMMUNICATION_FAILURE .
CATCH CX_MDM_KERNEL .
CATCH CX_MDM_NOT_SUPPORTED .
CATCH CX_MDM_USAGE_ERROR .
CATCH CX_MDM_PROVIDER .
CATCH CX_MDM_SERVER_RC_CODE .
ENDTRY.
Pass record id into keys.
LOOP AT IT_RESULT_SET_KEY INTO WA_RESULT_SET_KEY.
WA_KEYS = WA_RESULT_SET_KEY-RECORD_IDS.
ENDLOOP.
WA_RESULT_SET_DEFINITION-FIELD_NAME = <Look field name>.
APPEND WA_RESULT_SET_DEFINITION TO IT_RESULT_SET_DEFINITION.
CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE
EXPORTING
IV_OBJECT_TYPE_CODE = <MDM Main Table>
IT_RESULT_SET_DEFINITION = IT_RESULT_SET_DEFINITION
IT_KEYS = WA_KEYS
IMPORTING
ET_RESULT_SET = IT_RESULT_SET.
LOOP AT IT_RESULT_SET INTO
WA_RESULT_SET.
*PASS KEYS INTO MAIN TABLE TO GET Structure for FALT or Look up Table
TRY.
CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE_SIMPLE
EXPORTING
IV_OBJECT_TYPE_CODE = <MDM Main Table>
IT_KEYS = WA_KEYS
IMPORTING
ET_DDIC_STRUCTURE =<SAP Strct having all Look up fileds of MDM>
ENDTRY.
LOOP AT <SAP Strct having all Look up fileds of MDM> INTO <Work area>.
CLEAR WA_KEYS.
APPEND <Work area>-field name TO WA_KEYS.
CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE_SIMPLE
EXPORTING
IV_OBJECT_TYPE_CODE = <MDM Lookup table name>
IT_KEYS = WA_KEYS
IMPORTING
ET_DDIC_STRUCTURE = <Single Structure in SAP For Lookup field>.
READ TABLE <Single Structure in SAP For Lookup field>. INTO <Work Area> INDEX 1.
Here you can get the value of realted lookup fields associated with main table data.
ENDLOOP.
ENDLOOP.
LR_API->MO_ACCESSOR->DISCONNECT( ).
Edited by: Shyam Babu Sah on Nov 24, 2009 4:52 AM -
Mr Heil Bernd(SAP) has coutersly installed the MDM SP5 5.5.41.70 but when I try a simple example :
report ZFDOMDMTEST3.
DATA log_object_name TYPE mdm_log_object_name.
DATA language TYPE mdm_cdt_language_code.
log_object_name = 'MYQASMDM'.
language-language = 'eng'.
language-country = 'US'. language-region = 'USA'.
CALL FUNCTION 'MDM_ACCESSOR_CONNECT'
EXPORTING
is_repository_language = language
iv_log_object_name = log_object_name
EXCEPTIONS
ex_api_usage_error = 1
OTHERS = 6.
I've always a lv_rc in the provider class: -2174565.. so <> 0.
My class provider is: MDM5.5 SP05 Patch 0, Server Build 5.5.40.79 - 5.5.40.xx
As I know there's no upper version of MDM ABAP API.
Thanks in advance for the help.
FrancescoHello Guys,
First, thanks for your quick answers.
I looking for this patch but I didn't find on the SAP market place. Did you have the url path.
And to answer to Thomas. Yes, it's a new installation and only, SRM is connected until now to MDM.
Thanks again,
BRs Francesco -
Hi,
I'm trying to write a report that extracts information from MDM. Everytime it's called, it has to establish a new connection to MDM where the hand-shake takes about 20-30 secs.
I was wondering if ABAP MDM Connection Pooling exist.
In Java MDM, you can configure J2EE with connection pool, so that you can reuse a connection rather than re-establishing a new connection on every call.
I've read Thomas Jung's WIKI on "How do you implement a MDM Connection Help Class?", however I cannot reuse this class. The static attribute in the class is not persisted.
Did I do something wrong?
I tried turning it into a shared memory root class, however it complains about an object reference still exist and would not allow me to do "dettach_commit( )".
Don't know any other ways to store the connection handle in memory.
Export/Import, SPA/GPA are not OO friendly.
Cheers
MichaelHi Andreas,
Thanks for your reply, it is good to confirm my understanding of the ABAP API connection.
For your interest, I have changed part of the connection code to increase the speed of the connection significantly.
Firstly to clarify, the connection from the ABAP stack to MDM is actually quite fast.
Upon the first call, the method CL_MDM_PROVIDER_SP04_PL03->_LOAD_FIELD_INFORMATION is called which reads the META-DATA from MDM for every table and every field. This could normally take 1 minute in our system landscape. I've changed to code to buffer the meta-data.
In a production/stable environment, it is unlikely for the META-DATA to change rapidly. Hence reading this on every connection is a waste of time.
This could be useful only if we are in implementation phase where this changes all the time.
1) In transaction MDMAPIC, I've added the ABAP implementation for MDM Version Support as my own MDM provider class ZSP04_PL03 with provider type ZCL_MDM_PROVIDER_SP04_PL03.
ZCL_MDM_PROVIDER_SP04_PL03 is a copy of CL_MDM_PROVIDER_SP04_PL03.
2) In ZCL_MDM_PROVIDER_SP04_PL03, the method LOADFIELD_INFORMATION is changed to read from buffer first before calling MDM. If the buffer is empty, it will read from MDM and store result into buffer etc.
I'm storing the information in a transparent table at the moment.
I buffer the three class attributes:
- mt_field_meta_data,
- mt_mdm_field_meta_data,
- mt_field_code2id_map.
As MT_FIELD_META_DATA is a complex structure (i.e. tables within table), I had to split it up into many different tables.
I can provide the code if you are interested.
Cheers,
Michael. -
MDM ABAP API Performance Problems
Hi all,
we developed a custom transaction into our ECC 6.0 system to remotely retreive data coming from MDM (7.1 SP05) and show them to the user. The 2 systems phisically reside in different datacenters, so running in the same WAN but in 2 different AD domains and 2 different ip networks.
In short the transaction is working using the standard MDM ABAP API functionalities and getting the MDM data using the following methods:
CALL METHOD lr_api->mo_accessor->connect
CALL METHOD lr_api->mo_core_service->query
CALL METHOD lr_api->mo_core_service->retrieve
CALL METHOD lr_api->mo_accessor->disconnect.
This is working, but with awful performances. for example to get a subset of materials (around 500 codes) it takes more than 1 minute, and the quantity of data transfered from MDM to ECC (around 30 KB) is not justifying this time.
Please be so kind to suggest any kind of activity that I can perform to improve the situation.
Thanks in advance.I am trying to retreieve date from MDM to ECC using ABAP API.I am getting the below dump.
Short text
An exception occurred that was not caught.
What happened?
The exception 'CX_MDM_PROVIDER' was raised, but it was not
along
the call hierarchy.
Since exceptions represent error situations and this error
adequately responded to, the running ABAP program
'CL_MDM_PROVIDER_71_SP00_PL00==CP' has to be
terminated.
What can you do?
Note down which actions and inputs caused the error.
To process the problem further, contact you SAP system
administrator.
Using Transaction ST22 for ABAP Dump Analysis, you can loo
at and manage termination messages, and you can also
keep them for a long time.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_MDM_PROVIDER', was not caught in
procedure "GET_LOC_SUPP" "(METHOD)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
Internal error: field 'SEARCH_GROUPS' not found; contact your system
administrator
Please check at this point I am getting dump:
LT_SEARCH_TUPLE_PATH
Table IT_1806[0x12]
\CLASS=CL_MDM_PROVIDER_71_SP00_PL00\METHOD=IF_MDM_CORE_SERVICES~QUERY\DATA=LT_SEARCH_TUPLE_PAT
Table reference: 1612
TABH+ 0(20) = 000000000000000007000000579D710000000000
TABH+ 20(20) = 0000064C0000070E000000000000000CFFFFFFFF
TABH+ 40(16) = 04000138000F44A0000424E403000000
store = 0x0000000000000000
ext1 = 0x07000000579D7100
shmId = 0 (0x00000000)
id = 1612 (0x0000064C)
label = 1806 (0x0000070E)
fill = 0 (0x00000000)
leng = 12 (0x0000000C)
loop = -1 (0xFFFFFFFF)
xtyp = TYPE#000300
occu = 4 (0x00000004)
accKind = 1 (ItAccessStandard)
idxKind = 0 (ItIndexNone)
uniKind = 2 (ItUniNo)
keyKind = 1 (default)
cmpMode = 12 (ILLEGAL)
occu0 = 1
stMode = 0
groupCntl = 0
rfc = 0
unShareable = 0
mightBeShared = 0
sharedWithShmTab = 0
isShmLockId = 0
isUsed = 1
isCtfyAble = 1
hasScndKeys = 0
hasRowId = 0
scndKeysOutdated = 0
scndUniKeysOutdated = 0
LV_MESS
field 'SEARCH_GROUPS' not found
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6666622544544545455522667266766222222222222222222222222222222222222222222222222222222222222222
695C407351238F72F50370EF406F5E4000000000000000000000000000000000000000000000000000000000000000
SY-REPID
I am picking the data from MAIN TABLE MDM_SUPPLIER_MAP and below is the code.
CALL METHOD lv_mdm_api->mo_core_service->query
EXPORTING
*Main Table
iv_object_type_code = 'MDM_SUPPLIER_MAP' "#EC NOTEXT
* it_query = lt_query
IMPORTING
et_result_set = lt_result_set.
Please suggest solution to get the records from MDM to ECC.
When I am tring to replace the abpove with the below code it is working.But in this case I need to retreive all the data instead of using DO and ENDO.Could any please suggest solution.
DO 10 TIMES.
APPEND sy-index TO keys.
ENDDO.
CALL METHOD lv_mdm_api->mo_core_service->retrieve_simple
EXPORTING
iv_object_type_code = 'MDM_SUPPLIER_MAP'
it_keys = keys
IMPORTING
et_ddic_structure = result_ddic -
Hi All,
After creating Repository on MDM Server Using MDM ABAP APIs, when i call MDM_Accessor_connnect function module to connect the Repository i am geeting Error: Server Return Code 0XFFAA0201 :User not found. Even i have created same Identical user name with Password who has logged onto the R/3 System as suggested in HowTo_02.pdf
Assure Points will be awarded if problem solves.
Am i missing any settings please suggest.
Regards,
MandyHi Mandy,
Give the user name which is same as R/3 system in Capital letter. Dont give any password .
Regards,
Nikhil
Maybe you are looking for
-
How do I sync my iphotos to itunes- step by step
I am trying to dowload photos from a MacBook Pro into the ipad2. I have read other post that state I need to sync iphotos into itunes. I am not sure on how to sync the two together. Can someone pliisss help.
-
Iphone 4s wireless issues on a .1X enterprise network
Hi, I'm having a problem with my iphone 4s dropping connection with a .1X enterprise network. I can connect but after about 15 minutes the wireless will drop and i have to manually reconnect to it. I've turned off the 3g service as it would try and r
-
Can PauseApp be used instead of PushRegistry
Hi! I am developing a midlet which main task is reminding. So I need to make the Midlet "sleep" and "Wake up" with a sound (crucial) when the user needs to be reminded. For that purpose i am aware of the possibility to used pushregistry. However for
-
Role Menu/Function using BAPI
In an effort to integrate a customers two products, I am trying to list out all of the roles and menus assigned to a role using JAVA/JCO and BAPI. Is this relationship well defined enough to use RFC_GET_TABLE_ENTRIES? I can get a list of the role na
-
Return sliced image to original
Is it possible to take a sliced image and put it back to just one image? The image was sliced in Photoshop and I use Fireworks...when we add to a page on the site the proportions in the sliced cells don't always work the way I want them too...so I wo