首页 > 其他分享 >ABAP 增强查找工具

ABAP 增强查找工具

时间:2023-05-29 11:12:41浏览次数:45  
标签:wf sy tadir object WRITE ABAP 查找 工具 WHERE

*&---------------------------------------------------------------------*
*& Report Z_BARRY_FIND_EXIT_BADI
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT z_barry_find_exit_badi NO STANDARD PAGE HEADING .
TABLES:tstc,tadir,modsapt,modact,trdir,tfdir,enlfdir,sxs_attrt,tstct.
DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA : field1(30).
DATA : v_devclass LIKE tadir-devclass.
PARAMETERS : p_tcode LIKE tstc-tcode,
             p_pgmna LIKE tstc-pgmna.
DATA wa_tadir TYPE tadir.

START-OF-SELECTION.
  IF NOT p_tcode IS INITIAL.
    SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.
  ELSEIF NOT p_pgmna IS INITIAL.
    tstc-pgmna = p_pgmna.
  ENDIF.
  IF sy-subrc EQ 0.
    SELECT SINGLE * FROM tadir
    WHERE pgmid = 'R3TR'
    AND object = 'PROG'
    AND obj_name = tstc-pgmna.
    MOVE : tadir-devclass TO v_devclass.
    IF sy-subrc NE 0.
      SELECT SINGLE * FROM trdir
      WHERE name = tstc-pgmna.
      IF trdir-subc EQ 'F'.
        SELECT SINGLE * FROM tfdir
        WHERE pname = tstc-pgmna.
        SELECT SINGLE * FROM enlfdir
        WHERE funcname = tfdir-funcname.
        SELECT SINGLE * FROM tadir
        WHERE pgmid = 'R3TR'
        AND object = 'FUGR'
        AND obj_name EQ enlfdir-area.
        MOVE : tadir-devclass TO v_devclass.
      ENDIF.
    ENDIF.
    SELECT * FROM tadir INTO TABLE jtab WHERE pgmid = 'R3TR' AND
                                 object IN ('SMOD', 'SXSD')  AND
    devclass = v_devclass.
    SELECT SINGLE * FROM tstct WHERE sprsl EQ sy-langu AND
    tcode EQ p_tcode.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) p_tcode,
    45(50) tstct-ttext.
    SKIP.
    IF NOT jtab[] IS INITIAL.
      WRITE:/(105) sy-uline.
      FORMAT COLOR COL_HEADING INTENSIFIED ON.
      SORT jtab BY object.
      DATA : wf_txt(60)     TYPE c,
             wf_smod        TYPE i,
             wf_badi        TYPE i,
             wf_object2(30) TYPE c.
      CLEAR : wf_smod, wf_badi , wf_object2.
      LOOP AT jtab INTO wa_tadir.
        AT FIRST.
          FORMAT COLOR COL_HEADING INTENSIFIED ON.
          WRITE:/1 sy-vline,
          2 'Enhancement/ Business Add-in',
          41 sy-vline ,
          42 'Description',
          105 sy-vline.
          WRITE:/(105) sy-uline.
        ENDAT.
        CLEAR wf_txt.
        AT NEW object.
          IF wa_tadir-object = 'SMOD'.
            wf_object2 = 'Enhancement' .
          ELSEIF wa_tadir-object = 'SXSD'.
            wf_object2 = ' Business Add-in'.
          ENDIF.
          FORMAT COLOR COL_GROUP INTENSIFIED ON.
          WRITE:/1 sy-vline,
          2 wf_object2,
          105 sy-vline.
        ENDAT.
        CASE wa_tadir-object.
          WHEN 'SMOD'.
            wf_smod = wf_smod + 1.
            SELECT SINGLE modtext INTO wf_txt
            FROM modsapt
            WHERE sprsl = sy-langu
            AND name = wa_tadir-obj_name.
            FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
          WHEN 'SXSD'.
* For BADis
            wf_badi = wf_badi + 1 .
            SELECT SINGLE text INTO wf_txt
            FROM sxs_attrt
            WHERE sprsl = sy-langu
            AND exit_name = wa_tadir-obj_name.
            FORMAT COLOR COL_NORMAL INTENSIFIED ON.
        ENDCASE.
        WRITE:/1 sy-vline,
        2 wa_tadir-obj_name HOTSPOT ON,
        41 sy-vline ,
        42 wf_txt,
        105 sy-vline.
        AT END OF object.
          WRITE : /(105) sy-uline.
        ENDAT.
      ENDLOOP.
      WRITE:/(105) sy-uline.
      SKIP.
      FORMAT COLOR COL_TOTAL INTENSIFIED ON.
      WRITE:/ 'No.of Exits:' , wf_smod.
      WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
      FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
      WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
  ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
  ENDIF.

