cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.