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: 

BADI Triggering

Former Member
0 Kudos

HI all,

I am trying to analyze a badi created in CRM. The definition of BADI I am using is EXEC_METHODCALL_PPF.

In the implementation of this BADI in se19 I find these values.

Filter Type : PPFDFLTVAL

Here value is asociated with the domain of the filter type.

Method (Under define filters) : Z_JWT_BADI1

IN the implementation of this I have the following code :

method IF_EX_EXEC_METHODCALL_PPF~EXECUTE .

message W208(00) with 'Please Enter the Complaint Description'.

endmethod.

Also there are multiple implementations for this BADI. And the BADI I said above triggers when the descrition field is not fille in the tcode CIC0. As per my opinion the method endmethod code should have some code like

if <description> is initial.

<message>.

endif.

But instead the message is given and the BADI triggers fine. Now I do not understand how the message is displayed if no condition is checked. Because it does not appear when descrition is filled. Even though I have little knowledge about BADI's I am not completely aware how this implementation is working. Can anyone explain me how this thing works and how to check from which part of the program the BADI is triggered and what is the role of filter in this to trigger the exact implementation.

Regards,

Varun.

Message was edited by: varun sonu

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI All,

Let me be more clear with my doubt. Its fine you all say that the method is triggered because of the filter value. But why will it be triggered only when the field is left empty and not when it is filled. I am expecting it to trigger everytime because all the implementations will be called when you have multiple implemenations for the BADI. And i do not have nay if checking in the method definiton. Even in the program from where the BADI is being called there is no condition check on the

field. I am attachinmg the code.

CALL METHOD EXITINTF->EXECUTE

EXPORTING

FLT_VAL = FLT_VAL

IO_APPL_OBJECT = IO_APPL_OBJECT

IO_PARTNER = IO_PARTNER

IP_APPLICATION_LOG = IP_APPLICATION_LOG

IP_PREVIEW = IP_PREVIEW

II_CONTAINER = II_CONTAINER

IP_ACTION = IP_ACTION

RECEIVING

RP_STATUS = RP_STATUS.

Regards,

Varun.

21 REPLIES 21

naimesh_patel
Active Contributor
0 Kudos

Hello,

It is because of the filter.

Regards,

Naimesh

0 Kudos

HI Patel,

I know that this is because of the filter. I want to know how this filter is coming into action and the filter value is recognised in the program.

REgards,

Varun.

0 Kudos

Hello Varun,

First of all, if you want to call me by last name then use Mr. Patel, not Patel.

Visit,

http://help.sap.com/saphelp_46b/helpdata/en/c8/1978b543b111d1896f0000e8322d00/frameset.htm

Hope, will help you.

Regards,

Naimesh

Reward points, if it is useful.

0 Kudos

Varun,

In order to determine that you need to find the place where the BADI is being called in the standard code. This filter value is an additional parameter to the method where the BADI is called.

Regards,

Ravi

0 Kudos

Hi Mr. Patel,

I am very sorry about that. Forgive my mistake.

Regards,

Varun.

0 Kudos

Hey Varun,

take it lightly..

Btw, I will forgive you... IF you give me rewards for my efforts...

Cheers...!!

Regards,

Naimesh

0 Kudos

Hi Mr.Naimesh,

Sure, I am going through the documentation you hve provided me. I will get back to you if there are any more doubts.

Regards,

Varun.

0 Kudos

Hi all,

I dont understand how else can I explain my problem ?

When we run the transaction all the BADI implementations will be called right ? Here in my case there are multiple implementations. So will all the filter values be passed to the method in the calling program ? If so why the program stops at this particular BADI even though I am not doing any field checks ? It should stop at every BADI right ?

Regards,

Varun.

Former Member
0 Kudos

HI All,

Let me be more clear with my doubt. Its fine you all say that the method is triggered because of the filter value. But why will it be triggered only when the field is left empty and not when it is filled. I am expecting it to trigger everytime because all the implementations will be called when you have multiple implemenations for the BADI. And i do not have nay if checking in the method definiton. Even in the program from where the BADI is being called there is no condition check on the

