二维码

[其他] 利用t-code查找增强出口的程序工具

Twilight发表于 2014-03-30 21:24zhongguomao 最后回复于 2017-11-07 10:12 [复制链接] 9276 1

选择屏幕输入T-code:VA01 执行结果如下:
增强工具.jpg

程序代码:
  1. REPORT  zdamon_005 NO STANDARD PAGE HEADING.
  2. TABLES : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
  3. TABLES : tstct.
  4. DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
  5. DATA : field1(30).
  6. DATA : v_devclass LIKE tadir-devclass.
  7. PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.

  8. SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.
  9. IF sy-subrc EQ 0.
  10.   SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR'
  11.   AND object = 'PROG'
  12.   AND obj_name = tstc-pgmna.
  13.   MOVE : tadir-devclass TO v_devclass.
  14.   IF sy-subrc NE 0.
  15.     SELECT SINGLE * FROM trdir WHERE name = tstc-pgmna.
  16.     IF trdir-subc EQ 'F'.
  17.       SELECT SINGLE * FROM tfdir WHERE pname = tstc-pgmna.
  18.       SELECT SINGLE * FROM enlfdir WHERE funcname =
  19.       tfdir-funcname.
  20.       SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR'
  21.       AND object = 'FUGR'
  22.       AND obj_name EQ enlfdir-area.

  23.       MOVE : tadir-devclass TO v_devclass.
  24.     ENDIF.
  25.   ENDIF.
  26.   SELECT * FROM tadir INTO TABLE jtab
  27.   WHERE pgmid = 'R3TR'
  28.   AND object = 'SMOD'
  29.   AND devclass = v_devclass.
  30.   SELECT SINGLE * FROM tstct WHERE sprsl EQ sy-langu AND
  31.   tcode EQ p_tcode.
  32.   FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
  33.   WRITE:/(19) 'Transaction Code - ',
  34.   20(20) p_tcode,
  35.   45(50) tstct-ttext.
  36.   SKIP.
  37.   IF NOT jtab[] IS INITIAL.
  38.     WRITE:/(95) sy-uline.
  39.     FORMAT COLOR COL_HEADING INTENSIFIED ON.
  40.     WRITE:/1 sy-vline,
  41.     2 'Exit Name',
  42.     21 sy-vline ,
  43.     22 'Description',
  44.     95 sy-vline.
  45.     WRITE:/(95) sy-uline.
  46.     LOOP AT jtab.
  47.       SELECT SINGLE * FROM modsapt
  48.       WHERE sprsl = sy-langu AND
  49.       name = jtab-obj_name.
  50.       FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
  51.       WRITE:/1 sy-vline,
  52.       2 jtab-obj_name HOTSPOT ON,
  53.       21 sy-vline ,
  54.       22 modsapt-modtext,
  55.       95 sy-vline.
  56.     ENDLOOP.
  57.     WRITE:/(95) sy-uline.
  58.     DESCRIBE TABLE jtab.
  59.     SKIP.
  60.     FORMAT COLOR COL_TOTAL INTENSIFIED ON.
  61.     WRITE:/ 'No of Exits:' , sy-tfill.
  62.   ELSE.
  63.     FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
  64.     WRITE:/(95) 'No User Exit exists'.
  65.   ENDIF.
  66. ELSE.
  67.   FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
  68.   WRITE:/(95) 'Transaction Code Does Not Exist'.
  69. ENDIF.

  70. AT LINE-SELECTION.
  71.   GET CURSOR FIELD field1.
  72.   CHECK field1(4) EQ 'JTAB'.
  73.   SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
  74.   CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
复制代码
回复

使用道具 举报

zhongguomao
666666666666666
回复 支持 反对

使用道具 举报

快速回帖

本版积分规则
您需要登录后才可以回帖 登录 | 注册有礼

快速回复 返回顶部 返回列表