cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected field type -1 in MDM Java API

KennethEriksen
Participant
0 Kudos

Hi,

Our repository has been working fine for months, but after a reload of our repository we are suddenly getting errors in our MDM Java API program. The code which fails is:

Record[] recLocations =	MDM_MaterialFullDetailView.getAllRecords(locationsTableSchema, usc);

It fails with the following error:

java.lang.UnsupportedOperationException: Unexpected field type -1
	at com.sap.mdm.internal.schema.PropertiesHelper.createField(PropertiesHelper.java:274)
	at com.sap.mdm.internal.schema.PropertiesHelper.convertFrom(PropertiesHelper.java:281)
	at com.sap.mdm.internal.data.RecordMetadata.<init>(RecordMetadata.java:56)
	at com.sap.mdm.internal.data.RecordsLoader.<init>(RecordsLoader.java:88)
	at com.sap.mdm.internal.data.RecordsLoader.<init>(RecordsLoader.java:39)
	at com.sap.mdm.internal.data.RecordResultSetHelper.convertFrom(RecordResultSetHelper.java:26)
	at com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand.execute(RetrieveLimitedRecordsCommand.java:184)
	at com.sap.mdm.material.fullmaterial.MDM_MaterialFullDetailView.getRecords(MDM_MaterialFullDetailView.java:860)
	at com.sap.mdm.material.fullmaterial.MDM_MaterialFullDetailView.getAllRecords(MDM_MaterialFullDetailView.java:957)
	at com.sap.mdm.material.MDM_EditMaterialView.onActionSaveUpdatedMaterial(MDM_EditMaterialView.java:4787)

I cannot find any more information in any logs or traces what field is causing this. The function is looking up all records from a qualified lookup table, containing more than 30 fields. I have checked the table dbo.A2i_CM_Fields in the database which contains all repository fields and their field types, but I cannot find any with field type -1.

I don't know of any changes in the repository that could have caused this.

Does anyone know how to find which field is causing this?

What is field type -1?

MDM version 5.5.61.63.

Thanks for all responses!

Br,

Kenneth

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

have u changed something at the schema level in the repository ??

if yes - unload the repo / reload the repo with update indices option and see if it works ?

thanks

-Adrivit

KennethEriksen
Participant
0 Kudos

Hi,

I have already tried to load the repository with update indices option, but to no avail.

I have actually re-created an existing calculated field (which also has unique constraint = TRUE), and that is when the error started. But if I delete this new field again the error is still there.

Any other tips?

-Kenneth

Former Member
0 Kudos

ok - understood - then what seems to be a strong case for this issue is " some " kind of hard coding done in the code (dirty coding)

when you delete and re-create a field the internal serial number is changed and the code might be using that

- as seems from the error.

can u unarchive a repo - from a previous date to the change and see if they work ? - then theres some wrong doing in the code than in MDM - which needs to be addressed there !

thanks

-Adrivit

KennethEriksen
Participant
0 Kudos

I understand what you mean, but there is no hard-coding in my program, especially when it comes to fields. I look up all fieldIDs based on field code in the repository, which remain the same even after I recreate the field.

But the error message says: unexpected field type -1

The new field is exactly the same type as the replaced one, a Text-field, calculated and with DisplayField = YES and Unique = YES.

I can even delete the field and I still get unexpected field type -1.

-Kenneth

former_member206388
Contributor
0 Kudos

Hi Kenneth.

It looks like one particular field is behaving strangely which is stoping to execute the command.

Why can't you iterate to the list of fields available in the result definitions and check its properties and validate it manually(Just to make sure which field is causing this).

Or you can remove fields one by one and execute to find for which field its giving the problem(I Know itz not a good idea but in worst case...)

Regards

Bala

KennethEriksen
Participant
0 Kudos

Hi,

we solved this by doing a DB restore to an earlier state before the field was altered. Everything is working fine now.

Thanks for all tips.

-Kenneth