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

How to debug a BADI

Former Member
0 Likes
4,397

i have implemented a BADI -- FI_PAYREF_BADI_010 ....., now i am trying to debug this implementation by putting a break point in the code in implementation , now i am trying to change the invoice -- account section thorugh VF01 or VF02 transaction.... but it is not triggering ...i am not bale to judge where the problem is ......i have also checked that there is no other implementation for this BADI apart from wht i have created .....

please help me out

13 REPLIES 13
Read only

Former Member
0 Likes
3,335

Hi,

Inadditon to setting the break point in the BADI methods, you need to do the below: so that it triggers for each BADI call.

1. Go to the TCode SE24 and enter CL_EXITHANDLER as object type.

2. In 'Display' mode, go to 'Methods' tab.

3. Double click the method 'Get Instance' to display it source code.

4. Set a breakpoint on 'CALL METHOD cl_exithandler=>get_class_name_by_interface'.

5. Then run your transaction.

6. The screen will stop at this method.

7. Check the value of parameter 'EXIT_NAME'. It will show you the BADI for that transaction.

Now if the BADI is triggered correctly the implementation can be debugged.

Regards

Shiva

Read only

jaideepsharma
Active Contributor
0 Likes
3,335

Hi,

Check if the BADI implementation is activated or not ? Try putting hard breakpoint if in dev. system or put an external breakpoint in the BADI implementation.

KR Jaideep,

Read only

0 Likes
3,335

hey i have checked ...BADI implementation is in active state only

Read only

0 Likes
3,335

I put a break point and saw neither in Invoice creation nor at the save of invoice that BADI is hit/trigerred.

Use " this is in the documentaion of the BADI

This Business Add-In is used in the Interest Calculation (FI-AR-AR-IN) and Billing (SD-BIL) components.

It enables you to assign your customer invoices a payment reference number of your choice. This 
function is particularly interesting for companies in Denmark, Finland, Norway, and Sweden, where 
the payment reference number plays a more important role than in other countries.

In the standard R/3 System, when you create a customer invoice, the system generates a payment
 reference number by taking the invoice reference number and adding a check digit to it. However, this
 Add-In allows you to use a different number as the basis for the payment reference number, for example
 the customer number or the date as the reference number instead. You can use any of the numbers from
 the accounting document header or line items.

Read only

Former Member
0 Likes
3,335

Hi,

this is a filter dependent BADI when you are creating the implementation in the attributes tab you would have an option to define filters click the plus sign and add the country for which you want the BADU to trigger activate the BADi and then try.

Regards,

Himanshu

Read only

0 Likes
3,335

hey thanks for ur reply

ya i know it is filter dependent so i added the country keys for that and also activated .....

Read only

0 Likes
3,335

hmm...ok even i m checking tht for VFo1 , and VF02 this BADI is not trigerring ....

how to find the transaction where this BADI is trigerring ?

Read only

0 Likes
3,335

Hi,

Do a where used list on BADI and you will come to know the program where it is used. It's used in FI_PAYREF_CREATE_1 Function module which is used in report RFDUZI00 and RFKUZI00.

KR Jaideep,

Read only

0 Likes
3,335

Hi,

Check the package FBAS and also the documentation for the BADI to check where it is triggereing.

In order to check where it is triggering go to class cl_exithandler and put a debug point in method 'GET_INSTANCE' there exit_name variable would give you the name of exits triggering when you run a transaction say Vf02.

like : BADI_SD_BILLING_ITEM

BADI_SD_BILLING,GOS_SRV_SELECT,BADI_SD_TO_FM,BADI_MATN1 are some of the BADIs triggering for VF02.

Regards,

Himanshu

Read only

jaideepsharma
Active Contributor
0 Likes
3,335

Hi,

Try putting breakpoint on function module SXV_GET_CLIF_BY_NAME. Execute your transaction. Program will stop at this function module. Check the name parameter. When the name is name of your BADI start debugging the program and check why the BADI implementation is not called.

KR Jaideep,

Read only

0 Likes
3,335

hi sharma , i have tried to put the break point as u said ...but my BADI is not gettiing triggered there....it is showing so many other values in names tab

Read only

0 Likes
3,335

Hi,

Then I don't think this BADI is called for your transaction.

KR Jaideep,

Read only

Former Member
0 Likes
3,335

Hi Jaya,

Wht exactly ur requirement,for what purpose u want to implenment it,

check whether this is the correct badi for ur purpose.