1/8/2016 7:06:19 AM

Actually there are many ways to do that:

Option No: 1:

To finding the BADI: Put a break point in CL_EXITHANDLER class  GET_INSTANCE Method and execute the Transaction code whenever it calls then the BADI debugger stops at that point.

Advantage: It is for sure that you will get the respective BADI.

Disadvantage: It is not possible to get USER-EXIT or kernel BADI (As Kernel BADI is using GET BADI syntax to get the instance of its class,So in that case you need to put a break point also at GET BADI statements )

Option No: 2

This is the most commonly used option: Get the package in which the transaction code belongs and open that package in SE80:(you can check this using transaction SE93)

Option No 3:

 Try out the Below Report Program: Give a Transaction Code as an input and it will return you ALL the User EXIT and BADI which can be used.

REPORT  ZFIND_ENHANCEMENT.
TABLES TSTC,
TADIR,
MODSAPT,
MODACT,
TRDIR,
TFDIR,
ENLFDIR,
SXS_ATTRT ,
TSTCT.

DATA JTAB LIKE TADIR OCCURS WITH HEADER LINE.
TYPES BEGIN OF STAB ,
   INCLUDE TYPE TADIR ,
     TXT(60TYPE C,
  END OF STAB.

DATA IT_TAB TYPE   STANDARD TABLE OF STAB.
DATA WA_TAB LIKE LINE OF IT_TAB.

DATA FIELD1(30).
DATA V_DEVCLASS LIKE TADIR-DEVCLASS.
DATA IT_BADI_SPOT TYPE STANDARD TABLE OF BADI_SPOT.
DATA WA_BADI_SPOT LIKE LINE OF IT_BADI_SPOT.
PARAMETERS P_TCODE LIKE TSTC-TCODE,
P_PGMNA LIKE TSTC-PGMNA .

DATAOTR_CONTEXT TYPE SOTR_CNTXT,
       OTR_TEXT TYPE SOTR_TEXT,
       OTR_KEY TYPE SOTR_KEY.

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 INTO WA_TADIR
    WHERE PGMID 'R3TR'
    AND OBJECT 'PROG'
    AND OBJ_NAME TSTC-PGMNA.

    MOVE :  WA_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.

*Get Kernal BADIS

    SELECT FROM BADI_SPOT AS A
                    INNER JOIN ENHSPOTHEADER AS B
                    ON A~ENHSPOTNAME EQ B~ENHSPOT
                    INNER JOIN TADIR AS C
                    ON A~ENHSPOTNAME EQ C~OBJ_NAME
                    INTO  CORRESPONDING FIELDS OF TABLE IT_BADI_SPOT
                    WHERE   C~PGMID      EQ 'R3TR'
                         AND   C~OBJECT     EQ 'ENHS'
                         AND   C~DEVCLASS   EQ V_DEVCLASS.
    IF SY-SUBRC EQ 0.
      LOOP AT IT_BADI_SPOT INTO WA_BADI_SPOT.
        MOVE WA_BADI_SPOT-BADI_NAME TO WA_TADIR-OBJ_NAME.
        MOVE 'ENHS' TO WA_TADIR-OBJECT.
        APPEND WA_TADIR TO JTAB.
      ENDLOOP.

    ENDIF.

    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19'Transaction code Ã¢â‚¬â€œ ',
    20(20P_TCODE,
    45(50TSTCT-TTEXT.
    SKIP.
    IF NOT JTAB[] IS INITIAL.
      WRITE:/(105SY-ULINE.
      FORMAT COLOR COL_HEADING INTENSIFIED ON.

* Sorting the internal Table
      SORT JTAB BY OBJECT.
      DATA WF_TXT(60TYPE C,
      WF_SMOD TYPE ,
      WF_BADI TYPE ,
      WF_OBJECT2(30TYPE C.
      CLEAR WF_SMODWF_BADI WF_OBJECT2.
* Get the total SMOD.

      IF JTAB[] IS NOT INITIAL.
        FORMAT COLOR INTENSIFIED ON.
        WRITE 'Click on the EXIT or BADI TO view/edit'.
      ENDIF.

      LOOP AT JTAB INTO WA_TADIR.
        AT FIRST.
          FORMAT COLOR COL_HEADING INTENSIFIED ON.

          WRITE:/1 SY-VLINE,
          'Enhancement/ Business add-in',
          41 SY-VLINE ,
          42 'Description',
          105 SY-VLINE.
          WRITE:/(105SY-ULINE.
        ENDAT.
        CLEAR WF_TXT.
        AT NEW OBJECT.
          IF WA_TADIR-OBJECT 'SMOD'.
            WF_OBJECT2 'Customer Exit' .
          ELSEIF WA_TADIR-OBJECT 'SXSD'.
            WF_OBJECT2 ' BADI'.
          ELSEIF WA_TADIR-OBJECT 'ENHS'.
            WF_OBJECT2 ' KERNAL Business ADD-IN'.
          ENDIF.
          FORMAT COLOR COL_GROUP INTENSIFIED ON.

          WRITE:/1 SY-VLINE,

          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 + .
            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.
          WHEN 'ENHS'.
            WF_BADI WF_BADI + 1.
            FORMAT COLOR COL_NORMAL INTENSIFIED ON.
            READ TABLE IT_BADI_SPOT INTO WA_BADI_SPOT WITH KEY
             BADI_NAME WA_TADIR-OBJ_NAME.
            IF SY-SUBRC EQ 0.
              OTR_KEY-CONCEPT WA_BADI_SPOT-SHORTTEXT_OBJ.
              CALL FUNCTION 'SOTR_READ_TEXT_WITH_KEY'
                EXPORTING
                 LANGU                  SY-LANGU
                 CONTEXT                OTR_CONTEXT
                  SOTR_KEY               OTR_KEY
               IMPORTING
                 ENTRY                  OTR_TEXT
               EXCEPTIONS
                 NO_ENTRY_FOUND         1
                 LANGUAGE_MISSING       2
                 OTHERS                 3.
              MOVE OTR_TEXT-TEXT TO WF_TXT.
            ENDIF.
        ENDCASE.

        WRITE:/1 SY-VLINE,
        WA_TADIR-OBJ_NAME HOTSPOT ON,
        41 SY-VLINE ,
        42 WF_TXT,
        105 SY-VLINE.
        AT END OF OBJECT.
          WRITE /(105SY-ULINE.
        ENDAT.

      ENDLOOP.

      WRITE:/(105SY-ULINE.

      SKIP.
      FORMAT COLOR COL_TOTAL INTENSIFIED ON.
      WRITE:'Total number of EXITS:' WF_SMOD.
      WRITE:'Total number 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(8EQ 'wa_tadir'.
  READ TABLE JTAB WITH KEY OBJ_NAME SY-LISEL+1(30).
  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.
    WHEN 'ENHS'.
      SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(30).
      CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
  ENDCASE. 

Execute the program

In this example we will see what are the enhancement available for Transaction code – VA41                     Create Contract


Press F8



Now we got what are all the enhancement available for Transaction code  VA41                     Create Contract.

If you like this blog, please share (Facebook/LinkedIn/Google+) to click below links so it will reach to others.


COMMENTS