Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Find the Include Programs which are not used

Former Member
0 Kudos

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.

4 REPLIES 4

Former Member
0 Kudos

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.

0 Kudos

Hi, Srikanth

Please Check Table: D010INC: Where-Used Table for ABAP INCLUDEs

Please Reply if need more help related.

Regards,

Faisal

jayanthi_jayaraman
Active Contributor
0 Kudos

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

WCJOS
Newcomer
0 Kudos

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 COUNTFROM wbcrossi WHERE name ele.
    IF NOT sy-subrc IS INITIAL.
      WRITE/ ele.
    ENDIF.
  ENDLOOP.