<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: tcode BADI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-badi/m-p/3241514#M773678</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;find the package used for that transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;take transaction &lt;STRONG&gt;SE18&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;press F4 and in information system give the package name. You will get the ralated BADIs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Renjith Michael.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Jan 2008 07:10:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-14T07:10:31Z</dc:date>
    <item>
      <title>tcode BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-badi/m-p/3241511#M773675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to find BADI for a standard tcode?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jan 2008 13:16:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-badi/m-p/3241511#M773675</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-13T13:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: tcode BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-badi/m-p/3241512#M773676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code lists Userexits and BAdi's for a given Tcode...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT Z_FIND_BADI.&lt;/P&gt;&lt;P&gt;TABLES : TSTC,&lt;/P&gt;&lt;P&gt;TADIR,&lt;/P&gt;&lt;P&gt;MODSAPT,&lt;/P&gt;&lt;P&gt;MODACT,&lt;/P&gt;&lt;P&gt;TRDIR,&lt;/P&gt;&lt;P&gt;TFDIR,&lt;/P&gt;&lt;P&gt;ENLFDIR,&lt;/P&gt;&lt;P&gt;SXS_ATTRT ,&lt;/P&gt;&lt;P&gt;TSTCT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA : FIELD1(30).&lt;/P&gt;&lt;P&gt;DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS : P_TCODE LIKE TSTC-TCODE,&lt;/P&gt;&lt;P&gt;P_PGMNA LIKE TSTC-PGMNA .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA wa_tadir type tadir.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT P_TCODE IS INITIAL.&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSEIF NOT P_PGMNA IS INITIAL.&lt;/P&gt;&lt;P&gt;TSTC-PGMNA = P_PGMNA.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM TADIR&lt;/P&gt;&lt;P&gt;WHERE PGMID = 'R3TR'&lt;/P&gt;&lt;P&gt;AND OBJECT = 'PROG'&lt;/P&gt;&lt;P&gt;AND OBJ_NAME = TSTC-PGMNA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE : TADIR-DEVCLASS TO V_DEVCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM TRDIR&lt;/P&gt;&lt;P&gt;WHERE NAME = TSTC-PGMNA.&lt;/P&gt;&lt;P&gt;IF TRDIR-SUBC EQ 'F'.&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM TFDIR&lt;/P&gt;&lt;P&gt;WHERE PNAME = TSTC-PGMNA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM ENLFDIR&lt;/P&gt;&lt;P&gt;WHERE FUNCNAME = TFDIR-FUNCNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM TADIR&lt;/P&gt;&lt;P&gt;WHERE PGMID = 'R3TR'&lt;/P&gt;&lt;P&gt;AND OBJECT = 'FUGR'&lt;/P&gt;&lt;P&gt;AND OBJ_NAME EQ ENLFDIR-AREA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE : TADIR-DEVCLASS TO V_DEVCLASS.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM TADIR INTO TABLE JTAB&lt;/P&gt;&lt;P&gt;WHERE PGMID = 'R3TR'&lt;/P&gt;&lt;P&gt;AND OBJECT in ('SMOD', 'SXSD')&lt;/P&gt;&lt;P&gt;AND DEVCLASS = V_DEVCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM TSTCT&lt;/P&gt;&lt;P&gt;WHERE SPRSL EQ SY-LANGU&lt;/P&gt;&lt;P&gt;AND TCODE EQ P_TCODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.&lt;/P&gt;&lt;P&gt;WRITE:/(19) 'Transaction Code - ',&lt;/P&gt;&lt;P&gt;20(20) P_TCODE,&lt;/P&gt;&lt;P&gt;45(50) TSTCT-TTEXT.&lt;/P&gt;&lt;P&gt;SKIP.&lt;/P&gt;&lt;P&gt;IF NOT JTAB[] IS INITIAL.&lt;/P&gt;&lt;P&gt;WRITE:/(105) SY-ULINE.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_HEADING INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorting the internal Table &lt;/P&gt;&lt;P&gt;sort jtab by OBJECT.&lt;/P&gt;&lt;P&gt;data : wf_txt(60) type c,&lt;/P&gt;&lt;P&gt;wf_smod type i ,&lt;/P&gt;&lt;P&gt;wf_badi type i ,&lt;/P&gt;&lt;P&gt;wf_object2(30) type C.&lt;/P&gt;&lt;P&gt;clear : wf_smod, wf_badi , wf_object2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get the total SMOD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT JTAB into wa_tadir.&lt;/P&gt;&lt;P&gt;at first.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_HEADING INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/1 SY-VLINE,&lt;/P&gt;&lt;P&gt;2 'Enhancement/ Business Add-in',&lt;/P&gt;&lt;P&gt;41 SY-VLINE ,&lt;/P&gt;&lt;P&gt;42 'Description',&lt;/P&gt;&lt;P&gt;105 SY-VLINE.&lt;/P&gt;&lt;P&gt;WRITE:/(105) SY-ULINE.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;clear wf_txt.&lt;/P&gt;&lt;P&gt;at new object.&lt;/P&gt;&lt;P&gt;if wa_tadir-object = 'SMOD'.&lt;/P&gt;&lt;P&gt;wf_object2 = 'Enhancement' .&lt;/P&gt;&lt;P&gt;elseif wa_tadir-object = 'SXSD'.&lt;/P&gt;&lt;P&gt;wf_object2 = ' Business Add-in'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_GROUP INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/1 SY-VLINE,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 wf_object2,&lt;/P&gt;&lt;P&gt;105 SY-VLINE.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case wa_tadir-object.&lt;/P&gt;&lt;P&gt;when 'SMOD'.&lt;/P&gt;&lt;P&gt;wf_smod = wf_smod + 1.&lt;/P&gt;&lt;P&gt;SELECT SINGLE MODTEXT into wf_txt&lt;/P&gt;&lt;P&gt;FROM MODSAPT&lt;/P&gt;&lt;P&gt;WHERE SPRSL = SY-LANGU&lt;/P&gt;&lt;P&gt;AND NAME = wa_tadir-OBJ_NAME.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_NORMAL INTENSIFIED OFF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when 'SXSD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For BADis &lt;/P&gt;&lt;P&gt;wf_badi = wf_badi + 1 .&lt;/P&gt;&lt;P&gt;select single TEXT into wf_txt&lt;/P&gt;&lt;P&gt;from SXS_ATTRT&lt;/P&gt;&lt;P&gt;where sprsl = sy-langu&lt;/P&gt;&lt;P&gt;and EXIT_NAME = wa_tadir-OBJ_NAME.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_NORMAL INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/1 SY-VLINE,&lt;/P&gt;&lt;P&gt;2 wa_tadir-OBJ_NAME hotspot on,&lt;/P&gt;&lt;P&gt;41 SY-VLINE ,&lt;/P&gt;&lt;P&gt;42 wf_txt,&lt;/P&gt;&lt;P&gt;105 SY-VLINE.&lt;/P&gt;&lt;P&gt;AT END OF object.&lt;/P&gt;&lt;P&gt;write : /(105) sy-ULINE.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/(105) SY-ULINE.&lt;/P&gt;&lt;P&gt;SKIP.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_TOTAL INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;WRITE:/ 'No.of Exits:' , wf_smod.&lt;/P&gt;&lt;P&gt;WRITE:/ 'No.of BADis:' , wf_badi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;WRITE:/(105) 'No userexits or BADis exist'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;WRITE:/(105) 'Transaction does not exist'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT LINE-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : wf_object type tadir-object.&lt;/P&gt;&lt;P&gt;clear wf_object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET CURSOR FIELD FIELD1.&lt;/P&gt;&lt;P&gt;CHECK FIELD1(8) EQ 'WA_TADIR'.&lt;/P&gt;&lt;P&gt;read table jtab with key obj_name = sy-lisel+1(20).&lt;/P&gt;&lt;P&gt;move jtab-object to wf_object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case wf_object.&lt;/P&gt;&lt;P&gt;when 'SMOD'.&lt;/P&gt;&lt;P&gt;SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;when 'SXSD'.&lt;/P&gt;&lt;P&gt;SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jan 2008 13:18:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-badi/m-p/3241512#M773676</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-13T13:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: tcode BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-badi/m-p/3241513#M773677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi rao,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These steps should enable you to find any BADI related to any transaction &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Procedure 1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Go to the transaction SE37 to find your function module.&lt;/P&gt;&lt;P&gt;2) Locate the function SXV_GET_CLIF_BY_NAME. &lt;/P&gt;&lt;P&gt;3) Put a breakpoint there. &lt;/P&gt;&lt;P&gt;4) Now open a new session. &lt;/P&gt;&lt;P&gt;5) Go to your transaction. 6) At that time, it will stop this function. &lt;/P&gt;&lt;P&gt;7) Double click on the function field EXIT_NAME. &lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; That will give you name of the BADI that is provided in your transaction. &lt;/P&gt;&lt;P&gt;Business Add-Ins&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Procedure 2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Goto se24 (Display class cl_exithandler)&lt;/P&gt;&lt;P&gt;2) Double click on the method GET_INSTANCE.&lt;/P&gt;&lt;P&gt;3) Put a break point at Line no.25 (CASE sy-subrc).&lt;/P&gt;&lt;P&gt;4) Now Execute SAP standard transaction&lt;/P&gt;&lt;P&gt;5) Press the required button for which you need to write an exit logic, the execution will stop at the break point.&lt;/P&gt;&lt;P&gt;6) Check the values of variable 'exit_name', it will give you the BADI name called at that time.&lt;/P&gt;&lt;P&gt;7) This way you will find all the BADIs called on click of any button in any transaction&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually there is no transaction to find when and where the BADI &lt;/P&gt;&lt;P&gt;is called. &lt;/P&gt;&lt;P&gt;1. You can see the BADI description to find why it is called. &lt;/P&gt;&lt;P&gt;2. Once you implemented and activated the BADI, put some break points &lt;/P&gt;&lt;P&gt;in the BADI and see "where else used" option to check in what all &lt;/P&gt;&lt;P&gt;programs this BADI is called. In the ITS debug, when you are doing &lt;/P&gt;&lt;P&gt;the operation what exactly the BADI description tells, it will take &lt;/P&gt;&lt;P&gt;to the break points and you have to do manually debug the whole thing. &lt;/P&gt;&lt;P&gt;I know its bit difficult to do manual debug the whole thing, it &lt;/P&gt;&lt;P&gt;takes lot of time, but you have to be very patience when you are &lt;/P&gt;&lt;P&gt;dealing with BADI's. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transaction SE18 is the BADI equivalent of transaction SMOD &lt;/P&gt;&lt;P&gt;Transaction SE19 is the BADI equivalent of transaction CMOD . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To find the BADI to be implemented and then implement this via SE19.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To find badis for any transactions ---&amp;gt; &lt;/P&gt;&lt;P&gt;1. Go to Transaction SE24 &lt;/P&gt;&lt;P&gt;2. Enter the Object Type CL_EXITHANDLER and click on Display. &lt;/P&gt;&lt;P&gt;3. Double Click on method "GET_INSTANCE". &lt;/P&gt;&lt;P&gt;4. Put a Break-point on &lt;/P&gt;&lt;P&gt;Call method cl_exithandler=&amp;gt;get_class_name_by_interface &lt;/P&gt;&lt;P&gt;5. Run any Transaction for which you need enhancements. &lt;/P&gt;&lt;P&gt;6. The execution will stop at the break point. Check the values of variable 'exit_name', it will give you the BADI name called at that time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here are multiple ways of searching for BADI.&lt;/P&gt;&lt;P&gt;&amp;#149; Finding BADI Using CL_EXITHANDLER=&amp;gt;GET_INSTANCE&lt;/P&gt;&lt;P&gt;&amp;#149; Finding BADI Using SQL Trace (TCODE-ST05).&lt;/P&gt;&lt;P&gt;&amp;#149; Finding BADI Using Repository Information System (TCODE- SE84).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149;Finding BADI Using CL_EXITHANDLER=&amp;gt;GET_INSTANCE&lt;/P&gt;&lt;P&gt;Go to the Transaction, for which we want to find the BADI,&lt;/P&gt;&lt;P&gt;Get the Program Name of Corresponding Transaction.&lt;/P&gt;&lt;P&gt;(Click on System-&amp;gt;Status. Double Click on Program Name)&lt;/P&gt;&lt;P&gt;Once inside the program search for &amp;#145;CL_EXITHANDLER=&amp;gt;GET_INSTANCE&amp;#146;.&lt;/P&gt;&lt;P&gt;Make sure the radio button &amp;#147;In main program&amp;#148; is checked.&lt;/P&gt;&lt;P&gt;A list of all the programs with call to the BADI&amp;#146;s will be listed.&lt;/P&gt;&lt;P&gt;The export parameter &amp;#145;EXIT_NAME&amp;#146; for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it.&lt;/P&gt;&lt;P&gt;The changing parameter &amp;#145;INSTANCE&amp;#146; will have the interface assigned to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149;Finding BADI Using SQL Trace (TCODE-ST05).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149;Finding BADI Using Repository Information System (TCODE- SE84).&lt;/P&gt;&lt;P&gt;Go to &amp;#147;Maintain Transaction&amp;#148; (TCODE- SE93).&lt;/P&gt;&lt;P&gt;Enter the Transaction VD02 for which you want to find BADI.&lt;/P&gt;&lt;P&gt;Click on the Display push buttons.&lt;/P&gt;&lt;P&gt;Get the Package Name. (Package VS in this case)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to TCode: SE84-&amp;gt;Enhancements-&amp;gt;Business Add-inns-&amp;gt;Definition&lt;/P&gt;&lt;P&gt;Enter the Package Name and Execute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sample code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report ZDK_FIND_BADI&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZDK_FIND_BADI.&lt;/P&gt;&lt;P&gt;TABLES : TSTC,&lt;/P&gt;&lt;P&gt;TADIR,&lt;/P&gt;&lt;P&gt;MODSAPT,&lt;/P&gt;&lt;P&gt;MODACT,&lt;/P&gt;&lt;P&gt;TRDIR,&lt;/P&gt;&lt;P&gt;TFDIR,&lt;/P&gt;&lt;P&gt;ENLFDIR,&lt;/P&gt;&lt;P&gt;SXS_ATTRT ,&lt;/P&gt;&lt;P&gt;TSTCT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA : FIELD1(30).&lt;/P&gt;&lt;P&gt;DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS : P_TCODE LIKE TSTC-TCODE,&lt;/P&gt;&lt;P&gt;P_PGMNA LIKE TSTC-PGMNA .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA wa_tadir type tadir.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT P_TCODE IS INITIAL.&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSEIF NOT P_PGMNA IS INITIAL.&lt;/P&gt;&lt;P&gt;TSTC-PGMNA = P_PGMNA.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM TADIR&lt;/P&gt;&lt;P&gt;WHERE PGMID = 'R3TR'&lt;/P&gt;&lt;P&gt;AND OBJECT = 'PROG'&lt;/P&gt;&lt;P&gt;AND OBJ_NAME = TSTC-PGMNA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE : TADIR-DEVCLASS TO V_DEVCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM TRDIR&lt;/P&gt;&lt;P&gt;WHERE NAME = TSTC-PGMNA.&lt;/P&gt;&lt;P&gt;IF TRDIR-SUBC EQ 'F'.&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM TFDIR&lt;/P&gt;&lt;P&gt;WHERE PNAME = TSTC-PGMNA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM ENLFDIR&lt;/P&gt;&lt;P&gt;WHERE FUNCNAME = TFDIR-FUNCNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM TADIR&lt;/P&gt;&lt;P&gt;WHERE PGMID = 'R3TR'&lt;/P&gt;&lt;P&gt;AND OBJECT = 'FUGR'&lt;/P&gt;&lt;P&gt;AND OBJ_NAME EQ ENLFDIR-AREA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE : TADIR-DEVCLASS TO V_DEVCLASS.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM TADIR INTO TABLE JTAB&lt;/P&gt;&lt;P&gt;WHERE PGMID = 'R3TR'&lt;/P&gt;&lt;P&gt;AND OBJECT in ('SMOD', 'SXSD')&lt;/P&gt;&lt;P&gt;AND DEVCLASS = V_DEVCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM TSTCT&lt;/P&gt;&lt;P&gt;WHERE SPRSL EQ SY-LANGU&lt;/P&gt;&lt;P&gt;AND TCODE EQ P_TCODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.&lt;/P&gt;&lt;P&gt;WRITE:/(19) 'Transaction Code - ',&lt;/P&gt;&lt;P&gt;20(20) P_TCODE,&lt;/P&gt;&lt;P&gt;45(50) TSTCT-TTEXT.&lt;/P&gt;&lt;P&gt;SKIP.&lt;/P&gt;&lt;P&gt;IF NOT JTAB[] IS INITIAL.&lt;/P&gt;&lt;P&gt;WRITE:/(105) SY-ULINE.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_HEADING INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorting the internal Table &lt;/P&gt;&lt;P&gt;sort jtab by OBJECT.&lt;/P&gt;&lt;P&gt;data : wf_txt(60) type c,&lt;/P&gt;&lt;P&gt;wf_smod type i ,&lt;/P&gt;&lt;P&gt;wf_badi type i ,&lt;/P&gt;&lt;P&gt;wf_object2(30) type C.&lt;/P&gt;&lt;P&gt;clear : wf_smod, wf_badi , wf_object2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get the total SMOD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT JTAB into wa_tadir.&lt;/P&gt;&lt;P&gt;at first.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_HEADING INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/1 SY-VLINE,&lt;/P&gt;&lt;P&gt;2 'Enhancement/ Business Add-in',&lt;/P&gt;&lt;P&gt;41 SY-VLINE ,&lt;/P&gt;&lt;P&gt;42 'Description',&lt;/P&gt;&lt;P&gt;105 SY-VLINE.&lt;/P&gt;&lt;P&gt;WRITE:/(105) SY-ULINE.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;clear wf_txt.&lt;/P&gt;&lt;P&gt;at new object.&lt;/P&gt;&lt;P&gt;if wa_tadir-object = 'SMOD'.&lt;/P&gt;&lt;P&gt;wf_object2 = 'Enhancement' .&lt;/P&gt;&lt;P&gt;elseif wa_tadir-object = 'SXSD'.&lt;/P&gt;&lt;P&gt;wf_object2 = ' Business Add-in'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_GROUP INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/1 SY-VLINE,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 wf_object2,&lt;/P&gt;&lt;P&gt;105 SY-VLINE.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case wa_tadir-object.&lt;/P&gt;&lt;P&gt;when 'SMOD'.&lt;/P&gt;&lt;P&gt;wf_smod = wf_smod + 1.&lt;/P&gt;&lt;P&gt;SELECT SINGLE MODTEXT into wf_txt&lt;/P&gt;&lt;P&gt;FROM MODSAPT&lt;/P&gt;&lt;P&gt;WHERE SPRSL = SY-LANGU&lt;/P&gt;&lt;P&gt;AND NAME = wa_tadir-OBJ_NAME.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_NORMAL INTENSIFIED OFF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when 'SXSD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For BADis &lt;/P&gt;&lt;P&gt;wf_badi = wf_badi + 1 .&lt;/P&gt;&lt;P&gt;select single TEXT into wf_txt&lt;/P&gt;&lt;P&gt;from SXS_ATTRT&lt;/P&gt;&lt;P&gt;where sprsl = sy-langu&lt;/P&gt;&lt;P&gt;and EXIT_NAME = wa_tadir-OBJ_NAME.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_NORMAL INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/1 SY-VLINE,&lt;/P&gt;&lt;P&gt;2 wa_tadir-OBJ_NAME hotspot on,&lt;/P&gt;&lt;P&gt;41 SY-VLINE ,&lt;/P&gt;&lt;P&gt;42 wf_txt,&lt;/P&gt;&lt;P&gt;105 SY-VLINE.&lt;/P&gt;&lt;P&gt;AT END OF object.&lt;/P&gt;&lt;P&gt;write : /(105) sy-ULINE.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/(105) SY-ULINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SKIP.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_TOTAL INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;WRITE:/ 'No.of Exits:' , wf_smod.&lt;/P&gt;&lt;P&gt;WRITE:/ 'No.of BADis:' , wf_badi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;WRITE:/(105) 'No userexits or BADis exist'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;WRITE:/(105) 'Transaction does not exist'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT LINE-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : wf_object type tadir-object.&lt;/P&gt;&lt;P&gt;clear wf_object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET CURSOR FIELD FIELD1.&lt;/P&gt;&lt;P&gt;CHECK FIELD1(8) EQ 'WA_TADIR'.&lt;/P&gt;&lt;P&gt;read table jtab with key obj_name = sy-lisel+1(20).&lt;/P&gt;&lt;P&gt;move jtab-object to wf_object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case wf_object.&lt;/P&gt;&lt;P&gt;when 'SMOD'.&lt;/P&gt;&lt;P&gt;SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;when 'SXSD'.&lt;/P&gt;&lt;P&gt;SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;endcase.[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chck this site,&lt;/P&gt;&lt;P&gt;/people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Check these blogs to find a BADI:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3343735"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3370270"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3399488"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please reward points if helpful,&lt;/P&gt;&lt;P&gt;shylaja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2008 03:36:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-badi/m-p/3241513#M773677</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-14T03:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: tcode BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-badi/m-p/3241514#M773678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;find the package used for that transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;take transaction &lt;STRONG&gt;SE18&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;press F4 and in information system give the package name. You will get the ralated BADIs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Renjith Michael.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2008 07:10:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-badi/m-p/3241514#M773678</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-14T07:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: tcode BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-badi/m-p/3241515#M773679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;The simplese way for finding BADI is&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;1. chooes Tcode Program &amp;amp; package for that Tcode.&lt;/P&gt;&lt;P&gt;2. Go to Tcode se18&lt;/P&gt;&lt;P&gt;3. Press F4&lt;/P&gt;&lt;P&gt;4. search by package or by program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&amp;gt;First go to any transaction-&amp;gt;iN THE menu bar SYSTEM-&amp;gt;STATUS-&amp;gt;Get the program name -&amp;gt;double click-&amp;gt;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..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2&amp;gt;Goto SE24-&amp;gt;Give class name as CL_EXITHANDLER-&amp;gt;Display-&amp;gt;double click on get_instance mathod-&amp;gt;Now u will go inside the method-&amp;gt;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..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are multiple ways of searching for BADI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; Finding BADI Using CL_EXITHANDLER=&amp;gt;GET_INSTANCE&lt;/P&gt;&lt;P&gt;&amp;#149; Finding BADI Using SQL Trace (TCODE-ST05).&lt;/P&gt;&lt;P&gt;&amp;#149; Finding BADI Using Repository Information System (TCODE- SE84).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System-&amp;gt;Status. Double click on the program name. Once inside the program search for &amp;#145;CL_EXITHANDLER=&amp;gt;GET_INSTANCE&amp;#146;.&lt;/P&gt;&lt;P&gt;Make sure the radio button &amp;#147;In main program&amp;#148; is checked. A list of all the programs with call to the BADI&amp;#146;s will be listed.&lt;/P&gt;&lt;P&gt;The export parameter &amp;#145;EXIT_NAME&amp;#146; for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter &amp;#145;INSTANCE&amp;#146; 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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Start transaction ST05 (Performance Analysis).&lt;/P&gt;&lt;P&gt;Set flag field "Buffer trace" &lt;/P&gt;&lt;P&gt;Remark: We need to trace also the buffer calls, because BADI database tables are buffered. (Especially view V_EXT_IMP and V_EXT_ACT)&lt;/P&gt;&lt;P&gt;Push the button "Activate Trace". Start transaction VA02 in a new GUI session. Go back to the Performance trace session. &lt;/P&gt;&lt;P&gt;Push the button "Deactivate Trace".&lt;/P&gt;&lt;P&gt;Push the button "Display Trace".&lt;/P&gt;&lt;P&gt;The popup screen "Set Restrictions for Displaying Trace" appears.&lt;/P&gt;&lt;P&gt;Now, filter the trace on Objects: &lt;/P&gt;&lt;P&gt;&amp;#149; V_EXT_IMP &lt;/P&gt;&lt;P&gt;&amp;#149; V_EXT_ACT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Push button "Multiple selections" button behind field Objects &lt;/P&gt;&lt;P&gt;Fill: V_EXT_IMP and V_EXT_ACT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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_.&lt;/P&gt;&lt;P&gt;So the BADI name of IF_EX_CUSTOMER_ADD_DATA is CUSTOMER_ADD_DATA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Go to &amp;#147;Maintain Transaction&amp;#148; (TCODE- SE93).&lt;/P&gt;&lt;P&gt;Enter the Transaction VD02 for which you want to find BADI.&lt;/P&gt;&lt;P&gt;Click on the Display push buttons.&lt;/P&gt;&lt;P&gt;Get the Package Name. (Package VS in this case)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to TCode: SE84-&amp;gt;Enhancements-&amp;gt;Business Add-inns-&amp;gt;Definition&lt;/P&gt;&lt;P&gt;Enter the Package Name and Execute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you get a list of all the Enhancement BADI&amp;#146;s for the given package MB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Maha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2008 07:14:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-badi/m-p/3241515#M773679</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-14T07:14:11Z</dc:date>
    </item>
  </channel>
</rss>

