cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot Modify the checkouted record via API

Former Member
0 Kudos

Hi support,

I checkouted a record with the user Admin through API and when I modified it with the user Admin it threw the exception message below.

Caused by: com.sap.mdm.internal.protocol.manual.ServerException:

at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:119)

at com.sap.mdm.data.commands.ModifyRecordCommand.executeImpl(ModifyRecordCommand.java:153)

I used the Admin role but the message told me I didn't have enough right to modify the record. Then I tried to modify it by MDM DataManager and I modified the record successfully. Here is the piece of the code:

RecordId[] rIds = new RecordId[1];

rIds[0] = record<i>.getId();

CheckoutRecordsCommand corc = new CheckoutRecordsCommand(rep.connPool);

corc.setSession(rep.getUserSession());

corc.setRecordIds(rIds);

corc.setTableId(mainTableId);

corc.execute();

try{

ModifyRecordCommand mrc = new ModifyRecordCommand(rep.connPool);

record<i>.setFieldValue(fieldIds[5], qDataValueV);

mrc.setSession(corc.getSession());

mrc.setRecord(record<i>);

mrc.execute();

}catch(Exception e){

e.printStackTrace();

}

Could you kindly give me a solution?

Thanks&Regards,

Song

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

after checkout, you will get a new record id.

I think your modification should base on the new record id.

Former Member
0 Kudos

Hi John,

Thanks for your help. I search the record again before modifying it and it works well now.

Answers (0)