on 10-11-2006 5:04 PM
Hi,
I am trying to fetch data & images from MDM.
Could anyone of you forward me some useful pointers to JAR Files and some good coding snippets on the same?
Regards,
Dev
1 point which i missed (& in case you haven't noticed) is that i want to use Web Dynpro - Java to fetch the data.
Regards,
Dev.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For MDM related issues, there is another forum in place
Expert Forums » SAP NetWeaver » SAP Master Data Management
and for answer to your queries.
if you want to fetch records from mdm repository, i will give u the algorithm, if you need the code also, let me know.
Get a connection to the repository using the server name. a simple get connection command.
1. SimpleConnectionFactory.getInstance( SERVER Name);
2. Create an instance of RegionProperties;
3. Get a repository identifier using
RepositoryIdentifier
4. Get the session Id : you have to create and Authenticate Session ID, use
CreateUserSessionCommand to create the session; like the following code
5. Create Repository Session using CreateRepositorySessionCommand
6. Repository Schema using the following code
AuthenticateRepositorySessionCommand
You got the repository Schema, now use it the way you want to.
This is the basic that you need to do before doing any transaction with MDM Repository/server.
Now it comes to your work.
If you want to search, use search commands.
e.g general search of records from the table, say I want to fetch all the records from a table,
You have the repository schema. Use it and get the table Id. Using
repositorySchema.getTable(tableName).getId();
Array of fieldCodes of a given table.
fieldCodes = repositorySchema.getFields( tableCode ) ;
Similarly you can fetch fieldIds
FieldProperties[] fieldProperties=schema.getTableSchema(tableId).getFields();
for(int i=0;i<numOfFields;i++){
fieldIds<i>=fieldProperties<i>.getId();
}
Use the following code to get RECORDRESULTSET.
ResultDefinition resultDef=new ResultDefinition( tableID );
resultDef.setSelectFields(fieldIds);
Search search=new Search(tableID);
try{
RetrieveLimitedRecordsCommand limitedRecordsCommand=new RetrieveLimitedRecordsCommand(conAc);
limitedRecordsCommand.setSearch(search);
limitedRecordsCommand.setSession(sessionId);
limitedRecordsCommand.setResultDefinition(resultDef);
try
{
limitedRecordsCommand.execute();
}
catch( CommandException cme)
{
throw new CommandException( error + " CommandException = " + cme.getMessage( ) ) ;
}
recordResultSet = limitedRecordsCommand.getRecords();
This is like a regular result set. You will have to use the required APIs to work with this.
Let me know if you need more details.
Regards
Nitin
Edited by: Nitin Mahajan on May 20, 2008 7:23 AM
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.