Skip to Content
avatar image
Former Member

Problem with multiregion

Hi!

i have 2 languages on my MDM Server, English and Spanish, but i cant retrieve values from Spanish language

here is mine code to retrieve values from RecordResultSet

public void findByNomeProduto(String nome) throws CommandException{
		//BUSCAR NA TABELA
		Search search = new Search(Schema.Produtos.TABLE);
		//NO CAMPO
		FieldSearchDimension fsdMaintableType = new FieldSearchDimension(Schema.Produtos.NOME);
		//O VALOR QUE CONTAINS
		TextSearchConstraint tscTypeRoot = new TextSearchConstraint(nome, TextSearchConstraint.CONTAINS);
		
		//ADICIONA PARAMETROS NA BUSCA
		search.addSearchItem(fsdMaintableType, tscTypeRoot);
		
		//DEFINE O RETORNO
		ResultDefinition resultDefinition = getResultDefinition(Schema.Produtos.TABLE, new FieldId[]{Schema.Produtos.NOME,
																									 Schema.Produtos.CATEGORIA		
																									});
		//EXECUTA A BUSCA
		RecordResultSet res = executeSearch(search, resultDefinition);
		
		//LOOP REGIOES 
		for(int iRegions = getRegions().length;iRegions>0;iRegions--){
			RegionProperties region = getRegions()[iRegions-1];
			System.out.println(region.getName());
			//LOOP ROWS
			for(int iRows = res.getRecords().length;iRows>0;iRows--){
				Record rec = res.getRecord(iRows-1);
				
				//VERIFICAR SE EXISTE DESCRIÇÃO NO IDIOMA INFORMADO 
				
				if(rec.getMultiregionFieldValue(Schema.Produtos.NOME).containsRegion(region.getRegionCode())){
					System.out.println(rec.getMultiregionFieldValue(Schema.Produtos.NOME).getValue(region.getRegionCode()));
				}else{	
					System.out.println(rec.getFieldValue(Schema.Produtos.NOME));
				}
				System.out.println(getTaxonomyDescription(rec,Schema.Produtos.TABLE,Schema.Produtos.CATEGORIA_PROPERTIES));
				
			}
		}
		
	}

when in this line "if(rec.getMultiregionFieldValue(Schema.Produtos.NOME).containsRegion(region.getRegionCode()))" and tha language is Spanish it didi'nt enter on the if clause!

i dont undestand it because i know i have spanish description on the mdm server and i can see it by Data Manager !!!

Can anyone helpme please ?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 03, 2008 at 07:58 PM

    Hi! ,

    mine problem is resolved, i found a example in [this link|https://websmp205.sap-ag.de/installmdm] and resolved mine problem!

    tks btw

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Diogo,

      can you please specify how you resolved this problem of multilingual data?

      the link that you mentioned points to the install MMD link of SAP marketplace.

      I am getting the below error when I try to save data for Portugese language

      Exception 1:java.lang.IllegalArgumentException: Value for region code 'por___' was not populated or such region code is not specified for repository

      Thanks!

      Jyotika