*&---------------------------------------------------------------------*
*& Report ZEXITBADI_FIND*&
*&---------------------------------------------------------------------*
*& This Report Displays the possible Exits and BADIs for a given TCODE*&
*&---------------------------------------------------------------------*
REPORT ZEXITBADI_FIND NO STANDARD PAGE HEADING.
REPORT ZEXITBADI_FIND NO STANDARD PAGE HEADING.
**************************************************************************
TABLES DECLARATION **************************************************************************
TABLES : TSTC, TADIR,TRDIR, TFDIR, ENLFDIR.
TABLES : TSTC, TADIR,TRDIR, TFDIR, ENLFDIR.
TABLES : TSTCT.
**************************************************************************
Types Declaration **************************************************************************
TYPES: BEGIN OF T_INC,
TYPES: BEGIN OF T_INC,
NAME(72),
END OF T_INC.
TYPES: BEGIN OF T_TADIR,
TYPES: BEGIN OF T_TADIR,
PGMID LIKE TADIR-PGMID, "Program ID in Requests and Tasks
OBJECT LIKE TADIR-OBJECT, "Object Name in Object Directory
OBJ_NAME LIKE TADIR-OBJ_NAME, "Object Name in Object Directory
END OF T_TADIR.
**************************************************************************
Type-pools Declaration **************************************************************************
TYPE-POOLS:ICON.
TYPE-POOLS:ICON.
*************************************************************************
* Data Declarations*
************************************************************************
DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
DATA : FIELD1(30).DATA: VALUE1(100).
DATA: PNAME LIKE TFDIR-PNAME,
DATA: PNAME LIKE TFDIR-PNAME,
TYPE(6),
INCLUDE LIKE TFDIR-INCLUDE,
T TYPE T_INC OCCURS 0 WITH HEADER LINE,
IC TYPE ICON_D,
V_DEVCLASS LIKE TADIR-DEVCLASS,
V_TEXT(60) TYPE C.
**************************************************************************
Selection Screen Declaration
**************************************************************************
PARAMETERS : P_TCODE LIKE TSTC-TCODE OBLIGATORY.
TYPES:BEGIN OF T_MOD,
PARAMETERS : P_TCODE LIKE TSTC-TCODE OBLIGATORY.
TYPES:BEGIN OF T_MOD,
NAME LIKE MODSAPT-NAME,
MODTEXT LIKE MODSAPT-MODTEXT,
TYP LIKE MODSAP-TYP,
MEMBER LIKE MODSAP-MEMBER,
END OF T_MOD.
**************************************************************************
**************************************************************************
Data Declaration **************************************************************************
DATA: I_MOD TYPE T_MOD OCCURS 0 WITH HEADER LINE,
DATA: I_MOD TYPE T_MOD OCCURS 0 WITH HEADER LINE,
I_BADI TYPE STANDARD TABLE OF T_TADIR WITH HEADER LINE ,
I_BDCDATA TYPE STANDARD TABLE OF BDCDATA,
WA_BDCDATA TYPE BDCDATA.
**************************************************************************
**************************************************************************
START-OF-SELECTION **************************************************************************
START-OF-SELECTION.
SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
IF SY-SUBRC EQ 0.
START-OF-SELECTION.
SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
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'.
MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
IF SY-SUBRC NE 0.
SELECT SINGLE * FROM TRDIR WHERE NAME = TSTC-PGMNA.
IF TRDIR-SUBC EQ 'F'.
* Function Module name
SELECT SINGLE * FROM TFDIR WHERE PNAME = TSTC-PGMNA.
* Additional Attributes for Function Modules
* Additional Attributes for Function Modules
SELECT SINGLE * FROM ENLFDIR
WHERE FUNCNAME = TFDIR-FUNCNAME.
* Directory of Repository Objects
* Directory of Repository Objects
SELECT SINGLE * FROM TADIR WHERE PGMID = 'R3TR'
AND OBJECT = 'FUGR'
AND OBJ_NAME EQ ENLFDIR-AREA.
* Get development class of the object
* Get development class of the object
MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
ENDIF.
ENDIF.
* Get the SAP enhancements of the development class of the object
* Get the SAP enhancements of the development class of the object
SELECT * FROM TADIR INTO TABLE JTAB
WHERE PGMID = 'R3TR'
AND OBJECT = 'SMOD'
AND DEVCLASS = V_DEVCLASS.
* Get Transaction Code Texts.
SELECT SINGLE * FROM TSTCT WHERE SPRSL EQ SY-LANGU
AND TCODE EQ P_TCODE.
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ', 20(20) P_TCODE,
45(50) TSTCT-TTEXT.
SKIP.
IF NOT JTAB[] IS INITIAL.
LOOP AT JTAB.
* Getting the components of a exit.
SELECT A~NAME A~MODTEXT B~TYP B~MEMBER
SELECT A~NAME A~MODTEXT B~TYP B~MEMBER
INTO CORRESPONDING FIELDS OF TABLE I_MOD
FROM MODSAPT AS A
INNER JOIN MODSAP AS B ON B~NAME = A~NAME
WHERE A~SPRSL = SY-LANGU
AND A~NAME = JTAB-OBJ_NAME
AND B~TYP = ''.
LOOP AT I_MOD.
AT NEW MODTEXT.
FORMAT COLOR COL_GROUP INTENSIFIED OFF.
WRITE:/(150) SY-ULINE.
WRITE:/1 SY-VLINE,
2 JTAB-OBJ_NAME HOTSPOT ON,
21 SY-VLINE ,
22 I_MOD-MODTEXT,
92 SY-VLINE,
/1 SY-ULINE(150).
ENDAT.
CLEAR:PNAME,INCLUDE.
* Deriving the include name inorder to chech whether the exit is *
*implemented or not
SELECT PNAME INCLUDE INTO
SELECT PNAME INCLUDE INTO
(PNAME ,INCLUDE)
FROM TFDIR
WHERE FUNCNAME = I_MOD-MEMBER.
endselect.
PNAME = PNAME+3(37).
CONCATENATE PNAME 'U' INCLUDE INTO PNAME.
* Reads the function module
READ REPORT PNAME INTO T.
LOOP AT T WHERE NAME CS 'include'.
LOOP AT T WHERE NAME CS 'include'.
CLEAR:PNAME,field1.
SHIFT T-NAME LEFT DELETING LEADING SPACE.
SPLIT T-NAME AT ' ' INTO field1 PNAME.
SHIFT PNAME RIGHT DELETING TRAILING ''.
SHIFT PNAME RIGHT DELETING TRAILING '.'.
SHIFT PNAME LEFT DELETING LEADING SPACE.
ENDLOOP.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
ENDLOOP.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
* read the include file
READ REPORT PNAME INTO T.
IF SY-SUBRC = 0.
IC = ICON_OKAY.
ELSE.
IC = ''.
ENDIF.
* For Exit Types
IF I_MOD-TYP = 'E'.
TYPE = 'Func.'.
ELSEIF I_MOD-TYP = 'S'.
TYPE = 'Screen'.
ELSEIF I_MOD-TYP = 'C'.
TYPE = 'Menu'.
ENDIF.
WRITE: /92 SY-VLINE,
93 IC,
98 SY-VLINE,
99 TYPE,
106 SY-VLINE,
107 I_MOD-MEMBER HOTSPOT ON,
150 SY-VLINE.
CLEAR:PNAME,IC,field1,TYPE.
ENDLOOP.
ENDLOOP.
ENDLOOP.
WRITE:/(150) 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.
**************************************************************************
For Badi's..
**************************************************************************
* Select BADI entries
* Select BADI entries
SELECT PGMID OBJECT OBJ_NAME
FROM TADIR
INTO CORRESPONDING FIELDS OF TABLE I_BADI
WHERE ( PGMID = 'R3TR' )
AND ( OBJECT = 'SXSD' )
AND ( DEVCLASS = V_DEVCLASS ).
* Write BADI detail header
* Write BADI detail header
data:v_count type i.
DESCRIBE TABLE I_BADI LINES V_COUNT.
IF V_COUNT > 0.
WRITE: /(95) SY-ULINE.
WRITE: /(95) SY-ULINE.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE: /1 SY-VLINE,
2 'BADI',
31 SY-VLINE,
32 'Description',
95 sy-vline.
WRITE: /(95) SY-ULINE.
* Write BADI results
LOOP AT I_BADI.
CLEAR V_TEXT.
SELECT SINGLE TEXT
FROM SXS_ATTRT
INTO V_TEXT
WHERE ( SPRSL = SY-LANGU )
AND ( EXIT_NAME = I_BADI-OBJ_NAME ).
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
WRITE: /1 SY-VLINE,
2 I_BADI-OBJ_NAME HOTSPOT ON,
31 SY-VLINE,
32 V_TEXT,
95 SY-VLINE.
ENDLOOP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE: /(95) SY-ULINE.
WRITE: /1 SY-VLINE,
2 'Total BADI''s:',
31 SY-VLINE,
32 V_COUNT,
95 SY-VLINE.
WRITE: /(95) SY-ULINE.
ELSE.
WRITE: /(95) 'No BADI''s exist.'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'Transaction Code Does Not Exist'. ENDIF.
**************************************************************************
AT LINE-SELECTION **************************************************************************
AT LINE-SELECTION.
AT LINE-SELECTION.
GET CURSOR FIELD FIELD1 VALUE VALUE1.
IF FIELD1(4) EQ 'JTAB'.
* Jump to transaction SMOD
SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
ELSEIF FIELD1(5) EQ 'I_MOD'.
* Viewing the function
SUBMIT WB_MNGR_START_FROM_TOOL_ACCESS AND RETURN WITH ACTION = 'DISPLAY'
* WITH OBJDATA = p_object_data WITH OBJ_TYPE = 'FF' WITH OBJ_NAME = VALUE1 WITH ENCL_OBJ = '' WITH POSITION = '' WITH INCLUDE = '' WITH VERSION = '' WITH TOOL = 'CL_FUNCTION_BUILDER' WITH NEWWNDOW = '' WITH OBJLIST = ''.* Direct BADI to transaction SE18
ELSEIF FIELD1(6) EQ 'I_BADI'. SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(29). CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN. ENDIF.************************************************************************** TOP-OF-PAGE **************************************************************************
TOP-OF-PAGE.
WRITE:/(150) SY-ULINE. FORMAT COLOR COL_HEADING INTENSIFIED ON. WRITE:/1 SY-VLINE, 2 'Exit Name', 21 SY-VLINE , 22 'Description', 92 SY-VLINE, 93 'Imp.', 98 SY-VLINE, 99 'Type', 106 SY-VLINE, 107 'Function Name', 150 SY-VLINE, /1 SY-ULINE.
ELSEIF FIELD1(6) EQ 'I_BADI'. SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(29). CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN. ENDIF.************************************************************************** TOP-OF-PAGE **************************************************************************
TOP-OF-PAGE.
WRITE:/(150) SY-ULINE. FORMAT COLOR COL_HEADING INTENSIFIED ON. WRITE:/1 SY-VLINE, 2 'Exit Name', 21 SY-VLINE , 22 'Description', 92 SY-VLINE, 93 'Imp.', 98 SY-VLINE, 99 'Type', 106 SY-VLINE, 107 'Function Name', 150 SY-VLINE, /1 SY-ULINE.