Professional Documents
Culture Documents
ENHANCEMENTS
-Bhavannarayana .S
1
Enhancements
1. User Exits
2. Customer Exits
2.1 Menu
2.2 Screen
2.3Field
3. Badi(Business Add Ins)
3.1Classical
3.2 kernel
4. Implicit / Explicit Enhancement
5. BTE(Business Transaction Events)
2
User Exits
• User Exits are called as modifications not enhancements as we are
modifying the standard programs.
• We need access key to change the standard programs using user exits.
As soon as we click on change button of standard programs it will
ask for access key.
• In User Exits, We will write the code inside of Form-End forms.
• The data is available globally as it is a global program.
3
User Exits Continued…
We will be required access key as above. Once we get access key from SAP
Market Place, SAP will not support us further on this Object.
4
Customer Exits
• These are enhancements where we don’t require access key
5
Customer Exits Continued..
• My requirement is to validate a customer at time of Save with Country
Filter. The below is the one of process to find out the suitable Exit for this
requirement.
• First we need to find the package of the Tcode XD01(Cust. Creation).
• Go to the program for XD01->GOTO->Attributes. Here package is “VS”.
We have a TCode to find out the exit: SMOD, click on F4
6
Customer Exits Continued..
• We have only one exit SAPMF02D.
• Once We get the exit, we have to implement it in CMOD
by creating a Project.
7
Customer Exits Continued..
Click on Enhancement assignments and give your Exit name there.
9
Customer Exits Continued..
10
Customer Exits Continued..
11
Menu Exit
Menu exit is nothing but adding an item in the menu bar. We will see
an example below.
I would like to add an item in the menu of SE38.
12
Menu Exit Continued…
13
Menu Exit Continued…
If we have “+CUS” in any one of the menu bar items, only then we can
create menu exit.
Now get the package and then proper exit to implement the Menu exit.
14
Menu Exit Continued…
15
Menu Exit Continued…
Now we get 2 exits, among them
We will set and create the project
with the proper one.
16
Menu Exit Continued…
Create project in CMOD Go to Components and Assign the exit as follows
.
17
Menu Exit Continued…
As we have both menu and function exits here to implement, first
implement menu exit SAPLWBABAP later function exit
EXIT_SAPLWBABAP_010
18
Menu Exit Continued…
19
Menu Exit Continued…
Now go back and activate the
project.
20
Menu Exit Continued…
Now We can see the implemented Menu exit in SE38
21
Implicit Enhancements
Rather than getting the access key to modify the standard programs, SAP has
provided an option to write the code at the beginning of the form or at the ending
of the form. i.e. Implicit enhancement.
If we are ok to write the code at the above mentioned places we can go and write
the code without access key as mentioned below.
22
Implicit Enhancements Contd…
Then we get ‘’’’’’’’’ lines at beginning of the form, ending of the form as
mentioned.
Right Click on it and follow as below.
23
Implicit Enhancements Contd…
24
Implicit Enhancements Contd…
Click on “Code”
25
Implicit Enhancements Contd…
Click on ‘OK’.
27
Implicit Enhancements Contd…
28
Implicit Enhancements Contd…
Now we can write our logic in our enhancement where the entire
MV45AFZZ program Is input disable.
Note@ We will work on implicit only when we are ok to write the code at
earlier mentioned places else we have to go for Access key to modify the
code.
29
Field Exit
Field exit is nothing but to change the field label of a standard data element.
We will see one example as below.
30
Field Exit Continued…
To do Field exit, we use Tcode CMOD and follow the below path.
32
Field Exit Continued…
Now I have changed the label as “Field Exit”. The same will be reflected
now in XD01/2/3 Screen.
33
Field Exit Continued…
Based on Client needs, we can change the filed label of the Screen fields.
34
Screen Exit
Screen exit is nothing but adding a field(s) to the standard SAP screen.
Lets try an example for CJ01/2/3.
35
Screen Exit Continued…
Now we will create a project in
CMOD.
36
Screen Exit Continued…
As mentioned earlier, we can
assign exit to only one project.
Here this exit is already assigned
in some other proj. See the error
below in the screenshot.
Now we have to open the existing
project and add our enhancement.
37
Screen Exit Continued…
39
Screen Exit Continued…
We have created a sub screen 0600 as below.
Now lets write the code in both the function exits to move the data from
screen field to table and table to screen field.
40
Screen Exit Continued…
Click as below. Then you can see the newly added fields.
42
Screen Exit Continued…
43
BADI (Business Addin’s)
• Badi stands for “Business Addin’s”.
• We have an option to create no.of implementations for Badi’s which is
not available in Customer exits.
• Badi is purely on OOP’s concept.
• We will get an interface (Null Methods) when we create an
implementation for a Badi.
• Let us look into an example on Badi.
Note: We can see Badi definition at SE18 and Implement a Badi at SE19.
44
BADI (Business Addin’s) Contd..
Scenario: Popup when saving a material based on UOM.
Finding a Badi: We have a class CL_EXITHANDLER.
In this we have a method GET_INSTANCE, put the break
point at this method and run your tcode(MM01). We will get
many Badi’s. We will choose suitable Badi and implement.
45
BADI (Business Addin’s) Contd..
Now lets implement the Badi and write the code in SE19.
46
BADI (Business Addin’s) Contd..
Now click on tab “Interface” and write the code in method “Check_data”
47
BADI (Business Addin’s) Contd..
Note@ We can create many implementations for this Badi. All the active
implementations will get triggered in “Alphabetical Order”. If we want to change
the order of triggering we have another Badi “BADI_SORTER” for that.
48
Kernel BADI
49
Kernel BADI Continued…
50
Kernel BADI Continued…
51
Kernel BADI Continued…
52
Kernel BADI Continued…
53
Kernel BADI Continued…
Continue.
54
Kernel BADI Continued…
55
Kernel BADI Continued…
56
Kernel BADI Continued…
Execute
57
Explicit Enhancement.
• We can create Explicit enhancements in Enhancement Spot.
• We have two options in Explicit enhancements
• Enhancement-Point
• Enhancement-Section
58
Explicit Enhancement Continued.
59
Explicit Enhancement Continued.
We can create implicit enhancements as below and write our own logic.
61
Explicit Enhancement Continued.
We can create as many enhancements like this.
62
BTE- Business Transaction Events
63
BTE- Business Transaction Events Contd…
Open T-code “FIBF” and click as below.
64
BTE- Business Transaction Events Contd…
66
BTE- Business Transaction Events Contd…
67
Now follow as below. Open T-code FIBF
68
69