cancel
Showing results for 
Search instead for 
Did you mean: 

MDM Java API 2 - update of qualifier fields

Former Member
0 Kudos

Hi

since I updated to the latest Patch SP5 Patch 2 of the MDM Java API, I cannot update any qualifier field values.

This is what I do:

QualifiedLookupValue qlv = (QualifiedLookupValue) record.getFieldValue(FIELD_ID_CATALOG);

qlv.setQualifierFieldValue(index, someFieldId, new IntegerField(someInt));

record.setFieldValue(FIELD_ID_CATALOG, qlv);

The ModifyRecordCommand then shows up with an exception: "com.sap.mdm.internal.protocol.manual.ServerException: Das Feld kann nicht bearbeitet werden" (The field cannot be modified, ErrorCode: -5631993, RC_CM_FIELDNOTEDITABLE).

Before I made the update, the update worked as expected. Has there been a conceptual change of how this must be done? Or is this just a bug?

Please help! Thank you

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Roger,

We had same issue, as a work around this is how we updated qualifier fields.

QualifiedLookupValue qlv = (QualifiedLookupValue) record.getFieldValue(FIELD_ID_CATALOG);

LinkedHashMap map = new LinkedHashMap();

map.put(FIELD_ID_CATALOG, new IntegerValue(someInt));

QualifiedLinkValue[] qualifiedLinkValues = qlv.getQualifiedLinks();

QualifiedLinkValue qLink = qualifiedLinkValues[0];

QualifiedLinkValue qNlink = new QualifiedLinkValue(qLink.getLookupId(), map);

QualifiedLookupValue qualifiedLookupValue = new QualifiedLookupValue();

qualifiedLookupValue.addValue(1, qNLink);

qualifiedLookupValue.setCompleteSet(false);

Then use

ModifyRecordCommand

record.setFieldValue(FIELD_ID_CATALOG, qlv);

Anu

Former Member
0 Kudos

Hello Anu

thanks for your reply.

The workaround you showed will create a <i><b>new QualifiedLink-Record</b></i> and will not update an existing.

So I tried to use the other constructor of QualifiedLink, which should keep the existing Link (as stated in the JavaDocs):


new QualifiedLinkValue(qLink.getLinkId(), qLink.getLookupId(), map);

But it still won't work. Now I get an exception with ErrorCode -2080243705 "Error while executing the SQL statement".

In the Logs I can see, that it was trying to INSERT another Qualified Link with the same Ids, which results in a Unique Key Constraint violation.

Why is it not perfoming an UPDATE-statement?

Former Member
0 Kudos

According to SAP, this is happening, if one of the qualifier fields is of type Timestamp.

It should be fixed with Release SP06.

Former Member
0 Kudos

No it didn't create new qualifier link in my case, as I am passing the id of the old qualifier link it does update the existing link not add new one. That is good to hear from SAP that we don't have to go round about to update qualifiers table with SP06. There are so many bugs SAP says that will be fixed in SP06.

Anu

Former Member
0 Kudos

Still the same after applying HotFix 4 from 11.09.2007 (v5.5.42.65)!

Can someone please try this?

Thanks!