CreateRecordCommand Vs CreateRecordsCommand

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

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.

Browsing through the MDM Java API documentation I found two classes for creating records in the repository:

  • CreateRecordCommand &
  • CreateRecordsCommand

While the first command is used to create individual records in the repository, the following CreateRecordsCommand is used for mass record creation.

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.

Using CreateRecordCommand you can get 'recordId' of the newly created record but using CreateRecordsCommand the API provides us various methods to retrieve

  • FailedRecordMessages
  • Succeeded Record recordIds
  • Failed and Succeeded Record Arrays, containing corresponding indexes in the records array initially passed into CreateRecordsCommand
  • Array of all records passed into CreateRecordsCommand

Please use the link of MDM Java API javadoc link http://help.sap.com/javadocs/MDM/SP06P2/index.html 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.

Signing off for now....... till my next page in this series.

SAP Developer Network Latest Updates