Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Hello,

 I know that there are simular codes running about but in some cases the returned values were incorrect.

Due to this fact I decided to create my own report to find Exits and Badis which affect a Transaction. I know that there are certain transactions where the returned list is still not correct, but the list returned by this report does usually contain a correct list of Exits that can be user and Badis with standard and customer own implementations.
Two examples for incorrect values returned are IW51 which is in the application class IWOC or CLM1 which is in the application class CLAIM which is actually correct, although the notification application is assigned to QQM and varios exits apply to all three application classes.

 I would be keen on recieving feedback, if this report helps ease the search, and if it can be improved.

All you need is to enter the transaction code and press F8
This report finds Exits in the application area of the Transaction
This report finds Badis in the application area of the Transaction

This is not an official SAP report but it should not cause any damage:

Goto SE38 and create an executable test report ZZ_EXIT_FIND and insert the coding below:

*&---------------------------------------------------------------------\*

*& Report ZZ_EXIT_FIND                                                  *

*&                                                                      *

*&---------------------------------------------------------------------\*

*&                                                                      *

*&                                                                      *

*&---------------------------------------------------------------------\*

REPORT ZZ_EXIT_FIND.

*&---------------------------------------------------------------------\*

*& Enter the transaction code that you want to search through in order  *

*& to find which Standard SAP User Exits exists.                        *

*&                                                                      *

*&---------------------------------------------------------------------\*

*&---------------------------------------------------------------------\*

*& Tables                                                               *

*&---------------------------------------------------------------------\*

TABLES : tstc, "SAP Transaction Codes

         tadir, "Directory of Repository Objects

       modsapt, "SAP Enhancements - Short Texts

        modact, "Modifications

         trdir, "System table TRDIR

         tfdir, "Function Module

       enlfdir, "Additional Attributes for Function Modules

        tstct, "Transaction Code Texts

       RSSTCD,

        TRKEY.

*&---------------------------------------------------------------------\*

*& Definition of Types                                                  *

*&---------------------------------------------------------------------\*

TYPES: BEGIN OF t_badi_list,

                obj_name TYPE sobj_name ,

                devclass TYPE devi_class ,

                 dlvunit TYPE dlvunit,

                imp_name TYPE exit_imp ,

                packname TYPE devclass ,

                dlvunit2 TYPE dlvunit,

                    text TYPE sxc_attrt-text,

      END OF t_badi_list.

TYPES: BEGIN OF t_badi_list2,

                obj_name TYPE sobj_name ,

                devclass TYPE devi_class ,

                 dlvunit TYPE dlvunit,

       END OF t_badi_list2.

*&---------------------------------------------------------------------\*

*& Data Declaration                                                     *

*&---------------------------------------------------------------------\*

DATA: lt_badi_list TYPE TABLE OF t_badi_list,

     lt_badi_list2 TYPE TABLE OF t_badi_list2,

      ls_badi_list TYPE t_badi_list OCCURS 0 WITH HEADER LINE,

     ls_badi_list2 TYPE t_badi_list2.

RANGES: r_badi FOR tadir-obj_name ,

       rt_badi FOR tadir-obj_name .

*&---------------------------------------------------------------------\*

*& Variables                                                            *

*&---------------------------------------------------------------------\*

DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE,

    P_TRKEY LIKE TRKEY.

DATA : field1(30),

       BADINAME(20),

       COUNT TYPE P.

DATA : v_devclass LIKE tadir-devclass,

      p_devclass LIKE tadir-devclass,

      p_old_langu LIKE sy-langu,

      p_mod_langu LIKE sy-langu.

*&---------------------------------------------------------------------\*

*& Selection Screen Parameters                                          *

*&---------------------------------------------------------------------\*

SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.

SELECTION-SCREEN SKIP.

PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN END OF BLOCK a01.

*&---------------------------------------------------------------------\*

*& Start of report                                                      *

*&---------------------------------------------------------------------\*

START-OF-SELECTION.

* Validate Transaction Code

SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.

*Find Repository Objects for transaction code

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.

* This section is used if a FGR is involved\!

    CALL FUNCTION 'RS_ACCESS_PERMISSION'

         EXPORTING

               global_lock = 'X'

                    object = p_tcode

              object_class = 'TRAN'

                      mode = 'SHOW'

         language_upd_exit = 'RS_TRANSACTION_LANGUAGE_EXIT'

   suppress_language_check = space

        IMPORTING

       new_master_language = p_old_langu

     modification_language = p_mod_langu

             transport_key = p_trkey

                  devclass = p_devclass

       EXCEPTIONS

          canceled_in_corr = 1

                    OTHERS = 2.

    IF SY-SUBRC = 0. " Success

      MOVE: p_devclass TO v_devclass.

    ELSE. " For the case that nothing is found\!

      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 = p_devclass.

        MOVE: tadir-devclass TO v_devclass.

      ENDIF.

    ENDIF.

  ENDIF.

