Enhancements

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 60

Enhancement

s
BY ----Sirish
Overview


Enhancements:

It is a concept by which we add extra code to the standard sap
software without modifying it is called enhancement.

Each enhancement point is called as exit point.

Types of enhancements

User exits

Customer exits

Badi’s

Enhancement spots

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 2
Overview

User exits

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 3
Overview


user exits :

These are subroutines where we can write our custom code to
enhance the application.

Technically, these are called as modifications .

We need sap access key for user exits, that is why these are called
as modifications.

These are available only in sd module.

Each user exit will start with userexit_xxxx.

Ex :- perform userexit_xxxx.

Form userexit_xxxx

End form.
 SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 4
Overview


Customer exit:- These are zinclude programs which are available
inside a fuction module.

Each function module is called as customer exit.

Technically these are called as enhancement, we don’t require any
access key.

Customer exits are available in all modules.

There are four types of customer exits.

Function module exit

Menu exit

Screen exit

Field exit (absolete now).
 SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 5
Overview


Function module exit:-

This exit is used when we want to write custom coding to enhance
the standard sap application.

Each function module exit will have a predefined signature

i.e importing and exporting parameters.

Based upon the importing and exporting parameters write the
custom code.

Each function module exit will have a zinclude.

Double click and create the zinclude and write your abap code.

Each function module exit will start with Exit_xxxx_001

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 6
Overview


Menu exit:-

This exit is use to add custom menus to the standard menu bar.

Each menu exit is identified by ‘+’ symbol.

Double click on the ‘+’ symbol and create the custom menu.

Every menu exit should have a function module exit to add the abap
coding for the custom menu options.

A menu exit is use to add custom menu and function module exit is
use to add the abap logic for the corresponding menu exit.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 7
Overview


Screen exit:-

This exit is use to add custom sap screen to the standard sap
screen is called screen ecit.

All the screen exits will be of type subscreen.

Each subscreen is identified by screen no

Double click on the screen no and create a screen of type
subscreen.

Each screen exit will have a function module exit to write the abap
code for the custom screen.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 8
Overview


Field exit:-

This is exit is use to change the standard field labels of input fields
on sap screen. This are absolete in sap.

Sap does not support this.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 9
Overview

Project

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 10
Overview


Project:-

The project is a group of enhancements.

Each enhancement is group of exits i.e.function module exit,
screen exit, menu exit.

A project must be created so that the enhancements which are
available under a project will move into active state and then our
coding will be executed .

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 11
Overview

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 12
Overview


Note:

A project is group of enhancements but each enhancement cannot
be linked to more than one project.

CMOD is the transaction to create a project.

SMOD is the transaction for searching the enhancement exits.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 13
Overview

Searching for enhancements or exits

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 14
Overview


Basically we have three ways to search for a exit.


Using call customer function

Using SMOD tcode.

Using se84 tcode.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 15
Overview


Using call customer function

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 16
Overview


Go to se93.

Give the tcode name

Ex:- xd01.

Click on display

Double click on the program name.

Click on the find button .

A pop up is displayed.

Give the string as call customer.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 17
Overview


Select radio button in main program

Press enter.

Double click on main program name and continue until
the call customer functions are displayed.

Ex:- call customer fuction ‘001’.

Exporing

------

Table

-------
 SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 18
Overview


Double click on 001

Again double click on 001

The function module exit will displayed.

Check the signature.

If it is suitable , write the abap code in the zinclude
program.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 19
Overview

Using SMOD transaction

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 20
Overview


Step1:- Frst we have to find out the package name for transaction.

Step2:- Go to smod transaction and find the enhancements using
the package name.

Step3:- some times we can find the enhancements using the
description, application component also in smod transaction.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 21
Overview


Step1 in detail :

Go to se93

Give a tcode name

Ex:-xd01.

Click on display.

Note down the package name. Ex:- FBD

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 22
Overview

Step2 in detail

Go to smod transaction

Click on utilities find

A pop up is displayed.

Give the package name as FBD.

Click on execute.

The list of the enhancements will be displayed.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 23
Overview


Double click on the enhancement name.

The list of the function module exit, menu exits, screen exits will be
displayed.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 24
Overview

Using SE84 Tcode

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 25
Overview


Go to se84.

Expand enhancement folder.

Expand customer exit folder.

Double click on enhancements.

Give the package name FBD.

Click on execute.

The list of the enhancement will be displayed.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 26
Overview

Finding enhancements for a exit

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 27
Overview

If we use CALL CUSTOMER to serach for an exit, we directly get M exit
without enhancement name.

But id we use SMOD, we get enhancements and then we get EXITS.

Modsap is the table which will give the enhancement name for a exit.

Go to se11.

Give the table name as modsap.

Click on display.

Click on table contents.

Give the member as exit name.

Ex:- EXIT_SAPMF02D_oo1

Click on execute button.

Enhancement name will be displayed.
 SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 28
Overview

Finding the exact or correct exit

After finding the list of the enhancementS or function
module exit, put a break point in all the function module
exit.

First create project in cmod transaction.

Put a break point in fm exits.

Execute the transaction.

