on 08-12-2009 1:15 PM
Hello,
Can anyone please provide an example of how to modify/update a field of an MDM table using java MDM4j?
I'm not trying to update a record just a field of a table.
Thanks
BR Olof
Hi Olof,
For updating a field in a record, below procedure needs to be followed:
First of all you need to have the Record Id for the record where you want to update the field. If you dont have the Record Identifier then you need to get it based on some search.
Secondly use the below code for performing update on the field value:
Create an objec of RetrieveRecordsByIdCommand and set the Record Id
Prepare a ResultDefinition for the given table.
Add the required field using the addSelectField() method of ResultDefinition.
Add this result definition to the RetrieveRecordsByIdCommand an execute the command.
Get the record object from the above command (RetrieveRecordsByIdCommand.getRecords().getRecord(0))
Set the new value against the field that you wnt to update (use ExistingRecord.setFieldValue())
- use the ModifyRecordCommand to update the record by putting the above record (Use ModifyRecordCommand.setRecord(EXISTING RECORD) to set the updated record. Execute the command and you have updated the record.
Hope this helps!!
Cheers,
Arafat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the helpful input. I found a solution.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Olof,
Please refer the MDM Java API Guide:
https://websmp201.sap-ag.de/~sapidb/011000358700000549492008E
Also you will find additional java docs in the below link
http://help.sap.com/javadocs/MDM/index.html
Hope this helps.
Thanks,
SA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.