2009 Sep 09 6:05 AM
Hii..
I have to write a code to find out all the Include programs in my system which are not used. I am unable to find the correct table for that. I checked TADIR & Reposrc tables, but i am unable to differentiate between the "Includes which are used" and the "Includes which are not used". Let me know if there is any table which differentiates this.
Thanks.
Best Regards,
Srikanth.
2009 Sep 09 8:13 AM
Hii All,
Any help on this is much appreciated.
I need to find all the Z Includes which are not at all used in the Main programs.
I can get all the Includes from TADIR or REPOSRC tables, but after that how to find out which include is not used? Manually it takes much time as we have more than 1000 includes.
Plz help.
Thanks.
Best Regards,
Srikanth.
2009 Sep 09 8:28 AM
Hi, Srikanth
Please Check Table: D010INC: Where-Used Table for ABAP INCLUDEs
Please Reply if need more help related.
Regards,
Faisal
2009 Sep 09 8:37 AM
Hi,
Using REPOSRC table, you can get all the program type I(include program).
As suggested, you can then use D010INC table and input all the includes which was found from REPOSRC table. For the includes which doesn't have any matching entry, then we can determine that it is not been used.
Edited by: Jayanthi Jayaraman on Sep 9, 2009 3:41 AM
2024 Feb 07 10:11 AM
Hello Srikanth,
please try the report below. I have used it with selection-screen input Z* to find customer specific includes. I cannot vouch for the accuracy of the results.
Regards Walter
REPORT z_abap_includes_without_usage.
TABLES tadir.
SELECT-OPTIONS:
objname FOR tadir-obj_name.
START-OF-SELECTION.
SELECT i~obj_name INTO TABLE @DATA(incltab)
FROM tadir AS i
INNER JOIN trdir AS j
ON i~obj_name = j~name
WHERE i~pgmid = 'R3TR'
AND i~object = 'PROG'
AND i~obj_name IN @objname
AND i~object = 'PROG'
AND i~delflag = @space
AND j~subc = 'I'.
LOOP AT incltab INTO DATA(ele).
SELECT COUNT( * ) FROM wbcrossi WHERE name = ele.
IF NOT sy-subrc IS INITIAL.
WRITE: / ele.
ENDIF.
ENDLOOP.