Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

user exit

Former Member
0 Likes
519

Hello Experts,

What are types of user exit?Explain briefly?

Regards,

Rizwana

5 REPLIES 5
Read only

Former Member
0 Likes
449

In brief Userexits are places in the SAP standard code that are designed to insert code by the customer. It happens often that some values are set by default by SAP but are not appropriate for the business. In a user exit (or enhancement) you can correct this.

Let's say you are in a sales order and have dimension specified. Before saving, you need to determine the weight according to an own algorithm. Or you have your own credit check rules, so before saving you block the order when needed. This code could be found in a user-exit.

There are now four generations of userexits.

1. generation: these are FORM routines within the code, usually named "userexit…. " that can be filled with own code.

2. generation: these are special function calls that are invoked with "CALL CUSTOMER_FUNCTION"; they are defined with transaction SMOD and activated with CMOD.

3. generation: they are called BAdI -- Business Add-in -- and use ABAP dynamic classes instead function calls. They are handled via SE18/SE19 and normally placed in the code via a static method call to class CL_EXIT_HANDLER.

4. generation: there is a new concept announced for the NetWeaver 2004s that consolidates all userexits in a common framework.

<b>A short tutorial </b>

1. Introduction

2. How to find user exits

3. Using Project management of SAP Enhancements

1. Introduction:

User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.

The naming standard of function modules for functionmodule exits is:

EXIT_<program name><3 digit suffix>

The call to a functionmodule exit is implemented as:

CALL CUSTOMER.-FUNCTION ❤️ digit suffix>

Example:

The program for transaction VA01 Create salesorder is SAPMV45A

If you search for CALL CUSTOMER-FUNCTION i program

SAPMV45A you will find ( Among other user exits):

CALL CUSTOMER-FUNCTION '003'

exporting

xvbak = vbak

xvbuk = vbuk

xkomk = tkomk

importing

lvf_subrc = lvf_subrc

tables

xvbfa = xvbfa

xvbap = xvbap

xvbup = xvbup.

The exit calls function module EXIT_SAPMV45A_003

2. How to find user exits?

Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT

If you know the Exit name, go to transaction CMOD.

Choose menu Utillities->SAP Enhancements. Enter the exit name and press enter.

You will now come to a screen that shows the function module exits for the exit.

3. Using Project management of SAP Enhancements, we want to create a project to enahance trasnaction VA01 .

- Go to transaction CMOD

- Create a project called ZVA01

- Choose the Enhancement assign radio button and press the Change button

In the first column enter V45A0002 Predefine sold-to party in sales document.

Note that an enhancement can only be used in 1 project. If the enhancement is already in use, and error message will be displayed

Press Save

Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. Double click on the exit.

Now the function module is displayed. Double click on include ZXVVAU04 in the function module

Insert the following code into the include: E_KUNNR = '2155'.

Activate the include program. Go back to CMOD and activate the project.

Goto transaction VA01 and craete a salesorder.

Note that Sold-to-party now automatically is "2155"

<b>debugging user exits:</b>

http://sap.ittoolbox.com/documents/popular-q-and-a/debugging-a-user-exit-or-program-3022

list of user exits

http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html

http://www.planetsap.com/userexit_main_page.htm

regards,

srinivas

Read only

Former Member
0 Likes
449

Hi Rizwana,

The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications.

SAP creates user exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.

Types of Exits

There are several different types of user exits. Each of these exits acts as hooks where you can attach or "hang" your own add-ons.

Menu Exits

Menu exits add items to the pulldown menus in standard SAP applications. You can use these menu items to call up your own screens or to trigger entire add-on applications.

SAP creates menu exits by defining special menu items in the Menu Painter. These special entries have function codes that begin with "+" (a plus sign). You specify the menu item’s text when activating the item in an add-on project.

Screen Exits

Screen exits add fields to screens in R/3 applications. SAP creates screen exits by placing special subscreen areas on a standard R/3 screen and calling a customer subscreen from the standard screen’s flow logic.

Function Module Exits

Function module exits add functions to R/3 applications. Function module exits play a role in both menu and screen exits.

When you add a new menu item to a standard pull down menu, you use a function module exit to define the actions that should take place once your menu is activated.