*Find SAP Modifactions

    SELECT * FROM tadir INTO TABLE jtab

                        WHERE pgmid = 'R3TR'

                         AND object = 'SMOD'

                       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.

    FORMAT COLOR COL_POSITIVE INTENSIFIED ON.

    SKIP.

    WRITE:/1 'The application area is:', v_devclass.

    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.

      SKIP.

      WRITE:/(83) sy-uline.

      FORMAT COLOR COL_HEADING INTENSIFIED ON.

      WRITE:/1 sy-vline, 2 'Badi Name', 22 sy-vline, 23 'Description', 83 sy-vline.

      WRITE:/(83) sy-uline.

* select the BAdI Definitions from the tables sxc_exit and sxc_attr

      SELECT t~obj_name t~devclass tc~dlvunit sx~imp_name sat~text

                   INTO CORRESPONDING FIELDS OF TABLE lt_badi_list

                   FROM ( ( ( ( tadir AS t

                   INNER JOIN

                     tdevc AS tc ON t~devclass = tc~devclass )

                   INNER JOIN

                     sxc_exit AS sx ON sx~exit_name = t~obj_name )

                   INNER JOIN

                     sxc_attr AS sa ON sx~imp_name = sa~imp_name )

                   INNER JOIN

                     sxc_attrt AS sat ON sx~imp_name = sat~imp_name )

                   WHERE t~pgmid = 'R3TR'

                   AND t~object = 'SXSD' "means BAdI

                   AND t~devclass = v_devclass "narrow down seach with Dev.Class

                   AND sat~sprsl = sy-langu.

      SORT lt_badi_list.

      DELETE ADJACENT DUPLICATES FROM lt_badi_list.

* create Ranges

      LOOP AT lt_badi_list INTO ls_badi_list .

        r_badi-sign = 'I' .

        r_badi-option ='EQ' .

        r_badi-low = ls_badi_list-imp_name .

        r_badi-high = ls_badi_list-imp_name .

        APPEND r_badi TO rt_badi .

      ENDLOOP.

* select the implementations

      SELECT t~obj_name t~devclass tc~dlvunit

            INTO CORRESPONDING FIELDS OF TABLE lt_badi_list2

            FROM tadir AS t

            INNER JOIN

              tdevc AS tc ON t~devclass = tc~devclass

            FOR ALL ENTRIES IN rt_badi

            WHERE t~obj_name = rt_badi-low

            AND t~pgmid = 'R3TR'

            AND t~object = 'SXCI'.

      FORMAT COLOR COL_NORMAL INTENSIFIED OFF.

      WRITE:/(83) sy-uline.

      COUNT = '0'.

      LOOP AT lt_badi_list INTO ls_badi_list .

        WRITE:/1 sy-vline, 2 ls_badi_list-obj_name HOTSPOT ON, 22 sy-vline,

              23 ls_badi_list-text, 83 sy-vline.

        COUNT = COUNT + 1.

      ENDLOOP.

      WRITE:/(83) sy-uline.

      DESCRIBE TABLE ls_badi_list.

      SKIP.

      FORMAT COLOR COL_TOTAL INTENSIFIED ON.

      WRITE:/ 'No of BADIs:' , COUNT.

    ELSE.

      FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.

      WRITE:/(95) 'No User Exit exists'.

    ENDIF.

  ELSE.

    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.

    WRITE:/(95) 'Transaction Code Does Not Exist'.

  ENDIF.

*&---------------------------------------------------------------------\*

*& Call SMOD or SE18 to lead the user to the selected exit or badi      *

*&---------------------------------------------------------------------\*

AT LINE-SELECTION.

GET CURSOR FIELD field1.

IF field1(4) EQ 'JTAB'.

  SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).

  CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.

ELSEIF field1(12) EQ 'LS_BADI_LIST'.

  CALL FUNCTION 'SXO_BADI_SHOW'

       EXPORTING

         EXIT_NAME = sy-lisel+1(20)

       EXCEPTIONS

         ACTION_CANCELED

         ACCESS_FAILURE

         BADI_NOT_EXIXTING.

ELSE.

ENDIF.





1 Comment

  1. Hi

    Thanks for this program

    Run time was very bad with it....

    I executed with T code CO01... It did not return any BADI, where as the program by Kalyan Annapareddy returned 4 BADIs atleast