APBP--Find Unused Includes

REPORT  zunusedincludes.

TYPES:
  BEGIN OF t_all_includes,
    prog LIKE d010sinf-prog,
  END OF t_all_includes,

  BEGIN OF t_used_includes,
    include LIKE d010inc-include,
  END OF t_used_includes.

DATA:
  itab_all_includes TYPE STANDARD TABLE OF t_all_includes,
  itab_used_includes TYPE STANDARD TABLE OF t_used_includes,
  wa_all_includes TYPE t_all_includes,
  wa_used_includes TYPE t_used_includes.

START-OF-SELECTION.
* get a list of all includes first
*(the appl ne 'S' removes classes* from the list)

  SELECT prog
    INTO TABLE itab_all_includes
  FROM d010sinf
  WHERE prog LIKE 'Z%'
    AND subc = 'I'
    AND appl NE 'S'.
  SORT itab_all_includes BY prog.

 * this table is a list of includes with parent program
  SELECT include
    INTO TABLE itab_used_includes
  FROM d010inc
  WHERE include LIKE 'Z%'.
  SORT itab_used_includes BY include.

 * now list the includes that are not in the above table
 LOOP AT itab_all_includes INTO wa_all_includes.
    READ TABLE itab_used_includes
                            WITH KEY include = wa_all_includes-prog
                            TRANSPORTING NO FIELDS
                            BINARY SEARCH.

    IF sy-subrc NE 0.
      WRITE:/
             wa_all_includes-prog.
    ENDIF.
  ENDLOOP. 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值