field. I am attachinmg the code.

CALL METHOD EXITINTF->EXECUTE

EXPORTING

FLT_VAL = FLT_VAL

IO_APPL_OBJECT = IO_APPL_OBJECT

IO_PARTNER = IO_PARTNER

IP_APPLICATION_LOG = IP_APPLICATION_LOG

IP_PREVIEW = IP_PREVIEW

II_CONTAINER = II_CONTAINER

IP_ACTION = IP_ACTION

RECEIVING

RP_STATUS = RP_STATUS.

Regards,

Varun.

0 Kudos

Hi Varun,

Pl verify in the Program where this method was triggered.. Prior to calling the method, there should be code that verifies if the BAdI is implemented or not.. may be the field value is being checked first & then the instance check & then the method call..

Regards,

Suresh Datti

0 Kudos

Hi Suresh,

I am debugging the BADI implemenattion and in that I am seeing the list of calls. I am not sure how to find from where in the program it is being triggered ?

Regards,

Varun.

0 Kudos

Hi Suresh,

The program fom which it is being triggered is sap standard program. The field is not mandatory as per the sap program. Only the user wants to make it mandatory. So he is implementing BADI. I dont think the oprgram checks the field ?

Suresh are you in US or India ? If you are in US can you give me your phone number ?

Regards,

Varun.

0 Kudos

Varun,

I think the best thing would be to debug CIC0 from the beginning.. & single step all the way through until you hit this BAdI.. it might be time consuming but would sure be of help..

Regards,

Suresh Datti

0 Kudos

Hi Suresh,

Forgive me if it is wrong on my side to ask your phone number. I will try to debug the whole program and see if I can figure it out .

Regards,

Varun.

0 Kudos

Hi Varun,

If you have not already tried it you can directly hit the point where the BAdI is being called by executing the program in debug mode and setting a break point at class CL_EXITHANDLER method GET_INSTANCE. I have found this method very useful in finding out BAdI's that are being called within a program.

Regards

Bhooma

0 Kudos

Varun,

Did you use the tip (good one!) given by Bhooma to locate the place from where the BAdI is triggered.. It would save you a lot of time..

Regards,

Suresh Datti

P.S. You can drop me an email

0 Kudos

Hi Suresh,

Since I am in a meeting I did not try that. But I will try that later. I wil get back to you in case I get some doubts. thank you very much for the suggestions.Can you please drop me u'r mail Id.

Note : I will award points to all of you With out failure.

Thanks and Regards,

Varun.

0 Kudos

Varun,

Was your issue resolved? You can click on my Business Card to view the email address..

Regards,

Suresh Datti

0 Kudos

Hi Bhooma Sridharan and satish,

Thanks a lot both of you sridhar and satish for taking lot of pain and time for helping me out with your valuable suggestions.

Once again Thanks a Ton.

Regards,

Varun.

Former Member
0 Kudos

Hi Varun,

In order to provide an implementation to the Filter dependent BAdI(which selects depending on the filter value), do the following steps.

First find out the location where BAdI is called.

(In the main program , search for the method call

CALL METHOD CL_EXITHANDLER=>GET_INSTANCE).

eg:

CALL METHOD CL_EXITHANDLER=>GET_INSTANCE

exporting flt_val = f_val

changing instance = badi_interface.

Here f_val is the filter value, depending on which the implementation is executed. After execution of this step, the variable BADI_INTERFACE will contain the answer (whether it is active or not).

If not BADI_INTERFACE is initial.

    • you can call the methods in the BAdI definition

call method badi_interface->method1....

endif.

Remember BADI_INTERFACE is a reference variable which refers to a BAdI Interface and the syntax is

DATA: BADI_INTERFACE type ref to interface_name.

This is the method which triggers the message.

Hope your query is solved.

Regards,

SP.

Former Member
0 Kudos

Hi Varun,

Here if there r multiple imlementations for a BADI ,at a a time only one will be active (which u have activated).

For this the filter value is Screen group.

You need to do all the coding for the Methods what ever u r using in the BADI. You can include the If condition a/c to u in this coding.

Regards,

Vasantha.