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

Enhancement points option: Function modules or BADI

Former Member
0 Likes
1,909

Hi, I am on ECC 6.0 and I need to validate and set some requirement in customer sales area data when user input the document output message in Documents tab strip screen 7003 of sapmf02d in transaction XD01 or XD02.

I found that there is function module EXIT_SAPMF02D_001 that I probably can use to create an implicit enhancement point to validate table T_KNVD or I can use BADI customer_add_data. Can someone suggest which way is better and why? I am new to this so could someone show me screen by screen on how to create and implement BADI.

I am confusing about should I create a ZBADI or using existing BADI customer_add_data. If I use existing BADI how can I add my own method with my own code.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,803

Hi,

Go to se18 and give the badi name.

Go to Implementation and click on create and give the custom name.

Now when u create this all the methods in that badi will be available for u in ur custom badi where u can write wht ever u like.

U can see some example methods implemented by clicking the overview in implementation and u can select one of the implentation and go through the methods inside it so that you will get an idea how to write the methods.

Thanks

Ravindra.

Hi, I am on ECC 6.0 and I need to validate and set some requirement in customer sales area data when user input the document output message in Documents tab strip screen 7003 of sapmf02d in transaction XD01 or XD02.

I found that there is function module EXIT_SAPMF02D_001 that I probably can use to create an implicit enhancement point to validate table T_KNVD or I can use BADI customer_add_data. Can someone suggest which way is better and why? I am new to this so could someone show me screen by screen on how to create and implement BADI.

I am confusing about should I create a ZBADI or using existing BADI customer_add_data. If I use existing BADI how can I add my own method with my own code.

Thanks.

13 REPLIES 13
Read only

Former Member
0 Likes
1,804

Hi,

Go to se18 and give the badi name.

Go to Implementation and click on create and give the custom name.

Now when u create this all the methods in that badi will be available for u in ur custom badi where u can write wht ever u like.

U can see some example methods implemented by clicking the overview in implementation and u can select one of the implentation and go through the methods inside it so that you will get an idea how to write the methods.

Thanks

Ravindra.

Read only

0 Likes
1,803

Thanks. Could you explain to me how does the custom BADI get call to execute my code? Say

I have a customer document screen 7326 (Customer Master Subscreen SD Documents in program SAPMF02D). What I want is when user click save, I want to do some validation on the output message that they enter and issue some warning or error messages.

I am on ECC 6.0 so I can create a BADI from Enhancement spot not from SE18. SAP has a BADI called CUSTOMER_ADD_DATA with class CL_EX_CUSTOMER_ADD_DATA and interface IF_EX_CUSTOMER_ADD_DATA.

When I create a ZBADI_CUST, which interface class I put in the IF_EX_CUSTOMER_ADD_DATA

or a ZIF_EX_XX so that I can create my own method? How does the BADI get called when I am in transaction XD02 and click the save button? Could you kindly show me step by step the procedure.

Thanks.

Read only

0 Likes
1,803

Hi - If you want to validate some data, after pressing the SAVE button you can use the SD custom enhancement program MV45AFZZ . There you can find one Form - Endfrom userexit_save_document is given, which actually called after the SAVE button press.

Kuntal

Read only

0 Likes
1,803

This message was moderated.

Read only

0 Likes
1,803

I guess, in the thread its asking abt XD02 transaction! but, u mentioned a user-exit of a sales order creation/change application, sorry, if am wrong.

thanq

Read only

0 Likes
1,803

Probably you haven't checked the post given just before me. There he asked for some exit, when saving a SD document. I may misinterpret, but I thought this may help the OP, so I have given this reply.

Kuntal

P.S. - That's probably my mistake, I have misinterpreted the question. Thanks to remind me.....

Edited by: Kuntal Nandi on Mar 31, 2009 2:26 PM

Read only

0 Likes
1,803

No, it is the document output message in customer screen XD01, XD02 not the sales document in sales order.

I did create a BADI, the implementation is active but when I debug, it did not get thru my code. What did I do wrong? I create a ZBADI with new class and new method. When I tried the save button, it call get_badi_instance but never step in the method I created.

Read only

0 Likes
1,803

You can see, I have already apologized to you.

Just for your information, each BADI may have multiple triggering point (Interface). This interface triggers on different timing. like, before saving, after saving at the time of saving. So check the interface where you have written your code and also check the, the document flow with which you are testing.

Kuntal

Read only

0 Likes
1,803

I think you are using the BADI CUSTOMER_ADD_DATA. I will suggest you, you put a hard break point in each and every interface, and run your test, check which interface is going thorough your test. Put your code there.

Kuntal

Read only

0 Likes
1,803

Thanks, will do.

Read only

soumya_jose3
Active Contributor
0 Likes
1,803

Hi,

The exit EXIT_SAPMF02D_001 you mentioned is a customer exit and not a BADI.

Double click on the include in that function module ,then a warning message comes. Press Enter and then you will be inside the include. You can put your custom code inside that include.

Then you can code inside the ZX... include. After putting your code activate the include and the function module. Then go to Transaction CMOD and create a project and click on the 'Enhancement Assignments' button and include the enhancement of your include (which u can get from SMOD). Then activate the project u have created through CMOD. Your customer exit is activated now and will be called in the standard program

Regards,

Soumya.

Read only

0 Likes
1,803

Thanks Jose. But my question is which one should I choose? BADI or Customer exit?

Read only

Former Member
0 Likes
1,803

thanks guys.