Now you can find easily which is correct exit based on
your requirement.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 29
Overview

Steps to find user exits

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 30
Steps:


Go to transaction code va03

Click on SYSTEM status.

A pop up is displayed .

Double click on the program name.

Click on the binoculars button..

Give the string as userexit.

Select the redio button in main program and press enter.

Give the main program name and press enter.

Continue the process until you find out the user exits.

Ex:- perform userexit_save_doccument_prepare.

Ex:- perform userexit_save_doccument.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 31
Overview

Ex on user exits

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 32
Overview

Ex on FM Exit using CALL CUSTOMER

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 33
Overview

Ex on FM Exit using SMOD

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 34
Overview

Ex on MENU Exit

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 35
Overview

Ex on SCREEN Exit

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 36
Overview

Ex on FIELD Exit

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 37
Overview

BADI’S (Business Add-ins)

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 38
BADI’S (Business Add-ins)


BADI’S :

It is another way of implementing enhancements to the
standard programs with out modifying the original code.

Badi’s are implemented using oo programming
technique

Technically a badi is nothing but an interface.

Each badi consists of the method with out
implementation called as badi definition.

We need to create classes to write the abap code by
implementing the methods called as badi
implementation.
 SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 39
Overview

Se18 is the tcode for badi definition.

Se19 is the tcode for badi implementation.

The interface name for a badi will be as below.

Ex:- IF_EX_<BADI NAME>

The class name for a badi will be as below.

Ex:- ZCL_EX_<IMPLEMENTATION NAME>

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 40
Overview

Advantages of BADI’S

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 41
Overview

Advantages of badi’s:

The main advantage of using badi’s is , we can create multiple
implementations for a single BADI definition.

Where as with the exits, we can create a single implementation.

i.e A single project for a enhancement.

We cannot create another project (implementation) for enhancement
which is already used. That is why we go for BADI’s.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 42
Overview

Types of BADI’S

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 43
Overview


Types of BADI’S:

Single implementation badi.

Multiple implementation badi.

Filter badi.

Custom badi (Not used/Rarely used)

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 44

Single implementation badi:-

A badi which has only one implementation (single class)
is called single implementation badi.

Multiple implementation badi:-

A BADI which has multiple implementations is called
multiple implementation badi.

By default all the implementations will be executed.

We cannot control the sequence of execution of multiple
implementations

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 45

Filter badi:-

It is type of badi which has a filter value so that only
those implementations which satisfy the filter value are
executed.

The remaining implementations are not executed this
type of badi is called a filter badi.

The filter value will be DE generally .

Examples of filter values are land1,bukrs,werks

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 46
Overview

Properties of BADI’S

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 47
 SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 48

Properties of BADI’S:

If WITH IN SAP checkbox is selected then this badi is only used by
sap.

If multiple use checkbox is selected then it is a multiple
implementation badi.

If multiple use checkbox is not selected then it is a single
implementation badi.

If filter dependent checkbox is selected then it is filter dependent
badi.

We need to specify the filter type such as land1,bukrs,werks.for the
filter badi.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 49

Finding the badi for a TCODE.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 50

There are 2 ways for finding a BADI.

1)Using class CL_EXITHANDLER

2)Using SE84 Tcode

Using class CL_EXITHANDLER :

CL_EXITHANDLER is the class and GET_INSTANCE is the method to
find the list of the badi’s for transaction.

Steps :

Go to se24.

Give the class name as CL_EXITHANDLER.

Click on display.

Double click on the method GET_INSTANCE and Put a break point
on the below method GET_CLASS_NAME_BY_INTERFACE
 SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 51
 SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 52
Second method using se84


Find the package name for a transaction code

Go to se84.

Expand enhancement folder.

Expand business add ins folder.

Double click on the definition.

Give the package name.

Click on execute.

Ex:- give the package name as VA.

Click on execute.

The list of badi’s are displayed.
 SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 53
Ex1 on BADI :

Raise an error message whenever


the vender belongs to german
country and region is not
specified.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 54
Ex2 on BADI :

Raise an error message whenever


the vender belongs to german
country and Industry key is not
specified.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 55
Ex3 on BADI :

For all the materials in our
company, Please add a prefix
‘REL-‘ for the description of a
material in transaction
MM01/MM02.

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 56
Ex4 on BADI :

Filter BADI

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 57

Interview Questions

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 58

What are the different types of enhancements/exits available??

Explain about each exit?

What are diff between user exits/customer exits/BADI’S?

What Is a project?

What is an enhancement?

What is a single implementation?

What is CMOD and SMOD?

How do you find exits for a TCODE? Explain?

What is a BADI?

Diff b/w exits and BADI?

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 59

What TCODES we use for BADI’S?

How do you find Implementations for a BADI?

How do you find BADI’S for a TCODE?

Can I use all BADI’S?

What are the diff types o BADI’S?

What is a filter badi?How can I find it?

Can I control the sequence execution of BADI’S?

How can I find multiple Imp BADI?

 SAP AG 2001, Smart Forms - the Form Printing Solution,


Claudia Binder / Jens Stumpe 60

You might also like