Function module exits also control the data flow between standard programs and screen exit fields. SAP application developers create function module exits by writing calls to customer functions into the source code of standard R/3 programs.

These calls have the following syntax:

CALL CUSTOMER-FUNCTION ‘001’.

Field Exits

Field exits allow you to create your own programming logic for any data element in the Dictionary. You can use this logic to carry out checks, conversions, or business-related processing for any screen field. Example: The data element BBBNR identifies a company’s international location number. You might want to set up your R/3 System so that all international location numbers are larger than 100.

The field exit concept lets you create a special function module that contains this logic.

You assign the special function module to the data element BBBNR. You then assign the module to any programs and screens in which users can add new international location numbers. When you activate your field exit, the system automatically triggers your special routine whenever a user enters a company location number.

<b>Difference between Menu Exits & User Exits</b>

<b>User Exits:</b>

A user exit is a three character code that instructs the system to access a program during system processing.

SXX: S is for standard exits that are delivered by SAP. XX represents the 2-digit exit number.

UXX: U is for user exits that are defined by the user. XX represents the 2-digit exit number

<b>Menu Exits:</b>

Menu exits add items to the pulldown menus in standard SAP applications. You can use these menu items to call up your own screens or to trigger entire add-on applications.

SAP creates menu exits by defining special menu items in the Menu Painter. These special entries have function codes that begin with "+" (a plus sign). You specify the menu item’s text when activating the item in an add-on project.

http://help.sap.com/saphelp_nw04/helpdata/en/c8/1978b543b111d1896f0000e8322d00/frameset.htm.

http://www.utexas.edu/its/unix/reference/oracledocs/v92/B10501_01/appdev.920/a97269/pc_20exi.htm

<b>Reward Points if Useful</b>

Regards

Gokul

Read only

Former Member
0 Likes
449

hi

good

Userexits are places in the SAP standard code that are designed to insert code by the customer. It happens often that some values are set by default by SAP but are not appropriate for the business. In a user exit (or enhancement) you can correct this.

Let's say you are in a sales order and have dimension specified. Before saving, you need to determine the weight according to an own algorithm. Or you have your own credit check rules, so before saving you block the order when needed. This code could be found in a user-exit.

There are now four generations of userexits.

generation: these are FORM routines within the code, usually named "userexit…. " that can be filled with own code.

generation: these are special function calls that are invoked with "CALL CUSTOMER_FUNCTION"; they are defined with transaction SMOD and activated with CMOD.

generation: they are called BAdI -- Business Add-in -- and use ABAP dynamic classes instead function calls. They are handled via SE18/SE19 and normally placed in the code via a static method call to class CL_EXIT_HANDLER.

generation: there is a new concept announced for the NetWeaver 2004s that consolidates all userexits in a common framework.

thanks

mrutyun^

Read only

Former Member
0 Likes
449

Hi

<b>Introduction</b>

EXIT s are nothing but the R/3 Enhancements which allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications.

1)Purpose

2)Use

3)Challenges

<b>Purpose</b>

To introduce the techniques of enhancement in standard SAP system. SAP creates customer exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.

<b>Use</b>

They do not affect standard SAP source code.

When you add new functionality to your SAP System using SAP’s exits, you do not alter the source code of standard SAP programs in any way. The code and screens you create are encapsulated as separate objects. These customer objects are linked to standard applications, but exist separately from SAP’s standard software package.

They do not affect software updates.

When you add new functionality to your SAP System using SAP’s exits, your objects (called customer objects) must adhere to strict naming conventions. When it comes time to upgrade a to a new software release, customer objects’ names ensure that they will not be affected by any changes or new additions to the standard software package.

<b>Challenges</b>

Customer exits are not available for all programs and screens found in the SAP System.

<b>What are modifications?</b>

Any change made to an SAP object in a customer system is called a modification. Customers usually modify their systems for one of two reasons. Either they make changes to the SAP standard in order to adjust the R/3 System to their specific business needs (actual modifications), or they alter individual SAP objects in order to correct an error (as recommended in an SAP error note).

You should only modify the SAP standard if the modifications you want to make are absolutely necessary for optimizing work flow in your company. Be aware that good background knowledge of application structure and flow are important prerequisites for deciding what kind of modifications to make and how these modifications should be designed.

