Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

User Exits & BadI

Former Member
0 Likes
870

Hi,

Kindly suggest how to find various user exits, badi's & developments implemented in a system. We are planning for upgrade from 4.6c to ecc 6.0. We need to study all the developments.

regards,

Mohit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
822

Hi Mohit ,

All the exits that have been implemenetd are stored in the table MODSAP.

Hope this helps.

Regards

Arun

  • Reward Points if reply helps

Hi,

Kindly suggest how to find various user exits, badi's & developments implemented in a system. We are planning for upgrade from 4.6c to ecc 6.0. We need to study all the developments.

regards,

Mohit

4 REPLIES 4
Read only

Former Member
0 Likes
822

Hi,

Find the User exits from SMOD Tcode by entering the related Dev class

Badi's from Se18 Tcode

u can find BADI's in different ways...

1>First go to any transaction->iN THE menu bar SYSTEM->STATUS->Get the program name ->double click->u will go to the program attached to the tcode.Now search term will be CALL CL_EXITHANDLER.Now u will get list of BADI'S available..

2>Goto SE24->Give class name as CL_EXITHANDLER->Display->double click on get_instance mathod->Now u will go inside the method->Now put break point on the cl_exithandler.Now go to any transaction code and pass dat..U will see that it will be stopped on the break point which u set on the cl_exithandler...In the exit name u can find list of badi's attached to the tcode..

There are multiple ways of searching for BADI.

• Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE

• Finding BADI Using SQL Trace (TCODE-ST05).

• Finding BADI Using Repository Information System (TCODE- SE84).

1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the program name. Once inside the program search for ‘CL_EXITHANDLER=>GET_INSTANCE’.

Make sure the radio button “In main program” is checked. A list of all the programs with call to the BADI’s will be listed.

The export parameter ‘EXIT_NAME’ for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter ‘INSTANCE’ will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.

2. Start transaction ST05 (Performance Analysis).

Set flag field "Buffer trace"

Remark: We need to trace also the buffer calls, because BADI database tables are buffered. (Especially view V_EXT_IMP and V_EXT_ACT)

Push the button "Activate Trace". Start transaction VA02 in a new GUI session. Go back to the Performance trace session.

Push the button "Deactivate Trace".

Push the button "Display Trace".

The popup screen "Set Restrictions for Displaying Trace" appears.

Now, filter the trace on Objects:

• V_EXT_IMP

• V_EXT_ACT

Push button "Multiple selections" button behind field Objects

Fill: V_EXT_IMP and V_EXT_ACT

All the interface class names of view V_EXT_IMP start with IF_EX_. This is the standard SAP prefix for BADI class interfaces. The BADI name is after the IF_EX_.

So the BADI name of IF_EX_CUSTOMER_ADD_DATA is CUSTOMER_ADD_DATA

3. Go to “Maintain Transaction” (TCODE- SE93).

Enter the Transaction VD02 for which you want to find BADI.

Click on the Display push buttons.

Get the Package Name. (Package VS in this case)

Go to TCode: SE84->Enhancements->Business Add-inns->Definition

Enter the Package Name and Execute.

Here you get a list of all the Enhancement BADI’s for the given package MB.

The simplese way for finding BADI is

1. chooes Tcode Program & package for that Tcode.

2. Go to Tcode se18

3. Press F4

4. search by package or by program.

http://www.erpgenie.com/sap/abap/code/abap26.htm

which gives the list of exits for a tcode

http://help.sap.com/saphelp_nw04/helpdata/en/bf/ec079f5db911d295ae0000e82de14a/frameset.htm

For information on Exits, check these links

http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

http://www.sapgenie.com/abap/code/abap26.htm

http://www.sap-img.com/abap/what-is-user-exits.htm

http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction

http://www.easymarketplace.de/userexit.php

http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

http://www.sappoint.com/abap/userexit.pdfUser-Exit

http://www.planetsap.com/userexit_main_page.htm

reward if useful

regards,

ANJI

