Is there any way of programmatically getting the value of a Text Symbol at runtime?
The scenario is that I have a simple report that calls a function module. I receive an exported parameter in variable LV_MSG
of type CHAR1
. This indicates a certain status message created in the program, for instance F
(Fail), X
(Match) or E
(Error). I currently use a CASE
statement to switch on LV_MSG
and fill another variable with a short description of the message. These descriptions are maintained as text symbols that I retrieve at compile time with text-MS#
where # is the same as the possible returns of LV_MSG
, for instance text-MSX
has the value "Exact Match Found".
Now it seems to me that the entire CASE
statement is unnecessary as I could just assign to my description variable the value of the text symbol with ID 'MS' + LV_MSG
(pseudocode, would use CONCATENATE
). Now my issue is how I can find a text symbol based on the String representation of its ID at runtime. Is this even possible?
If it is, my code would look cleaner and I wouldn't have to update my actual code when new messages are added in the function module, as I would simply have to add a new text symbol. But would this approach be any faster or would it in fact degrade the report's performance?