‎2006 Nov 13 7:14 PM
Hello,
If I created some data elements that I do not use anylonger is there a way to find out which are no longer used in my program (not manually)? I might have 50 of them and it is not efficient to go through each manually.
Just like JavaWD has ADJUST IMPORTS feature that deletes imports that are not used.
Thank you.
‎2006 Nov 13 7:26 PM
If you are referring to declared variables that are not used in the program, you can obtain a list using the extended program check. From SE38, go to Program->Check->Extended program check. Deselect all options except "Field attributes" and execute.
‎2006 Nov 13 7:32 PM
Hi Michael,
This is exactly what I am referring to. However, it is not a program but a method of a class. Also, I do not want to simply display them but to delete them. Is there a feature that will delete them automatically by my request?
Thank you
‎2006 Nov 13 7:34 PM
Hi Georgy,
You can perform the <b>Extended Program check</b> which reveals the details of the Data elements which are declared but not being used anywhere in the program.
In the SE38 editor Menu , Program -- > Check ---> Extended Program check.
There in the <b> Field Attributes</b> --> <b>Warnings</b> section you can find all such fields with the following messge.
<i><b>Field "fieldname' is not referenced statically in the program</b></i>
‎2006 Nov 13 7:38 PM
Hi Vinod,
Yes, thank you. As Michael pointed out I can do that. Unfortunately, this is not what I need. I do not want to look at them but rather delete them by request.
Please have a look at my post above.
Thank you.
‎2006 Nov 13 7:59 PM
Not quite what you are looking for, but you could write your own program for this. The following call will pass the class and method, returning the program name of the source code:
call method convert_type_and_name
exporting mtdkey = mtdkey
section_limu = seok_limu_method
importing incname = program_name
exceptions not_converted = 1.
mtdkey is defined as type SEOCPDKEY.
You could call this and then use "READ REPORT program_name INTO itab" to import the source code into an internal table. Form "checkDataFields" in include LSLINF09 has the code used for the standard extended program check and you could use some of this logic as a template.