cancel
Showing results for 
Search instead for 
Did you mean: 

SAP MDM API 7.1, Region Codes

Former Member
0 Kudos

Using the command GetRepositoryRegionListCommand, I am able to see the following region details from our MDM Repository.


Locale	Region Code	Name
en_US	engUSA		English [US]	
en_GB	eng___		English [GB]	
nl_NL	nld___		Dutch [NL]	
fr_FR	fre___		French [FR]	
de_DE	ger___		German [DE]	
it_IT	ita___		Italian [IT]	
es_ES	spa___		Spanish [ES]	
zh_CN	chi___		Chinese [CN]	
ja_JP	jpn___		Japanese [JP]	
no_NO	nor___		Norwegian [NO]	
pl_PL	pol___		Polish [PL]	
pt_PT	por___		Portuguese [PT]	
ru_RU	rus___		Russian [RU]

When establishing a UserSession, the only region code that appears to work is 'engUSA'. Has anyone else had success using regions other than 'engUSA'?


MDM_REGION_PROPERTIES.setLocale(Locale.ENGLISH);
MDM_REGION_PROPERTIES.setName("English [US]");
MDM_REGION_PROPERTIES.setRegionCode("engUSA");  // error when not 'engUSA'

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Furthermore, if I print the RecordId object, .toString(), I see what appear to be region codes for multilingual text field:


Record
{
  ID=R1
  Fields=
  {
    F24_30=
    {
      fre___ = Catégorie 1, 
      ger___ = Kategorie 1, 
      engUSA = Category 1
    }, 
    F170_4198=screw-gun-box
  }
}

Former Member
0 Kudos

Hi Eujvari,

were you able to resolve this issue?

I am getting a similar error while updating a multi-lingual field, can you please help!

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

what is the right region code for Portugal and Mexico?

Basically no region works except engUSA.

Thanks,

Jyotika

Former Member
0 Kudos

HI Guys

It might be helpful who looked into this query. I have pasted the successful dynamic population for the region codes based on the browser language

  Locale sessionlocal = WDResourceHandler.getCurrentSessionLocale();

RegionProperties regionProperties;
regionProperties = new RegionProperties();
//
//regionProperties.setRegionCode("engUSA");
//regionProperties.setLocale(new Locale("en","US"));
//regionProperties.setName("US");
/***********************************************************************************************************************/
  RegionProperties[] regionProp =null;

          GetRepositoryRegionListCommand getRepRegCmd =

          new GetRepositoryRegionListCommand(mySimpleConnection);

          getRepRegCmd.setRepositoryIdentifier(repId);

        

          try {

           getRepRegCmd.execute();

           } catch (CommandException e4) {

          // TODO Auto-generated catch block

             wdComponentAPI.getMessageManager().reportException(""+e4.getLocalizedMessagesTrace());

          }

          regionProp = getRepRegCmd.getRegions();

          for(int i=0;i<regionProp.length;i++)

          {

           if(regionProp[i].getLocale().getLanguage().equals(sessionlocal.getLanguage()))

           {

             regionProperties.setRegionCode(regionProp[i].getRegionCode());

            break;

            } 

           }

          regionProperties.setLocale(new Locale(sessionlocal.getLanguage(), sessionlocal.getCountry()));

          regionProperties.setName(sessionlocal.getISO3Country());

Hope this will works. Because it is generic code for every browser.