IT WORK/SAP FI and ABAP

[ABAP] 티코드로 EXIT 검색하기 Finding EXIT with TCODE

Bathildis 2023. 5. 11. 10:48
반응형
*&---------------------------------------------------------------------*
*& Report  YEDIT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  YEDIT.

TABLES: TSTC, TADIR, MODSAPT, MODACT,
        TRDIR, TFDIR, ENLFDIR, TSTCT.
DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
DATA : HOTSPOT(30).
PARAMETERS : P_TCODE LIKE TSTC-TCODE OBLIGATORY.

AT LINE-SELECTION.
  GET CURSOR FIELD HOTSPOT.
  CHECK HOTSPOT(4) EQ 'JTAB'.
  SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
  CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.

START-OF-SELECTION.
  PERFORM GET_DATA.
  PERFORM WRITE_LIST.
*&---------------------------------------------------------------------*
*&      Form  get_data
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*   FORM GET_DATA
*----------------------------------------------------------------------*
FORM GET_DATA.
  SELECT SINGLE * FROM TSTC
              WHERE TCODE EQ P_TCODE.
  CHECK SY-SUBRC EQ 0.
  SELECT SINGLE * FROM TADIR
            WHERE PGMID = 'R3TR'
              AND OBJECT = 'PROG'
              AND OBJ_NAME = TSTC-PGMNA.
  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.
    ENDIF.
  ENDIF.
  SELECT * FROM TADIR INTO TABLE JTAB
             WHERE PGMID = 'R3TR'
               AND OBJECT = 'SMOD'
               AND DEVCLASS = TADIR-DEVCLASS.
  SELECT SINGLE * FROM TSTCT
          WHERE SPRSL EQ SY-LANGU
            AND TCODE EQ P_TCODE.
ENDFORM.                    "get_data
*&---------------------------------------------------------------------*
*&      Form  write_list
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*FORM WRITE_LIST
*----------------------------------------------------------------------*
FORM WRITE_LIST.
  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:/(95) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Exit Name',
    21 SY-VLINE ,
    22 'Description',
    95 SY-VLINE.
    WRITE:/(95) SY-ULINE.
    LOOP AT JTAB.
      SELECT SINGLE * FROM MODSAPT
      WHERE SPRSL = SY-LANGU AND
      NAME = JTAB-OBJ_NAME.
      FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
      WRITE:/1 SY-VLINE,
      2 JTAB-OBJ_NAME HOTSPOT ON,
      21 SY-VLINE ,
      22 MODSAPT-MODTEXT,
      95 SY-VLINE.
    ENDLOOP.
    WRITE:/(95) SY-ULINE.
    DESCRIBE TABLE JTAB.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No of Exits:' , SY-TFILL.
  ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(95) 'No User Exit exists'.
  ENDIF.
ENDFORM.                    "write_list
반응형