Application Development 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: 

how to see the all badis

Former Member
0 Kudos

dear friends can any body tell where can we see all badis

1 ACCEPTED SOLUTION

GauthamV
Active Contributor
0 Kudos

hi,

dont post simple questions.

just use the search box provided on the top.all these questions have hundreds of answers there.

se18 - find badi.

se19 - implement badi.

reward points for hlpful answers and close the thread by making it as answered.

5 REPLIES 5

GauthamV
Active Contributor
0 Kudos

hi,

dont post simple questions.

just use the search box provided on the top.all these questions have hundreds of answers there.

se18 - find badi.

se19 - implement badi.

reward points for hlpful answers and close the thread by making it as answered.

Former Member
0 Kudos

hi,

Execute below code and

Enter Tcode name for which you want to see badi.

TABLES : tstc,

tadir,

modsapt,

modact,

trdir,

tfdir,

enlfdir,

sxs_attrt ,

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,

p_pgmna LIKE tstc-pgmna .

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

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 IN ('SMOD', 'SXSD')

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:/(105) sy-uline.

FORMAT COLOR COL_HEADING INTENSIFIED ON.

  • Sorting the internal Table

SORT jtab BY object.

DATA : wf_txt(60) TYPE c,

wf_smod TYPE i ,

wf_badi TYPE i ,

wf_object2(30) TYPE c.

CLEAR : wf_smod, wf_badi , wf_object2.

  • Get the total SMOD.

LOOP AT jtab INTO wa_tadir.

AT FIRST.

FORMAT COLOR COL_HEADING INTENSIFIED ON.

WRITE:/1 sy-vline,

2 'Enhancement/ Business Add-in',

41 sy-vline ,

42 'Description',

105 sy-vline.

WRITE:/(105) sy-uline.

ENDAT.

CLEAR wf_txt.

AT NEW object.

IF wa_tadir-object = 'SMOD'.

wf_object2 = 'Enhancement' .

ELSEIF wa_tadir-object = 'SXSD'.

wf_object2 = ' Business Add-in'.

ENDIF.

FORMAT COLOR COL_GROUP INTENSIFIED ON.

WRITE:/1 sy-vline,

2 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 + 1 .

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.

ENDCASE.

WRITE:/1 sy-vline,

2 wa_tadir-obj_name HOTSPOT ON,

41 sy-vline ,

42 wf_txt,

105 sy-vline.

AT END OF object.

WRITE : /(105) sy-uline.

ENDAT.

ENDLOOP.

WRITE:/(105) sy-uline.

SKIP.

FORMAT COLOR COL_TOTAL INTENSIFIED ON.

WRITE:/ 'No.of Exits:' , wf_smod.

WRITE:/ 'No.of 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(8) EQ 'WA_TADIR'.

READ TABLE jtab WITH KEY obj_name = sy-lisel+1(20).

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.

ENDCASE.

reward if usefull.

former_member181995
Active Contributor
0 Kudos

Subbu,

see to find the BADI i will tell u simple method.

goto that screen where you want to implement BADI. suppose XK01.

now open another session go to t-code se24. give the class name cl_exithandler.this is the class that stores all the BADI's.

now goto display option and see there u will find a method get_instance.double click that u will go to the implementation screen for this method.

Now put a break point at the method implementation:

CALL METHOD cl_exithandler=>get_class_name_by_interface

now run ur xk02 screen. check the BADI name inthe field exit_name.

open the relevant one and go for implementation of that in se19 t-code.

let me know if u have any perplexity in this.

Amit.

Former Member
0 Kudos

Hi,

U can find BADI definition - in SE18

and BADI implementation in SE19.

Regards.

Former Member
0 Kudos

Hi Subbu,

You 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-> It will take you 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).

/people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it

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.

Reward points, if useful..

Regards,

Nitin.