Read only

Former Member
0 Likes
822

Hi Mohit,

Use this code to find both Exits and BAdi's.

Use the following prog. it will fetch the Exits as well as BADI's for that T Code.

&----


*& Report Z_USEREXIT_DISPLAY

&----


REPORT Z_USEREXIT_DISPLAY

NO STANDARD PAGE HEADING

LINE-SIZE 200 MESSAGE-ID ZZ.

&----


  • T A B L E D E C L A R A T I O N S *

&----


TABLES: TFTIT,

E071,

E070.

&----


  • S T R U C T U R E D E C L A R A T I O N S *

&----


TYPES: BEGIN OF X_TSTC,

TCODE TYPE TCODE,

PGMNA TYPE PROGRAM_ID,

END OF X_TSTC.

TYPES: BEGIN OF X_TADIR,

OBJ_NAME TYPE SOBJ_NAME,

DEVCLASS TYPE DEVCLASS,

END OF X_TADIR.

TYPES: BEGIN OF X_SLOG,

OBJ_NAME TYPE SOBJ_NAME,

END OF X_SLOG.

TYPES: BEGIN OF X_FINAL,

NAME TYPE SMODNAME,

MEMBER TYPE MODMEMBER,

INCLUDE(15), "Include name

END OF X_FINAL.

&----


  • I N T E R N A L T A B L E D E C L A R A T I O N S *

&----


DATA: IT_TSTC TYPE STANDARD TABLE OF X_TSTC WITH HEADER LINE.

DATA: IT_TADIR TYPE STANDARD TABLE OF X_TADIR WITH HEADER LINE.

DATA: IT_JTAB TYPE STANDARD TABLE OF X_SLOG WITH HEADER LINE.

DATA: IT_FINAL TYPE STANDARD TABLE OF X_FINAL WITH HEADER LINE.

&----


  • V A R I A B L E S D E C L A R A T I O N S *

&----


  • U S E R I N P U T S S C R E E N *

&----


&----


  • S E L E C T I O N S C R E E N *

&----


SELECTION-SCREEN: BEGIN OF BLOCK BLK01 WITH FRAME TITLE TEXT-T01.

PARAMETERS: P_TCODE LIKE TSTC-TCODE OBLIGATORY.

SELECTION-SCREEN END OF BLOCK BLK01.

&----


  • S t a r t o f S e l e c t i o n *

&----


START-OF-SELECTION.

PERFORM GET_TCODES. "Get Tcodes

PERFORM GET_OBJECTS. "Get Objects

&----


  • E n d o f S e l e c t i o n *

&----


END-OF-SELECTION.

PERFORM DISPLAY_RESULTS. "Display Results

&----


*& Form get_tcodes

&----


  • Get Tcodes

----


FORM GET_TCODES.

SELECT TCODE

PGMNA

INTO TABLE IT_TSTC

FROM TSTC

WHERE TCODE = P_TCODE.

IF SY-SUBRC = 0.

SORT IT_TSTC BY TCODE.

ENDIF.

ENDFORM. " get_tcodes

&----


*& Form get_objects

&----


  • Get Objects

----


FORM GET_OBJECTS.

DATA: L_FNAME LIKE RS38L-NAME,

L_GROUP LIKE RS38L-AREA,

L_INCLUDE LIKE RS38L-INCLUDE,

L_NAMESPACE LIKE RS38L-NAMESPACE,

L_STR_AREA LIKE RS38L-STR_AREA.

DATA: V_INCLUDE LIKE RODIOBJ-IOBJNM.

DATA: E_T_INCLUDE TYPE STANDARD TABLE OF ABAPSOURCE WITH HEADER

LINE.

DATA: L_LINE TYPE STRING,

L_TABIX LIKE SY-TABIX.

IF NOT IT_TSTC[] IS INITIAL.

SELECT OBJ_NAME

DEVCLASS

INTO TABLE IT_TADIR

FROM TADIR FOR ALL ENTRIES IN IT_TSTC

