Vous êtes sur la page 1sur 9

Example1 on Function Module Exit using call customer

function.
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.
Technical requirements:
Tcode is : XD01/ XD02/ XD03.
Country Field is : LAND1 .
Region Field is : REGIO.
Table name is : KNA1 .
The above tables and fileds are given by functionasl consultants.

STEPS:
Step1 : Find the FM exit for the requirement.
Step 2: Implement the Exit using CMOD Transaction .
Step 3: Test It .

Step1 : Find the FM exit for the requirement:


Goto XD02
Give any customer no, Ex : 3471
Press enter

Customer Details will be displayed.


Click System from Menu bar -> Status ->
Double click on Program (Screen)

Now, Click on Find Icon


Type Call customer in the Find field, then click the In Main program
radio button and hit 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 my requirement, I need KNA1 Table details, SO I have
selected the below Customer Function Module which has an exporting
parameter I_KNA1.

Now, double click on the above Function Module and Put a breakpoint .
Now execute the Transaction.
Goto XD02
Give any customer number, Ex : 3471
Press Enter
Customer screen will be displayed.
Click on Save.
Our break-point will be triggered. Please check the below screen
shot ..

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.

Step 2: Implement the Exit using CMOD Transaction .

Goto CMOD Transaction.


Give a name for the Project

Click on create
Give Short Text as Implementing Enhancement for XD01.

Click on Enhancement Assignments Button.


Give Enhancement Name and press enter.
Now we dont know the Enhancement name .
So, to find the Enhancement name Follow the below steps.

STEPS TO find the Enhancement name

Goto Table MODACT which will display SAP Enhancement names.


Goto SE11->Give table Name as MODACT->display->Click on
contents
Give MEMBER as EXIT_SAPMF02D_001

Click on execute .

It will display the Enhancement name .

So the Enhancement name is SAPMF02D .


Give Enhancement Name and press enter.

Clcik on

Button.

The below Screen will be displayed with RED colors.

Double click on EXIT_SAPMF02D_001.


Function Module will be opened .
Below you will find an Include .

Double click on Include .


A warning message will appear.
Just press Enter.
Create the Include
Include will be opened.
Write the below code.

Save activate the Include.


Click on BACK
Activate the Function Module.
Click on BACK
Click on Activate.
The RED lights will turn to GREEN Color.
Activate the Exit.

Now, Run the transaction and test .

Goto XD02.
Give customer no
Press neter

Customer Screen is displayed.


Remove the region and save it.

Check below

Now save it . Our Exit will be triggered and


The error message will be displayed as below .

Vous aimerez peut-être aussi