AT LINE-SELECTION.
  DATA : wf_object TYPE tadir-object.
  CLEAR wf_object.
  GET CURSOR FIELD field1.
  CHECK field1(8) EQ 'WA_TADIR'.
  READ TABLE jtab WITH KEY obj_name = sy-lisel+1(20).
  MOVE jtab-object TO wf_object.
  CASE wf_object.
    WHEN 'SMOD'.
      SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
      CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    WHEN 'SXSD'.
      SET PARAMETER ID 'EXN' FIELD sy-lisel+1(20).
      CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
  ENDCASE.

 

标签:wf,sy,tadir,object,WRITE,ABAP,查找,工具,WHERE
From: https://www.cnblogs.com/ZJY-1314/p/17439887.html

相关文章

  • ABAP 用户批量导入
    REPORTZ_USER_IMPORT.TABLES:E070.DATA:BDCDATALIKEBDCDATAOCCURS0WITHHEADERLINE.DATA:MESSTABLIKEBDCMSGCOLLOCCURS0WITHHEADERLINE.DATA:P_SNTYPEI.****DATA:W_DOCIDTYPEDSVASDOCID,W_EXTENSIONTYPEDSVASDOCID,W......
  • ABAP 用户权限查询报表
    *&---------------------------------------------------------------------**&REPORTZUSER*&---------------------------------------------------------------------**&*&--------------------------------------------------------------------......
  • ABAP 用户角色导入
    *&---------------------------------------------------------------------**&ReportZ_USER_ROLES_IMPORT*&---------------------------------------------------------------------**&*&------------------------------------------------------......
  • ABAP 通用自建表批到
    *&---------------------------------------------------------------------**&ReportZUPLOAD_TABLE*&---------------------------------------------------------------------**&*&------------------------------------------------------------......
  • Doxygen Comment Tags 编程辅助工具注释标记 @brief @param @return
    以@brief@param@return等形式出现的注释标记被称为Doxygen注释标记(DoxygenCommentTags)或者简称为Doxygen标记。这玩意常用来作为接口文档说明或者接口源码注释,又比如EmmyLua用这个来作为lua函数的注释以提供智能提示。常见的doxygen注释标记及其作用:/***@biref简介*......
  • Typora工具使用
    Markdown语法学习标题一级标题:#+空格+标题名字;N级标题:n个#+空格+标题名字;最多六级标题。例如:四级标题五级标题字体1.加粗Helloworld!2.斜体HelloWorld!3.加黑+斜体Helloworld!引用大于号+''努力小喵的博客地址:https://www.cnblogs.com/wrpriblogs/分割线......
  • 源代码管理工具介绍----Github
        源代码管理工具是软件开发中非常重要的工具,它们用于追踪、管理和协调团队成员之间的代码更改。源代码管理工具使开发团队能够跟踪代码的版本历史。这意味着你可以回顾代码的先前状态、比较不同版本之间的差异,并且能够轻松地恢复到先前的工作状态。这对于修复错误、撤销......
  • 微软官方MediaCreationTool(win10、win11安装系统的工具)下载镜像慢问题的解决
    现在重装win10、win11系统,很多人使用微软官方的MediaCreationTool制作U盘镜像,该工具会帮助用户从微软官方下载镜像到U盘,但很多咱们国内地方的下载速度很慢。看了一些说法,最终怀疑到DNS上面来,实际改了一下,效果非常好,我家300Mbps的宽带,以前下这个得4-5个小时,改了DNS只需要不到5分钟......
  • 原型设计工具——墨刀
         墨刀是一款原型设计工具,它可以帮助用户快速制作交互式的应用程序、网站和移动应用的原型设计。该工具主要面向产品经理、UI/UX设计师、开发人员以及其他需要快速制作原型的人群。    墨刀的优点之一是它的易用性。用户只需使用简单的拖放功能即可创建原......
  • 算法学习-二分查找
    题目:C.PlaceforaSelfieCodeforcesRound862(Div.2)题目链接:Problem-C-Codeforces题目描述: 有若干抛物线(抛物线方程为a*x2+b*x+c,每条抛物线的a,b,c值给出)和经过原点,斜率不同的直线(斜率值k给出)。对于每条抛物线找出任意一条直线,它与该抛物线不相交。题目......