- Tcode is : XD01/ XD02/ XD03.
- Country Field is : LAND1 .
- Region Field is : REGIO.
- Table name is : KNA1 .
- The above tables and fields are given by functional consultants.
To implement the Customer exit for this we need to follow the below steps.
Find the function exitGo to SE93 (maintain Transaction) T-code, provide XD01, display.
Double click on Program name SAPMF02D.Click on Find icon, main program, find CALL CUSTOMER, enter.
A list of call customer functions will be displayed.
Based on requirement, Check Import/Export Parameters for each Function Module And roughly select some Customer Function Modules .
As per this requirement, we need KNA1 Table details, So we can use the below Customer Function Module which has an exporting parameter I_KNA1.
Verify the Customer Exit
Then verify the customer exit (function module) wheather it will full-fill requiremnt.
Double click on Function module name and put the break point .
Go to SE11-KNA1-Display, get a customer and go to XD02.
Provide a customer, save (Ctrl S ), wait for breakpoint to trigger.
Stop the Debugging and now implement the Functional Module Exit. As this exit is triggered, this is the suitable Functional Module Exit for our requirement.
Create Project in CMOD to implement customer exit.Go to T-code CMOD (Project Management), provide a project name, create.
To implement we need to provide enhancement name but we don`t have enhancement name, we just have customer exit name, now we need to find enhancement name.
Follow the below steps to find enhancement for a customer exit.
All the enhancements for customer exits will be stored in MODSAP table, we can get enhancement name by using our customer exit.Get Function module name from customer exit, double click on CALL CUSTOMER FUNCTION '001'.
Not down the Function Module name, go to SE11, provide table name MODSAP, display, contents and provide enhancement/member as EXIT_SAPMF02D_001, execute.
You will find the enhancement name for the function exit.
Now go to CMOD and to project ZXD01_EX and click on enhancement assignments and add enhancement as SAPMF02D, enter and click on components.
You will find Function module name, double click on function exit.
You will find a include inside the function module, double click to create and add your own code.
And add below code.
Click BACK, activate Function Module.
Again click BACK,
Exit is implemented, test the object.
Go to XD02 .
Enter a Customer
Change Country to DE and Region to space .
We will get a error message.