Customer exit real time business example SAP

+ -
Business Requirement: When ever we create a customer. We need to check weather the customer belongs to Country : GERMANY and if Region is equal to space .Then, Raise an Error message. For this requirement we need to implement Function Module exit.

Technical requirements:

  • 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.

Step1: Find the function exit.

Step2: Verify the customer exit.

Step1: Create project for customer exit.

Step4: Implement the Customer exit.

Find the function exit

Go to SE93 (maintain Transaction) T-code, provide XD01, display.

Customr exit in SAP

Double click on Program name SAPMF02D.Click on Find icon, main program, find CALL CUSTOMER, enter.

Customr exit in SAP

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 .

Customr exit in SAP

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.

Customr exit in SAP

Provide a customer, save (Ctrl S ), wait for breakpoint to trigger.

Customr exit in SAP

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.

Customr exit in SAP

Customr exit in SAP

Customr exit in SAP

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'.

Customr exit in SAP

Customr exit in SAP

Not down the Function Module name, go to SE11, provide table name MODSAP, display, contents and provide enhancement/member as EXIT_SAPMF02D_001, execute.

Customr exit in SAP

You will find the enhancement name for the function exit.

Customr exit in SAP

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.

Customr exit in SAP

You will find a include inside the function module, double click to create and add your own code.

Customr exit in SAP

And add below code.

Customr exit in SAP

Click BACK, activate Function Module.

Again click BACK,

Customr exit in SAP

Exit is implemented, test the object.

Go to XD02 .

Enter a Customer

Customr exit in SAP

Change Country to DE and Region to space .

Customr exit in SAP

We will get a error message.

Customr exit in SAP

Please Sign in to ask a question

Was this lesson helpful to you? Yes No 44 People out of 44 think this lesson helpful


Lesson Navigation

←Previous Chapter
Next Chapter →