cancel
Showing results for 
Search instead for 
Did you mean: 

badi's

Former Member
0 Kudos

Hi guru's.

can any body can tell me that for particular tranction we have too many subscreen badi definations. then how should we find out that particular badi is required for our tranction or client requirment.

Plz help me theoratically or with any code navigation. i will reward u full points to that answer.

2) in a badi defination or implementation we have so many methods in which we have to write a code. my question is which method will be executed first.whether method is executed RANDOMLY or in sequence .and why?

Thanks & Regards

Satish

Thanks'

Satish

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

1.The method is triggered based on the Application requirement.If there so many implementations for the same method ,then latest implementation can trigger.

2.we can check the each Badi ,which is multiple implementation, then we can go for the implementation of that badi.

We will check the each and every method or By short text or By name of the method,by putting the brakpoint.

3.Which method of Badi definition is triggered for our requirement,we will go for that.

Regards,

Shiva(reward if helpful).

Former Member
0 Kudos

Hi shiva.

.The method is triggered based on the Application requirement.If there so many implementations for the same method ,then latest implementation can trigger.

This is your answer ,

i have badi defination as BADIDEF.

By using this BADIDEF i implemented 3 badis i.e.

Zbadi,ZZbadi, ZZZbadi.

So which badi is executed first. whether Zbadi or ZZbadi or ZZZbadi. This is my interview question.

Former Member
0 Kudos

Hi Satish,

Which BADI IMplementation is implemented latest that BADI implementation will trigger first.

Suppose you have implemented the

Zbadi in 20/04/2008

ZZbadi in 21/04/2008

and ZZZbadi is in 22/04/2008

Then the badi ZZZBADI Implementation trigger first then ZZbadi will trigger second and finally Zbadi will trigger.

Regards

Kiran Sure

Former Member
0 Kudos

Thank's kiran.

i am having one more doubt.

for e.g for ME23n tranction i want to add a subscreen. but for that tranction i have two badi definations let it be 1) badisubscreen1

2) badisubscreen 2.

so my question is which badi defination i shd use for implementation. how to find out that badi defination. whether by debugging or any other method is there to find out a badi defination.

Former Member
0 Kudos

Hi

The follwing user exits and badis available for me23n transaction:

Try the Badi :ME_GUI_PO_CUST.

For better understanding of the badi .

Goto SE18 Transaction give the badi name .Click on documentation button . See the documentation.

For better understanding of the code:

see the class :CL_EXM_IM_ME_GUI_PO_CUST or

In se18, goto/ sample code/display.

USER EXIT BE

MM06E005

Customer fields in purchasing document

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

•Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE

Go to the Transaction, for which we want to find the BADI,

Get the Program Name of Corresponding Transaction.

(Click on System->Status. Double Click on 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.

Finding BADI Using SQL Trace (TCODE-ST05).

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

Regards

Kiran Sure

Former Member
0 Kudos

Please execute below code with the transaction for which you need to find out BADIs involved. This will output list of BADIs.

&----


*& Report ZBADI *

*& *

&----


*& *

*& *

&----


REPORT zbadi .

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.

I hope it helps

Thanks,

Vibha

Please mark all the useful answers

Former Member
0 Kudos

ok Vibha,

i know how to find out a badi, my problem is for particular transction we have two badi's releted to screen exits which screen exit(which badi i should select) 1St or 2 nd which one i shd select.