<b>ABAP DICTIONARY</b>

Table Enhancements: There are two ways that you can add additional fields to tables without modifying your system.

<u>Append Structures:</u>

Append structures allow you to enhance tables by adding fields to them that are not part of the standard. With append structures, customers can add their own fields to any table or structure they want.

Append structures are created for use with a specific table. However, a table can have multiple append structures assigned to it.

<u>Customizing Includes:</u>

If customers know in advance that one of the tables or structures delivered to them by SAP needs to have customer-specific fields added to it, an SAP application developer can include these fields in the table using a Customizing include statement.

The same Customizing include can be used in multiple tables or structures. This provides for consistency in these tables and structures whenever the itself include is altered.

Append structures allow you to attach 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. Whenever a table is activated, the system searches for all active append structures for that table and attaches them to the table. If an append structure is created or changed and then activated, the table it is assigned to is also activated, and all of the changes made to the append structure take effect in the table as well.

You can use append structures in ABAP programs just as you would any other structure.

Note: When you copy tables that have append structures attached to them, the fields that were found in the append structure of the original table become part of the actual body of the target table.

Some of the tables and structures delivered with the R/3 standard contain special include statements calling Customizing includes. These are often inserted in those standard tables that need to have customer-specific fields added to them.

In contrast to append structures, Customizing includes can be inserted into more than one table. This provides for data consistency throughout the tables and structures affected whenever the include is altered.

Customizing include programs are part of the customer namespace: all of their names begin with 'CI_'. This naming convention guarantees that nonexistent Customizing includes do not lead to errors. No code for Customizing includes is delivered with the R/3 standard.

You create Customizing includes using special Customizing transactions. Some are already part of SAP enhancements and can be created by using project management (see the unit on 'Enhancements using Customer Exits').

The Customizing include field names must lie in the customer namespace just like field names in append structures. These names must all begin with either 'YY' or 'ZZ'.

When adding the fields of a Customizing include to your database, adhere to same rules you would with append structures.

<b>Field Exits:</b>

Field exits take you from a screen field with a data element reference to a function module. Field exits can be either global or local.

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

Global field exits are not limited to a particular screen. If a global field exit's data element is used on multiple screens, you will branch to a function module from all of these screens once the exit has been activated. Here you can, for example, edit the contents, force a new entry to be made by outputting an error message, or prohibit certain users from proceeding further.

Local field exits are valid for one screen only. If you assign a screen from a specific program to the data element, then you will only branch to a function module from this screen once the exit has been activated. To be able to allow different functionality on different screens referring to the same data element, you can assign exit numbers to data elements. Each exit number refers to a different function module.

<b>Text Enhancements:</b>

Possible text enhancements include customer keywords and customer documentation of data elements.

Text enhancements differ from other application enhancements in that they take effect globally in all related SAP applications after activation (global enhancements).

Possible text enhancements include customer keywords and customer documentation of data elements.

Text enhancements differ from other application enhancements in that they take effect globally in all related SAP applications after activation (global enhancements).

Use the project management function to edit text enhancements.

Just as with field exits, use the menu entry Global enhancements to access the enhancement functions for keywords and data element documentation

SAP application programmers define keywords in different lengths and a short description for each data element. Use the project management function (transaction CMOD) to change these keywords and short texts.

All screen fields that use the keyword text of data elements can be renamed in this manner.

A new short text in a data element will show up in the F1 help of the screen field.

In order for keyword changes to take effect on a screen, SAP application programmers have to maintain the MOD attribute (keyword modification indicator) of the affected field accordingly in the Screen Painter field list.

The MOD attribute must have one of the following values:

SPACE: the keyword that best fits the field length 1: short keyword 2: medium keyword 3: long keyword 4: keyword for header V: variable text transfer from the ABAP Dictionary F: fixed, no text transfer

If the attribute contains an 'F', it is fixed on the screen and cannot be modified. In all other cases, screens that refer to that particular data element will show the changed keyword.

<b>Application enhancements</b> allow customers to enhance their application functions. Customer exits are preplanned by SAP and generally consist of several components.

