cancel
Showing results for 
Search instead for 
Did you mean: 

getSelectedFields() for time stamp and user stamp using java api

Former Member
0 Kudos

using Java API's

getSelectedFields() returns NULL value if values presented also, for Time stamp and User stamp

properties in Flat tables , is there any other alternative way to get the SelectedFields values ?

Edited by: Vijaya Sekhar Reddy Alla on Mar 19, 2008 3:16 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello.

Can you provide some code before trying to get the selected fields?

Maybe there has something to be set correctly (that's what happens for me most of the time when I try something out for the first time).

Yet, I don't think there is another possibility.

Best regards

Dominik

Former Member
0 Kudos

FieldId[] fieldIDs = (((UserStampFieldProperties)fieldProp).getSelectedFields());

here fieldPropis of type com.sap.mdm.schema.FieldProperties

here this retruns allways NULL if it have selected field also..

Thanks,

Vijay

Former Member
0 Kudos

Well, I can't say I solved the problem, because I got another one afterwards.

As usually I created a GetFieldListCommand, set its needed attributes and executed it. Then I read all the field properties out:

FieldProperties[] fieldProp = getFieldListCommand.getFields();

Afterwards it is possible to do what you want. Using a for-loop.

for (FieldProperties fp : fieldProperties) {

UserStampFieldProperties usfp = (UserStampFieldProperties) fp; // <= Cast error

FieldId[] fieldIDs = usfp.getSelectedFields();

}

And this is what I get now:

Exception in thread "main" java.lang.ClassCastException: com.sap.mdm.schema.fields.FixedWidthTextFieldProperties cannot be cast to com.sap.mdm.schema.fields.UserStampFieldProperties

Why this happens, I don't know. But it should somehow be solveable.