cancel
Showing results for 
Search instead for 
Did you mean: 

How to get RegionCode (values and descriptions) in ABSL?

ACORDERO
Participant
0 Kudos

Hi,

I need to find a RegionCode (Data Type) using the description, for example if I have 'Liverpool' I want to get its code 'LV'.

Is there any way to do this using scripting?

I know that using the QueryCodeListIn Web Service I can get all the values for a specific country but I would like to avoid this workaround.

Thanks,

Alejandro Cordero.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Alejandro,

I've never found a way to achieve it. I think it's not possible.

I found only the opposite operation available, to get a description based on a value.

Regards,

Alexandre.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Alejandro,

I am sorry, but Alexandre is right.

There is no such way.

Sorry,

  Horst

ACORDERO
Participant
0 Kudos

Thank you both for your answers.

It is a pity that we cannot do this

Regards,

Alejandro Cordero.

Answers (1)

Answers (1)

Former Member
0 Kudos

I am not sure if I understood your question correctly, But if you have liverpool and you want to get its code then you can use foreach loop in ABSL and use getDescription function for the element and compare 'Liverpool'. If it matches then use your element.content to get its code.


But I am not sure if I understood your question. Sorry in advance!

ACORDERO
Participant
0 Kudos

Hi Saurabh,

That would work if I have a the list of Codes, and that's the issue, we cannot get the list using ABSL.

Regards,

Alejandro Cordero.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Alejandro,

What about this coding:

import ABSL;

import AP.Common.GDT;

var myRegionCode : RegionCode;

var myRegionCodeDesc = myRegionCode.GetDescription();

Bye,

   Horst

ACORDERO
Participant
0 Kudos

Hi Horst,

I've tried your code but when I run it, myRegionCodeDesc is empty, we need to have a listID and a content (Code) in order to get the description, for example:

import ABSL;

import AP.Common.GDT;

var myRegionCode : RegionCode;

myRegionCode.listID = "GB";

myRegionCode.content = "LV";

var myRegionCodeDesc = myRegionCode.GetDescription();

myRegionCodeDesc will have the value 'Liverpool', that is fine, but my requirement is the opposite, having 'Liverpool' I want to get the Content (Region Code).

Thanks,

Alejandro Cordero.

Former Member
0 Kudos

Hi Alejandro,

Well, if you really need this you can try another approach, for example... =/

Create a custom BO with all the values (ListIDs, codes and descriptions) and query the BO. Unfortunatelly, you'll have to maintain it.

Sorry about this ideia. I hope u dont need it =/

Alexandre.

ACORDERO
Participant
0 Kudos

Hi Alexandre,

Thanks for the idea, I already implemented it and it is working. Fortunately I do not need all the existing values otherwise it will be a nightmare.

It is a pity that we can access to that information using the CodeList Web Service and we cannot do it using ABSL

Regards,

Alejandro Cordero.

former_member186648
Active Contributor
0 Kudos

Hi Alejandro,

Webservice could also be called in ABSL, you need to create external service integration (WSID) for the webservice, you could refer help documentation for this.

Thanks, Pradeep.