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