14 UserExits

You might also like

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

Modification &

Enhancements
Presented by

: M Suresh Kumar

2004 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice

Agenda
Introduction
User

Exits

Customer
Finding

Exits

Procedure
Demo
Q&A

Exits
to implement enhancement

Introduction-Enhancements and
Modifications

Modifications: These are changes to SAP objects that have


been made in customer systems. Modifications are:
executed with the help of user exits (these are subroutines
reserved for customers that have been inserted in objects in
the SAP namespace)
'hard-coded' at various points within SAP Repository objects.
Enhancements: The standard SAP programs call objects that
have been changed by customers. The changes
in ABAP programs (function module exits)
on GUI interfaces (menu exits)
on screens by inserting a subscreen in an area specified by
SAP (screen exits)
on screens by processing customer code that refers to a
specific field on the screen (field exits)
in ABAP Dictionary tables or structures (table enhancements)
Customer Development: These programs are developed by
customers that can call SAP Repository objects. Programs are
developed that call Function Modules.

User Exits

User

exits allow us to add our own


functionality to SAP standard program without
modifying it . These are implemented in the
form of subroutines and hence are also known
as FORM EXITs. The user exits are generally
collected in includes and attached to the
standard program by the SAP.
User exits are a type of system enhancement
that were originally developed for Sales and
Distribution Module (SD). The original purpose
of user exits was to allow the user to avoid
modification adjustment.
These subroutines which are called are already
implemented in the SAP standard program

SAP

creates special include in either a


module pool or a function group. These
includes contain one or more subroutines
routines that satisfy the naming convention

The

use of user exits are technically called


as modifications

Customer Exits
Overview
Field

Exits

Table

Exits

Function
Menu

Module Exits

Exits

Screen

Exits

Customer Exits: Overview

You can enhance programs in the following


areas:
in ABAP programs (function module exits)
on GUI interfaces (menu exits)
in screen flow logic
- by inserting a subscreen in an area specified by
SAP (screen exits)
SAP provides you with the following functions for
enhancing your system:
the ABAP statement CALL CUSTOMER-FUNCTION
special function codes for your interface
the statement CALL CUSTOMER-SUBSCREEN in
screen flow logic.
All program exits, menu exits, and screen exits
must be programmed in advance by an SAP
application programmer.

Implementing Customer Exits

Field Exits: SAP and the


Customer

You create field exits simply by storing function


modules for specific data elements in your system.

The field exits are managed, created, activated


through program RSMODPRF. The field exit is
associated with a data element existing in ABAP
dictionary and hence to the screen field using that
data element.

Field exit function modules adhere to the following


naming convention:

prefix:

FIELD_EXIT_

name:

<data element name>_

suffix (optional):

0 to 9, A to Z

The function module interface contains the import parameter


INPUT and the export parameter OUTPUT. You must assign a
value to the OUTPUT field in a function module's source code
in order to transport its field contents back to the SAP screen.
The following ABAP statements are not allowed in field exit
function modules:
BREAK-POINT
CALL SCREEN, CALL DIALOG, CALL TRANSACTION, SUBMIT
COMMIT WORK, ROLLBACK WORK
COMMUNICATION RECEIVE
EXIT FROM STEP-LOOP
MESSAGE I, MESSAGE W
external PERFORM
When you debug a screen that is referenced by a field exit,
the field exit code is ignored by the debugger. As with any
normal function module, you can, however, debug the field
exit code in the Function Builder's test environment just.

Table Exits

Append structures allow you to add fields


to a table without actually having to
modify the table itself.

Append structures may only be assigned


to a single table. A table may, however,
have several append structures attached
to it.

You can use append structures in ABAP


programs just as you would any other
structure.

Table enhancements using append


structures do not have to be planned by
SAP developers.

CI_includes allow you to use the same


structure in multiple tables.

Table enhancements using CI_includes do,


however, have to be planned by SAP
developers.

Text Enhancements
SAP

application programmers either use


existing data elements or define new ones,
then they document them and assign
keywords.

Customers

can add their own custom


documentation as text enhancements for
these data elements, or they can create
new documentation entirely.

Function Module Exits

These are used to add own functionality through


ABAP code .

These start from the word


EXIT_programname_NNN ending in a 3 digit
number. No access code is required to implement
any tupe of exit including function exits.

Each Function Module exit contains an include


where the custom source code is written.

The system processes your ABAP code for the


first time whenever the enhancement project (of
which your function module is a component) is
activated as a whole. Function module exits have
no effect prior to enhancement project activation.

Calling and Creating Function


Modules

ABAP statement CALL CUSTOMER-FUNCTION 'nnn' to call


function modules (where 'nnn' is a three-digit number). This
statement is coded in the SAP standard program

These function modules are always belong to function groups


whose names begin with X (X function groups).

The following naming convention applies to these function


modules:
prefix: EXIT
name of the program that calls the function module
suffix: three-digit number

