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

How to modify/update record of the table that is present in the MDM server

hi friends,

How to modify/update record of the table that is present in the MDM server using MDM Java API?

I need the example code, its urgent

thanks

ramu.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 10:20 AM

    Sample Code for Create and Modify:

     Create Records:

    // Create an empty Record, for the table in which the new record should be added. Input is Table Id.

    Record newRec = RecordFactory.createEmptyRecord(TableId);

    // To Add a Text Value. Inputs are Field Id and Field Value.

    newRec.setFieldValue(FieldId, new StringValue(entValues));

    // To Add a Integer Value. Inputs are Field Id and Field Value.

    newRec.setFieldValue(FieldId, new IntegerValue (entValues));

    // Create the Record . Inputs are Connection Pool, Session Id, created Record with values.

    CreateRecordCommand crRec = new CreateRecordCommand(connections);

    crRec.setSession(sessionId);

    crRec.setRecord(getRecValue);

    try

    {

    crRec.execute();

    }

    catch (CommandException e)

    {

    e.printStackTrace();

    return;

    }

     Modify Records:

    // Create an empty Record, for the record that should be modified. Inputs are Table Id and Record Id.

    Record newRec = RecordFactory.createEmptyRecord(TableId,RecordId);

    // To Add a Text Value. Inputs are Field Id and Field Value.

    newRec.setFieldValue(FieldId, new StringValue(entValues));

    // To Add a Integer Value. Inputs are Field Id and Field Value.

    newRec.setFieldValue(FieldId, new IntegerValue (entValues));

    // Modify the Record . Inputs are Connection Pool, Session Id, created Record with values.

    ModifyRecordCommand modRec = new ModifyRecordCommand (connections);

    modRec.setSession(sessionId);

    modRec.setRecord(getRecValue);

    try

    {

    modRec.execute();

    }

    catch (CommandException e)

    {

    e.printStackTrace();

    }

    Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 11:15 AM

    Hi,

    YOu can refer the following link

    https://help.sap.com/javadocs/MDM/current/index.html.

    Under this goto com.sap.mdm.data.commands

    Regards

    Nisha

    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.