on 07-23-2008 5:31 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.