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

BADI Implementation

Former Member
0 Likes
6,366

Hi folks,

I need some help in BADI development. Having gone through various resources on Search Forums, regarding BADI, need some assistance.

I need to make an enhancement regarding the Fast Entry actions (HR_FAST_ACTION_CHECK). Firslty, I decided to enhance the existing BADI. Hence I created a custom BADI (ZHR_FEFA_CHECK_ZA) followed by the filter type, the interface and the method.

Then using se19, i went on to implement the BADI. Here is the problem. It selects the custom filter type that I created for the BADI but the 'filter value' draws blank. The interface has the implmenting class, method that I created.

Since the filter value is blank, it is resulting in error and I am stuck here. Am I missing something?

I checked in the standard BADI, the filter value runs something like /1PAPAXX/FEFA0000101_0001.

How can this be generated in the custom BADI.

Any thoughts or leads is widely appreciated.

Thanks in advance,

VG

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
5,591

Hello Vinu,

If I understand correctly you have created your own BADI definition (ZHR_FEFA_CHECK_ZA)

using se18. Then using se19 you created an implementation for your custom BADI.

While this is certainly possible, if you do this you will have to modify the SAP code to call your BADI implementation. If in fact the BADI that SPRO refers to(HR_FAST_ACTION_CHECK) will work for you, you need to create your own implementation of that BADI (not create your own BADI definition) and then code the method(s). Then you can activate your implementation of the BADI which will now get called when you execute 'Fast Entry actions'.

As for the filter values these are set by you when you create the BADI implementation.

Hope this helps

Regards

Greg Kern

13 REPLIES 13
Read only

Former Member
0 Likes
5,591

Are you using classic BADI or BADI in enhancement framework?

Filter definition will be in the BADI definition, and its value you need to define in BADI implementation.

It selects the custom filter type that I created for the BADI but the 'filter value' draws blank

You need to pass value in implementation. It won't get it from definition.

And if it is enhancement framework BADI, then you have to use GET BADI for using it in ABAP code.

See the explanation below:

BAdIs can be called using a combination of the ABAP statements GET BADI and CALL BADI:

· GET BADI FILTERS f1=x1 ... fn=xn – selects the BAdI implementations whose filter condition is met by the filter values specified in the statement. The BAdI implementation classes assigned to the selected implementations are instantiated and passed to a simultaneously created BAdI object which serves as a handle for the implementation.

· CALL BADI badi->meth – addresses the BAdI object which passes the call of BAdI methods to the object plug-ins known to the BAdI handle.

G@urav.

Read only

0 Likes
5,591

Thanks Gaurav for the response.

I am using an standard BADI -HR_FAST_ACTION_CHECK.

Here is what I am trying to achieve, when I use the tcode PA42 (fast Entry transaction), it lists a series of action types. whenever I choose a particluar action type say (Hire) it takes to the interface table that has all the applicant records, upon performing the hire action it takes to the actions (0000) infotype screen. On the action screen, in the actions (massn) field, I want the same 'Hire action' type that I had chosen on PA42 screen to default on this screen instead of end user choosing from the list of all action types.

Under SPRO, they have mentioned about this BADI to check for Fast entry actions. However I ran the same transaction PA42 using the debugger, to find whether it calls this BADI under the normal circumstances and it did not.

Now, how can I link this bADI to get the desired result? At this point I am little confused.

Any thoughts?

VG

Read only

0 Likes
5,591

Hi Vinu,

What I understood so far is you tried some standard BADI to assign some default value to screen field.

But this standard BADI is not getting triggered so you went ahead to develop your own Z-BADI.

And now you want that system should trigger this Z-BADI at the location that you want it to.

If this is the case then,I would like to suggest something.

Can we search for some other enhancement provided by SAP to accomplish your customization?

The reason I'm asking is we normally develop Z-BADI for our Z-programs, and not for standard programs. Secondly, you need to call your Z-BADI in the standard transaction by opening it up using access key.. which is modification...that should be avoided.

And if we need to do modification, then instead of developing Z-BADI, you can simply open up the code and assign the default value(coming from previous screen) to that screen-field.

G@urav.

Read only

0 Likes
5,591

Hi Gaurav,

