cancel
Showing results for 
Search instead for 
Did you mean: 

How may I run an assignment on all MDM main rows?

Former Member
0 Kudos

Using Java MDM API, how do I run an assignment on all MDM main rows? There are approx. 20,000 rows on the main table. I am using the ExecuteAssignmentsCommand and the setRecordsIds() is required. The assignment executes fine when I supply one or more recordIds. Is there a way to run it against all records without building an array of all the recordIds? Because I would have to retrieve all the rows to get their Ids, build the array and then pass it to the command. It seems overkill to do that.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Manolis,

Please try :

public class RetrieveRecordsByValueCommand
extends AbstractUserSessionCommand

Retrieves records by field values.This can be the flag value such asTRUE/FALSE.

It works best on a field that has unique field values. If there are multiple matches, the record selected is indeterministic. If there is no match for a given field value, the returned record will have a record Id of RecordId#INVALID_RECORD_ID.

The supported fields to match on are:     

Fixed Width Text

Normalized Text

Auto ID

Integer

Thanks,

Ravi

Former Member
0 Kudos

Hi Ravi,

I am not sure I understand how your answer fits my original question which is: How can I execute an assignment in Java API for all records in the main table without having to specify each and every recordid?

Thanks

Manolis

Former Member
0 Kudos

Hi Manolis,

what I meant was using a particular value range of a Field you can break the RecordIds in to smaller arrays,and run this for separate value ranges.You later pass these to the commands.

Below link will be useful for that -

http://help.sap.com/javadocs/MDM71/com/sap/mdm/assignment/commands/ExecuteAssignmentCommand.html#get...()

Thanks,

Ravi

Former Member
0 Kudos

Hi,

For this large number of records, you should execute the assignment from MDM system itself as one time activity. Open Data Manager, select all records, right click and select the assignment you want to execute and execute it. All value assignments will be done.

After this initial run you can execute the assignment on newly created records as and when those are created. Hope this helps you.

Thank you.

Former Member
0 Kudos

Thank you for the reply Ankush but I was looking to automate the running of assignment by scheduling a Java batch program to run. The reason for my request is that we occasionally mass update the MDM records and may change the value of some fields that are used to determine the value of the field that stores the result from the assignment. Currently the Business user runs the assignment as you described in your response but I was looking to make it easier for the user by automating this task.

Former Member
0 Kudos

Hello

For example

You can configure your import server to start import process for example, once a day

Create Workflow for loading after import where you will call your assignments

Add Workflow call to your import map

When records will update or add your assignments will fire

Regards

Kanstantsin Chernichenka

Former Member
0 Kudos

HI Manolis,

I had suggested the solution based upon your query, that for the records already in the system you can run assignment manually as a one time activity. Since you also want this assignment to run during Mass import of data as well, then you have to get this done through MDM workflows for sure as automation of assignment execution is only possible through Workflows in MDM.

So as suggested in the above post, create a Workflow and link the assignment to the workflow.

Also you have to add workflow to the Import map(In Configuration ---> Options ---> Import) that you are using so that it could be triggered after the import of data and in turn will execute the assignment on the imported records.

If you find this tedious then you have to go with manual execution of the Assignment.

In Data Manager, you can search imported records using filter criteria as Last Updated By - UserID of person doing imports and Last Updated On - Date of Import(generally today's date).

Then you can select all the records displayed on search result and right click and execute the assignment. For automation you have to involve Workflows. I hope this helps.

Thank you.

Former Member
0 Kudos

Hi Ankush,

I appreciate your response again but we are going around my specific request.

My goal is to automate the execution of assignments by developing a java application to run the assignment and using a scheduler to run the java program on specific date. My original question is: How can I execute an assignment in Java API for ALL records in the main table without having to specify each and every recordid on the ExecuteAssignmentsCommand ?

Let me give you more detail on our situation. We do use import to update the records but we also use other ways to update multiple records. So, rather than executing the assignment everytime the record changes we thought that we can wait until all updates have been done throughout the month and then run the assignment at the end of the month. Right now that is being done manually by the user who has to remember to do it at the end of each month.

Manolis

Former Member
0 Kudos

Hi Manolis,

For Import action, you can go ahead with Workflow+Assignment.

For other updates, you can go ahead with Java API commands.

But you will have to perform set RecordID and get RecordID method calls for this.

You can reduce the load on Java API a bit by adopting separate workflow for Imported records.

Thank you.