WHERE PGMID = 'R3TR' AND

OBJECT = 'PROG' AND

OBJ_NAME = IT_TSTC-PGMNA.

IF SY-SUBRC = 0.

SORT IT_TADIR BY OBJ_NAME DEVCLASS.

SELECT OBJ_NAME

INTO TABLE IT_JTAB

FROM TADIR FOR ALL ENTRIES IN IT_TADIR

WHERE PGMID = 'R3TR' AND

OBJECT = 'SMOD' AND

DEVCLASS = IT_TADIR-DEVCLASS.

IF SY-SUBRC = 0.

SORT IT_JTAB BY OBJ_NAME.

ENDIF.

ENDIF.

ENDIF.

*- Get UserExit names

LOOP AT IT_JTAB.

SELECT NAME

MEMBER

INTO (IT_FINAL-NAME, IT_FINAL-MEMBER)

FROM MODSAP

WHERE NAME = IT_JTAB-OBJ_NAME AND

TYP = 'E'.

APPEND IT_FINAL.

CLEAR IT_FINAL.

ENDSELECT.

ENDLOOP.

*- Process it_final contents.

LOOP AT IT_FINAL.

L_TABIX = SY-TABIX.

CLEAR: L_FNAME,

L_GROUP,

L_INCLUDE,

L_NAMESPACE,

L_STR_AREA.

L_FNAME = IT_FINAL-MEMBER.

CALL FUNCTION 'FUNCTION_EXISTS'

EXPORTING

FUNCNAME = L_FNAME

IMPORTING

GROUP = L_GROUP

INCLUDE = L_INCLUDE

NAMESPACE = L_NAMESPACE

STR_AREA = L_STR_AREA

EXCEPTIONS

FUNCTION_NOT_EXIST = 1

OTHERS = 2.

IF SY-SUBRC = 0.

IF NOT L_INCLUDE IS INITIAL.

*- Get Source code of include.

CLEAR: V_INCLUDE, E_T_INCLUDE, E_T_INCLUDE[].

V_INCLUDE = L_INCLUDE.

CALL FUNCTION 'MU_INCLUDE_GET'

EXPORTING

I_INCLUDE = V_INCLUDE

TABLES

E_T_INCLUDE = E_T_INCLUDE.

IF SY-SUBRC = 0.

LOOP AT E_T_INCLUDE.

IF E_T_INCLUDE-LINE CS 'INCLUDE'.

CLEAR L_LINE.

L_LINE = E_T_INCLUDE-LINE.

CONDENSE L_LINE NO-GAPS.

TRANSLATE L_LINE USING '. '.

L_LINE = L_LINE+7(9).

IT_FINAL-INCLUDE = L_LINE.

MODIFY IT_FINAL INDEX L_TABIX TRANSPORTING INCLUDE.

ENDIF.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

ENDFORM. " get_objects

&----


*& Form display_results

&----


  • Display Results

----


FORM DISPLAY_RESULTS.

FORMAT COLOR COL_HEADING.

WRITE:/1(150) SY-ULINE.

WRITE:/ SY-VLINE,

2(23) 'Extension Name',

24 SY-VLINE,

25(39) 'Exit Name',

64 SY-VLINE,

65(74) 'Description',

140 SY-VLINE,

141(9) 'Include',

150 SY-VLINE.

WRITE:/1(150) SY-ULINE.

FORMAT RESET.

SORT IT_FINAL BY NAME MEMBER.

LOOP AT IT_FINAL.

CLEAR TFTIT.

SELECT SINGLE STEXT

INTO TFTIT-STEXT

FROM TFTIT

WHERE SPRAS = 'EN' AND

FUNCNAME = IT_FINAL-MEMBER.

WRITE:/ SY-VLINE,

IT_FINAL-NAME COLOR COL_KEY, 24 SY-VLINE,

25 IT_FINAL-MEMBER, 64 SY-VLINE,

65 TFTIT-STEXT, 140 SY-VLINE,