The three parts of the name are separated by two underscores.

The CALL CUSTOMER-FUNCTION statement is not executed


until the corresponding enhancement project is activated.
Multiple calls of the same function module are all activated at
the same time.

Menu Exits

Menu exits allow you to add your own functions to


menu options. SAP application programmers
reserve certain menu entries in your GUI interface
for this. This allows you to define a text for the
reserved menu entry and add your own logic,
usually in the form of a related function module
exit.

Once you activate menu exits, they become visible


in the application. Whenever this menu option is
chosen, the system processes either a function
provided by SAP application programmers or your
own function that you have implemented in a
function module exit.

Menu Exit Requirements

In order for you to be able to implement


menu exits, SAP application programmers
must equip the GUI interface of your
application program with function codes
that begin with a plus sign ('+').

These function codes are inactive at first


and do not appear on the interface of the
program. They only become visible in the
program after you have activated them.

Menu and Function Module Exits

Customers can implement menu exits based on


reserved function codes. SAP application
programmers define these function codes, assign
them to menus, and often provide them with a
corresponding function module exit.

Menu exits and function module exits are both


part of the same SAP enhancement.

No pushbuttons may be assigned to additional


function codes.

Screen Exits

Screen exits allow you to layout reserved


sections of a main screen (subscreen
areas). You can either display additional
information in these areas or input data.

Subscreens in the R/3 System

Subscreens are rectangular areas on your


screen that are reserved for displaying
additional screens at runtime. Each
subscreen area can be filled with a
different screen (of type subscreen) at
runtime.

Calling Subscreens

Caution:

Function codes are only processed in the


main screen's flow logic!

You are not allowed enter a name for a


subscreen's command field!

You are not allowed to define GUI statuses


for subscreens!

No value for next screen may be entered


in a subscreen's flow control!

SAP applications programmers can reserve multiple


subscreen areas on a screen.

Subscreens are called from the flow control of a main screen


using the statement CALL CUSTOMER-SUBSCREEN. You are
not allowed to enter the name of a subscreen area in
quotation marks, but you must enter the name of the
function group that the called screen belongs to in single
quotes. You can keep the screen number a variable by using
fields; the number must, however, always contain four digits.

Screen exit calls are inactive at first, and are skipped when a
screen is processed.

Only after a corresponding subscreen has been created in an


enhancement project, and this project has been activated,
will the system process the screen exit.

Calling Customer Subscreens

Whenever the statement CALL CUSTOMERSUBSCREEN <area> INCLUDING <function


group> <screen number> occurs at PBO in
the flow control of a screen, a subscreen is
included in the subscreen area defined by
SAP application programmers. At this point,
all modules called during the PBO event of
the subscreen are also processed.

The PAI event of a subscreen is processed


when the calling screen calls the subscreen
during its PAI event using the statement
CALL CUSTOMER-SUBSCREEN <area>.

Customer Enhancement
Projects

SAP application programmers create SAP


enhancements in transaction SMOD using
function module exits, menu exits, and
screen exits.

Customers are given a catalog containing


an overview of existing SAP
enhancements. They can then combine
the SAP enhancements they want into an
enhancement project using transaction
CMOD.

SAP enhancements are made up of


component parts. These components include
function module exits, menu exits, and
screen exits. A specific component may be
used only once in a single SAP enhancement
(this guarantees the uniqueness of SAP
enhancements).

Customer enhancement projects consist of


SAP enhancements. Each individual SAP
enhancement may be used only once in a
single customer enhancement program (this
guarantees the uniqueness of a customer
project).

Finding Enhancements
Enter the package name of the program in Tcode SMOD
Look for source code Customer-Function in the relevant
program
These are the few ways of finding the exits.
Let us find the exits related to
MIRO

Transaction

Tcode - SMOD

Place

your cursor on Enhancement input


field and press F4.

Click

on Information System and enter


package name and press Enter.

To

find the package name execute Tcode


MIRO, choose menu System->Status.
Double click on the program(screen) name.

This

will take you to ABAP Editor screen.


Choose menu Goto->Attributes and you will
find the package

This displays all the exits


available for package MRM

Choose one of the exit,select


Components radiobutton and click
display

Here you can see all the Exits


related to enhancement

Creating Enhancement Projects


Execute

TCode CMOD

First, use the project management function


to choose the SAP enhancements that you
want and create an enhancement project.

Next, edit your individual components


using the project management function and
document the entire enhancement project.

Finally, activate the enhancement project


(this activates all of the project's
component parts).

Activation of an enhancement project affects


all of its components. After successful
activation, the project has the status active.

During activation, all programs, screens, and


menus containing components that belong to
the project are regenerated (programs at the
time they are executed). After activation, you
can see the enhancements in your application
functions.

The Deactivate function allows you to reset


an enhancement project's status to inactive.

DEMO

Q&A

Thank You

You might also like