cancel
Showing results for 
Search instead for 
Did you mean: 

MDM Text Field width?

Former Member
0 Kudos

Hi Xperts,

Front-end dynamic validation, we have a requirement, would have to get the "MDM field width" using MDM Java API and we need to check with user input value length for that Field.

Case.

Suppose, we have MDM Field > Address, type "TEXTu201D and width/size "10".

Portal User > Entered length of 15 char for that field.

You will be appreciate, if you can provide the sample code and MDM WebDynPro API u2013JAVA

Thank you

Bala

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi bala ,

Just try this.

*com.sap.mdm.extension

Class MetadataManager*

RepositorySchemaEx repositoryschema= MetadataManager.getInstance().getRepositorySchema(usrCtx);

where usrctx is usersession context that you create to access yr repository

FieldProperties fProp = repositoryschema.getField(tableName,fieldCode);

where tablename is tablecode in which field belong

field code is code of field that you define in console for that field

FixedWidthTextFieldProperties textField = ( FixedWidthTextFieldProperties) fProp

int lengthField = textField . getWidth()

now you can check yr length with portal field length.

please revert with yr results.

Thanks,

Sudhanshu

Edited by: Sudhanshu Agarwal on Jul 29, 2010 11:51 PM

Answers (0)