141 IT_FINAL-INCLUDE, 150 SY-VLINE.

WRITE:/1(150) SY-ULINE.

ENDLOOP.

ENDFORM. " display_results

Hope this resolves your query.

Reward all the helpful answers.

Regards

Read only

Former Member
0 Likes
823

Hi Mohit ,

All the exits that have been implemenetd are stored in the table MODSAP.

Hope this helps.

Regards

Arun

  • Reward Points if reply helps

Read only

Former Member
0 Likes
822

Hi,

try this porgram which i am using to fine user-exit.

&----


*& Report ZEXIT

*&

&----


*&

*&

&----


REPORT ZEXIT NO STANDARD PAGE HEADING.

*by kumar gaurav on 22.11.2005

  • Finding the user-exits of a SAP transaction code

*

  • Enter the transaction code in which you are looking for the user-exit

  • and it will list you the list of user-exits in the transaction code.

  • Also a drill down is possible which will help you to branch to SMOD.

*declare tables..

*

TABLES : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.

TABLES : 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 OBLIGATORY.

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'.

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

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.

ELSE.

FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.

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

ENDIF.

AT LINE-SELECTION.

GET CURSOR FIELD field1.

CHECK field1(4) EQ 'JTAB'.

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

CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.

***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'JHJHH'

*&SPWIZARD: DEFINITION OF DDIC-TABLE

TABLES: MARA.

*&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'JHJHH'

TYPES: BEGIN OF T_JHJHH,

MATNR LIKE MARA-MATNR,

ERSDA LIKE MARA-ERSDA,

MTART LIKE MARA-MTART,

MBRSH LIKE MARA-MBRSH,

MATKL LIKE MARA-MATKL,

BISMT LIKE MARA-BISMT,

MEINS LIKE MARA-MEINS,

BSTME LIKE MARA-BSTME,

ZEINR LIKE MARA-ZEINR,

END OF T_JHJHH.

*&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'JHJHH'

DATA: G_JHJHH_ITAB TYPE T_JHJHH OCCURS 0,

G_JHJHH_WA TYPE T_JHJHH. "work area

DATA: G_JHJHH_COPIED. "copy flag

*&SPWIZARD: DECLARATION OF TABLECONTROL 'JHJHH' ITSELF

CONTROLS: JHJHH TYPE TABLEVIEW USING SCREEN 1001.

*&SPWIZARD: OUTPUT MODULE FOR TC 'JHJHH'. DO NOT CHANGE THIS LINE!

*&SPWIZARD: COPY DDIC-TABLE TO ITAB

MODULE JHJHH_INIT OUTPUT.

IF G_JHJHH_COPIED IS INITIAL.

*&SPWIZARD: COPY DDIC-TABLE 'MARA'

*&SPWIZARD: INTO INTERNAL TABLE 'g_JHJHH_itab'

SELECT * FROM MARA

INTO CORRESPONDING FIELDS

OF TABLE G_JHJHH_ITAB.

G_JHJHH_COPIED = 'X'.

REFRESH CONTROL 'JHJHH' FROM SCREEN '1001'.

ENDIF.

ENDMODULE.

*&SPWIZARD: OUTPUT MODULE FOR TC 'JHJHH'. DO NOT CHANGE THIS LINE!

*&SPWIZARD: MOVE ITAB TO DYNPRO

MODULE JHJHH_MOVE OUTPUT.

MOVE-CORRESPONDING G_JHJHH_WA TO MARA.

ENDMODULE.

*&SPWIZARD: INPUT MODULE FOR TC 'JHJHH'. DO NOT CHANGE THIS LINE!

*&SPWIZARD: MODIFY TABLE

MODULE JHJHH_MODIFY INPUT.

MOVE-CORRESPONDING MARA TO G_JHJHH_WA.

MODIFY G_JHJHH_ITAB

FROM G_JHJHH_WA

INDEX JHJHH-CURRENT_LINE.

ENDMODULE.