‎2014 Mar 07 10:40 PM
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:
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 managed it manually using a case statement, but I would avoid it, too many case statements...
Thanks
Ivan
‎2014 Mar 08 8:15 AM
‎2014 Mar 07 11:08 PM
It should be possible since the system is using it for value helps, maybe you will find the answer there.
‎2014 Mar 08 5:34 AM
Hello Ivan,
Please try to fetch the domain value range by putting a selection query on DD07V table by passing the domain name as the key.
Hope this will work for you.
Regards.
Abhinav Goel.
‎2014 Mar 08 8:15 AM
‎2014 Mar 08 11:21 PM
What I am doing is not quite the same but similar - I am dynamically getting the text description when I have a data element and the value of the variable that references that data element.
I was pointed to CL_TEXT_IDENTIFIER which when you pass in the domain and the value magicaly brings back the text description, despite the fact that, as far as I can see, SAP has set up almost every text table slightly differently - sometimes in the main table like T001W or lFA1, sometimes which just the language and the value as a key, sometimes with extra key fields (e.g. MAKT) and sometimes with added organisational key fields e.g. the same GL account have different text descriptions in different chart of accounts.
I think at some stage CASE statements or subclasses are going to have to come into the equation, due to the utter lack of consistency in SAP table defintions.
Cheersy Cheers
Paul
‎2015 Feb 12 9:46 AM
Hi Ivan,
I am currently looking for exactly the same solution.It would be great if you could share the approach have used read dynamically key-value from a domain with value range table.
Thanks and Regards
Neeta
‎2015 Feb 13 3:27 PM
Hi Neeta,
luckily it was a test case, not a real project. So in the meantime I managed it using a case statement.
It is not the solution that I like but I had no time to investigate further in a better solution.
Ivan