Thanks for the response. I got your point. I shall take a look into it.

VG

Read only

Former Member
0 Likes
5,592

Hello Vinu,

If I understand correctly you have created your own BADI definition (ZHR_FEFA_CHECK_ZA)

using se18. Then using se19 you created an implementation for your custom BADI.

While this is certainly possible, if you do this you will have to modify the SAP code to call your BADI implementation. If in fact the BADI that SPRO refers to(HR_FAST_ACTION_CHECK) will work for you, you need to create your own implementation of that BADI (not create your own BADI definition) and then code the method(s). Then you can activate your implementation of the BADI which will now get called when you execute 'Fast Entry actions'.

As for the filter values these are set by you when you create the BADI implementation.

Hope this helps

Regards

Greg Kern

Read only

0 Likes
5,591

Hi Greg,

Thanks for the response.

I tried that too. I tried to create a custom implementation in se19 using the standard BADI definiton, it copied the standard filter type, created an custom implementing class with the standard method. When I tried to save it, it asks for the filter value that did not get copied from the standard BADI. As gaurav mentioned, it is asking for the access key to modify the filter type. Without that, it is refusing to save the custom implementation and cannot proceed further.

Let me know if you have further thoughts. Thanks in advance.

VG

Read only

0 Likes
5,591

Hello Vinu,

I am not sure what is happening in your case. I am not sure what you mean when you say that the filter value does not get copied from the standard BADI. When you create a BADI implementation based on the SAP BADI you must enter your own values for the filter, In this case you are asked to enter a program name (created in tcode OG42). Then your BADI implementation will only be executed for the program that you enter. I did this in our system (ERP2004s) and it worked fine. I was not required to enter an access key. You should not require an access key since you are changing your own object.

Hope this helps.

Regards

Greg Kern.

Read only

0 Likes
5,591

I suggested , access key will be required to call BADI implementation, if you define your own Z-BADI . You don't require access key to implement any standard BADI.

Anyways.. best of luck for the solution..

G@urav.

Read only

0 Likes
5,591

Thanks for the input guys. I am in the learning process here in terms of BADI. Yes I am gradually getting a hang of what you guys are saying. I got your point that it requires a program name ( created from OG42) and that is the filter type (PROGNAME_FEFA) that it draws from the SAP BADI. The value is showing up fine in the custom Implementation (BADI). However, it also asks to enter 'Filter values' in a subsequent box below the filter type and I do not what to enter.

In the SAPI BADI implementation I see some value like /1PAPAXX/FEFA00000101_0001 for the filter type. I do not know how this value is coming. Do I need to create it? No clue.

I am stuck here. Without filling this value, it is not allowing me to save the custom implementation BADI and go further.

This is my problem.

Once again, I appeciate your inputs here.Thanks for bearing my limited knowledge in this regard.

Thanks,

VG

Read only

0 Likes
5,591

Hi Vinu,

/1PAPAXX/FEFA0000101__0001 is the filter value given in the implementation HR_FEFA_CHECK_10 provided by SAP.

When you define your own custom implementation, you can provide any program name over there. That will be the filter value of that filter type for that custom implementation.

G@urav.

Read only

Former Member
0 Likes
5,591

Hello Vinu,

/1PAPAXX/FEFA0000101_0001 is a name of a program generated in OG42. Once the config is completed in OG42 you can get the program name from there and add it as a filter value in your implementation of the BADI.

Regards

Greg Kern

Read only

0 Likes
5,591

Yes. I figured out something.. It is asking to create custom filter values for the fast entry action using OG42 that I am using it for.

There two action types that I am using 'ZA' and 'ZG' hence I created custom filter values and entered them in the filter values. It worked!!!!

changed the /1PAPAXX/FEFA010ZA10_0001 to ZA10_0001 it worked...

Now the method opened to write the code...

OMG!!! I have overcome the hurdle...

Thanks i am still working on it. But definitely want to thank you guys. I shall get back if I need some help forward, as I am doing this for the first time...

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Mar 27, 2008 1:02 PM

Read only

0 Likes
5,591

Hi guys,

I wanted to award full points to both of you. However it does not I shall award the points that are available.

Thank you so much. It has been a learning process. I really appreciate it.

VG