Skip to Content
author's profile photo Former Member
Former Member

How to update field of MDM table with Java MDM4j?

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2009 at 01:07 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 12, 2009 at 10:50 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2009 at 06:12 AM

    Thank you for the helpful input. I found a solution.

    Cheers

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.