In some cases, you need to read and analyse the structure of your ABAP program’s variables (fields and internal tables, for example). There are some function modules that can be used to get the symbols (names of fields and internal tables) of any program and then read the type information:
To be sure that you read the last version, it’s a good idea to generate the program with GENERATE REPORT. From my experience, the functions can sometimes fail (with a short dump), and I could not understand why. I simply excluded the programs from my list (that was a mass check program).
A couple of other helpful functions: