Skip to Content
0
Mar 07, 2014 at 10:40 PM

Get domain value range dynamically

988 Views

Hi all,

I need to create a dynamic method that retrieves the value range (key-value) of a domain.

It is pretty simple to get fixed values using FM DD_DOMVALUES_GET, but how do I manage a value table?

For example:

  • Field XFELD has fixed values so use DD_DOMVALUES_GET

  • Fields BUKRS and SPRAS have value tables.

I can get the value table name using FM DDIF_FIELDINFO_GET and retrieve the data from that table. Unfortunately, I can be sure to get the right key field, but I can't be sure to get the right value field, it depends on the value table definition.

BUKRS has T001 that stores the text in field BUTXT of the same instead SPRAS has T002 that stores the text in text table T002T in field SPTXT.

Is there any standard function module that does the trick?

In this thread Former Member managed it manually using a case statement, but I would avoid it, too many case statements...

Thanks

Ivan