‎2006 Apr 06 9:55 PM
Hi,
I have an abap program with more than 1000 global variables. I want to run the program and at a specific point show a report with names and runtime values of all the global variables in the program. Is there some system table which stores all the global variable names and source code? Kindly help.
Satya
‎2006 Apr 06 10:23 PM
I am not sure I understood your requirement. 'At a specific point', do you mean when the program is running and it reaches a certain point? The values are available to the program at that point of time, so I don't see why you need system tables etc. Can't you just write the values at that specific point?
Please give some clarification.
Srinivas
‎2006 Apr 06 10:37 PM
Hi Srinivas,
Thank you for the reply. Actually I CAN write the values one by ony using WRITE statements at a specific point the in the program but I would have to write atleast 1000 write statements to accomplish this. Instead if there is a system table which stores the global variables for a program / source code I can get the names of the global variables dynamically at runtime and print them
‎2006 Apr 06 10:56 PM
OK, now I understand. Your issue is with the large number of WRITE statements. I am not sure how easy this is but whenever there is a dump, system writes out all the information including values of the variables. It will not be anywhere in the database tables but I think it may be in some system memory areas. I don't know if there is a easy way to get that information.
‎2006 Apr 07 9:00 AM
Hello Satya,
You can store all your global variables in one internal table.
let's say your Itab contains 1000 fields. Now, if you want to retrive the name of the itab, you can use the system call.
DATA: IT_COMP LIKE RSTRUCINFO OCCURS 0 WITH HEADER LINE.
*-- Getting fields of internal table
CALL 'AB_STRUC_INFO'
ID 'PROGRAM' FIELD SY-CPROG
ID 'STRUCNAME' FIELD P_ITAB
ID 'STRUCINFO' FIELD IT_COMP-SYS.
After getting all your fields in it_comp table you can use field symbol to get the values of your fields.
Regards,
Reward points, if it is useful...!
‎2006 Apr 07 9:57 PM
Thanks Naimesh, it doesnt completely solve my problem but it certainly helps. I have awarded 6 points.