Application enhancements are inactive when delivered and can be completed and activated by customers as they are needed.

Application enhancement characteristics:

Each enhancement provides you with a set of preplanned, precisely defined functions.

Each interface between SAP and customer functions is clearly defined.

As a customer, you do not need in-depth knowledge of how to implement SAP applications.

You do not need to adjust enhancements at upgrade because of new functions that SAP has developed.

<b>Customer Enhancement Projects</b>

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

SAP application programmers preplan function module exits, menu exits, and screen exits for their applications and combine them to create useful enhancements for the R/3 System.

Customers create their own enhancement projects for their systems using SAP enhancements. You can customize the individual components of an enhancement project by creating your own include programs (for function module exits), texts (for menu exits), and subscreens (for screen exits).

<b>Customer Exits</b>

1)Function Module Exits

2)Menu Exits

3)Screen Exits

<b>Function Module Exits</b>

Function module exits add functions to R/3 applications. Function module exits play a role in both menu and screen exits. When you add a new menu item to a standard pull down menu, you use a function module exit to define the actions that should take place once your menu is activated. Function module exits also control the data flow between standard programs and screen exit fields.

<b>Menu Exits</b>

Menu exits add items to the pull down menus in standard SAP applications. You can use these menu items to call up your own screens or to trigger entire add-on applications.

SAP creates menu exits by defining special menu items in the Menu Painter. These special entries have function codes that begin with "+" (a plus sign). You specify the menu item’s text when activating the item in an add-on project.

<b>Screen Exits</b>

Screen exits add fields to screens in R/3 applications. SAP creates screen exits by placing special sub screen areas on a standard R/3 screen and calling a customer sub screen from the standard screen’s flow logic.

<b>Implementation of Enhancement in Customer System</b>

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

Start the project management function (transaction CMOD) and give your enhancement project a name. SAP recommends that you think up a naming convention for all of your projects. You can, for example, include the project's transaction or module pool in its name. All enhancement project names must be unique. Next, branch to the project's attributes and enter a short text describing the enhancenent project. The system inserts all of the project's other attributes (such as created by, created on, or status).

<b>Assigning SAP Enhancement to customer projects</b>

Use the project management function (transaction CMOD) to assign SAP enhancements to customer enhancement projects. Enter the names of the SAP enhancements you want to use on the appropriate screen.

The search function gives you a catalog-like overview of existing SAP enhancements. From there you can select those enhancements that are of interest to you.

<b>Editing Components

Activating Enhancement Projects</b>

Use the product management function to edit the components of your enhancement project.

Depending on whether the component you are editing is a function module, a menu entry, or a subscreen, you branch to either the Function Builder, a dialog box for entering menu entries, or to the Screen Painter.

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.

Business Transaction Events

It is also called as Open FI enhancement technique which is based on the following principle:

Application developers must define their interface in a function module. An assignment table is read in the corresponding (generated) code, and the customer modules assigned are called dynamically.

This technique differentiates between enhancements that are only allowed to have one implementation and enhancements that can call multiple implementations in any sequence desired. Both industry-specific and country-specific enhancements may be defined.

<b>Enhancement Framework</b>

The new enhancement concept of the ABAP Workbench enables the integration of different concepts for modifying and enhancing development objects. The enhancement concept is supported by the Enhancement Builder tool and ABAP language elements.

The objective of the Enhancement Framework is to provide a technology to create modification-free enhancements and to unify all possible ways of modifying or enhancing Repository objects.

Multilayer Support

- In contrast to modifications with enhancements it becomes possible to have

enhancements on different development levels, e.g.

- Core development

- Application development

- Add on development

- Customer development

- It is possible to create multiple enhancement implementations on different layers or

to replace an enhancement implementation.

<b>Enhancement Spots</b>

Enhancement Spots can only be of type source code Enhancement or BAdI.

Enhancement Spots manage explicit Enhancement Options

While implicit enhancement options always exist and do not require any special management, explicit enhancement options created in an initial system must be made known to developers in target systems via Enhancement Spots.

<b>Enhancement Implementations</b>

Enhancement implementations manage their enhancements.

Enhancements made by developers in follow-on systems are managed as Enhancement Implementations. This applies to all enhancement options, both explicit and implicit.