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

Customer Exits

Former Member
0 Likes
2,180

hi all

can anyone explain me about customer exits from scratch with example...can anyone send me the document about what is customer exit?why to use those?how to use it?

Regards

Asha

Hi

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.

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

Function Module Exits

Menu Exits

Screen Exits

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.

Menu Exits

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.

Screen Exits

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

<b>Creating Customer Enhancement Projects</b>

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.

<b>Business Transaction Events</b>

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.

6 REPLIES 6
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,028

use the search funcionality of SDN and SAPHelp...

Read only

Former Member
0 Likes
1,028

<b>Customer exit</b> - 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 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.

The following document is about exits in SAP :-

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.

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

<b>Screen Exits</b> 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.

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

<b>Field Exits</b> 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.

For example look at this link

Read only

Former Member
0 Likes
1,028

Hi

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.

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

Function Module Exits

Menu Exits

Screen Exits

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.

Menu Exits

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.

Screen Exits

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

<b>Creating Customer Enhancement Projects</b>

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.

<b>Business Transaction Events</b>

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.

Read only

0 Likes
1,028

hii naresh

can u tel me how to code it..since i am new to this concept..so can u xplain me clearly....

Rgds

Asha

Read only

Former Member
0 Likes
1,028

hi,

What is User Exits?

The following document is about exits in SAP :-

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.

In 4.6c, you can use "RSMODPRF" program to create field exits.

An example of a user exits :-

MODULE user_exit_0001 INPUT

CASE okcode.

WHEN 'BACK OR EXIT'.

CASE sy-dynnr.

WHEN '100'.

SET SCREEN 0.

LEAVE SCREEN.

WHEN '200'.

        • Note that you can write any code that satisfy your needs. ****

        • But in this case, this was wrote as a sample code for reference sake. ****

        • And you can test it. ****

SET SCREEN 100.

LEAVE SCREEN.

ENDCASE.

ENDCASE.

SAP User Exits Routine

User exits are routine which SAP allows you to add in additional customized programs process without affecting the standard SAP programs.

SAP user exit are usually declare as a form routine :-

form userexit_xxxxx

........................

endform

In VL01 - Create Delivery Order, standard program SAPMV50A, the standard program did not check for storage location equal to space, and delivery quantity less than one when the user click the save button. Therefore I have to insert the additional checking into the userexit routine.

Steps:-

• Goto transaction VL01 to pick a Sales Order for delivery (you don't have to save the data)

• In the initial screen, click System -> Status -> Double click on Program (Screen)

• In the dialog program SAPMV50A, click Edit -> Search/replace

• Type userexit in the Find field, then click the In program radio button and hit Enter

• A number of userexit routine will be display. You'll have to roughly decide which is the correct userexit routine to used.

form userexit_save_document_prepare.

case xlips-pstyv.

when 'TAX' or 'REX'.

  • Accept this two Delivery item category

when 'REN'.

if xlips-lgort = space.

  • Reject this Delivery item category

message e001.

endif.

when others.

if xlips-matnr <> space.

  • Check storage location not space

if xlips-lgort = space.

message e002.

endif.

  • Check delivery quantity not zero

if xlips-pikmg < 1.

message e003.

endif.

endif.

endcase.

endform.

*

  • Finding the user-exits of a SAP transaction code

*

  • Enter the transaction code in which you are looking for the user-exit

  • and it will list you the list of user-exits in the transaction code.

  • Also a drill down is possible which will help you to branch to SMOD.

*

*

report zuserexit no standard page heading.

tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.

tables : tstct.

data : jtab like tadir occurs 0 with header line.

data : field1(30).

data : v_devclass like tadir-devclass.

parameters : p_tcode like tstc-tcode obligatory.

select single * from tstc where tcode eq p_tcode.

if sy-subrc eq 0.

select single * from tadir where pgmid = 'R3TR'

and object = 'PROG'

and obj_name = tstc-pgmna.

move : tadir-devclass to v_devclass.

if sy-subrc ne 0.

select single * from trdir where name = tstc-pgmna.

if trdir-subc eq 'F'.

select single * from tfdir where pname = tstc-pgmna.

select single * from enlfdir where funcname =

tfdir-funcname.

select single * from tadir where pgmid = 'R3TR'

and object = 'FUGR'

and obj_name eq enlfdir-area.

move : tadir-devclass to v_devclass.

endif.

endif.

select * from tadir into table jtab

where pgmid = 'R3TR'

and object = 'SMOD'

and devclass = v_devclass.

select single * from tstct where sprsl eq sy-langu and

tcode eq p_tcode.

format color col_positive intensified off.

write:/(19) 'Transaction Code - ',

20(20) p_tcode,

45(50) tstct-ttext.

skip.

if not jtab[] is initial.

write:/(95) sy-uline.

format color col_heading intensified on.

write:/1 sy-vline,

2 'Exit Name',

21 sy-vline ,

22 'Description',

95 sy-vline.

write:/(95) sy-uline.

loop at jtab.

select single * from modsapt

where sprsl = sy-langu and

name = jtab-obj_name.

format color col_normal intensified off.

write:/1 sy-vline,

2 jtab-obj_name hotspot on,

21 sy-vline ,

22 modsapt-modtext,

95 sy-vline.

endloop.

write:/(95) sy-uline.

describe table jtab.

skip.

format color col_total intensified on.

write:/ 'No of Exits:' , sy-tfill.

else.

format color col_negative intensified on.

write:/(95) 'No User Exit exists'.

endif.

else.

format color col_negative intensified on.

write:/(95) 'Transaction Code Does Not Exist'.

endif.

at line-selection.

get cursor field field1.

check field1(4) eq 'JTAB'.

set parameter id 'MON' field sy-lisel+1(10).

call transaction 'SMOD' and skip first screen.

*---End of Program

REPORT YVENKATESH_PRINT_SMOD_DOC

NO STANDARD PAGE HEADING

LINE-SIZE 80

LINE-COUNT 65

MESSAGE-ID ZM.

----


  • Tables/Views *

----


TABLES: MODSAP, "SAP Extensions

DOKTL. "Documentation - text lines

----


  • Data Statements for Internal Tables *

----


  • Ampliaciones SAP

DATA: ITAB_MOD LIKE MODSAP OCCURS 0 WITH HEADER LINE.

  • Documentacion - Lineas de texto

DATA: ITAB_DOKTL LIKE DOKTL OCCURS 0 WITH HEADER LINE.

----


  • Selection-screen *

----


SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME.

SELECT-OPTIONS: S_NAME FOR MODSAP-NAME.

PARAMETERS: P_DOWNLD AS CHECKBOX.

selection-screen end of block blk1.

----


  • Initialization *

----


INITIALIZATION.

REFRESH: ITAB_MOD.

----


  • Start-of-selection *

----


START-OF-SELECTION.

  • Select the modifications into the internal table

SELECT * INTO TABLE ITAB_MOD

FROM MODSAP

WHERE NAME IN S_NAME

AND ( TYP = SPACE OR TYP = 'E' ).

  • Sort the internal table

SORT ITAB_MOD.

  • For each of the modifications, get the documentation

LOOP AT ITAB_MOD.

AT NEW NAME.

NEW-LINE.

ULINE.

WRITE: 'Enhancement:' COLOR 5 INVERSE,

ITAB_MOD-NAME COLOR 5.

WRITE AT 60 SY-PAGNO.

ULINE.

SKIP.

DOKTL-OBJECT = ITAB_MOD-NAME.

PERFORM 1000_GET_DOCUMENTATION USING DOKTL-OBJECT.

ENDAT. "AT NEW name.

CHECK ITAB_MOD-MEMBER > SPACE.

SKIP.

NEW-LINE.

WRITE: 'Enhancement:' COLOR 5 INVERSE,

ITAB_MOD-NAME COLOR 5.

WRITE: 'Component:' COLOR 4 INVERSE,

ITAB_MOD-MEMBER COLOR 4.

SKIP.

DOKTL-OBJECT = ITAB_MOD-MEMBER.

PERFORM 1000_GET_DOCUMENTATION USING DOKTL-OBJECT.

AT END OF NAME.

SKIP 2.

ENDAT. "AT END OF name.

ENDLOOP. "LOOP AT itab_mod.

  • Download the list

IF NOT P_DOWNLD IS INITIAL.

CALL FUNCTION 'LIST_DOWNLOAD'

EXPORTING

LIST_INDEX = 0

METHOD = ' '.

ENDIF. "IF NOT p_downld IS INITIAL.

&----


*& Form 1000_GET_DOCUMENTATION

&----


  • text

----


  • -->P_DOKTL_OBJECT text

----


FORM 1000_GET_DOCUMENTATION USING P_DOKTL_OBJECT.

  • Refresh the documentation table

CLEAR ITAB_DOKTL.

REFRESH ITAB_DOKTL.

  • Select the data

SELECT * INTO TABLE ITAB_DOKTL

FROM DOKTL

WHERE ID = 'MO'

AND OBJECT = P_DOKTL_OBJECT

AND LANGU = SY-LANGU.

IF SY-SUBRC = 0.

LOOP AT ITAB_DOKTL.

NEW-LINE.

WRITE: ITAB_DOKTL-DOKTEXT.

ENDLOOP. "LOOP AT itab_doktl.

ELSE. "IF sy-subrc = 0.

NEW-LINE.

WRITE: 'No documentation exists' COLOR 6 INVERSE.

ENDIF. "IF sy-subrc = 0.

ENDFORM. " 1000_GET_DOCUMENTATION

• OVERVIEW by SAP:

Enhancements

This transaction consists of various components (including function exits, menu options and subscreens). For example, an SAP enhancement may comprise a subscreen and the function exits for data transfer. Customers simply select the components they wish to edit, combine them together in enhancement projects, edit the components and activate the projects.

Creating a project

First, you must give the project a name. In order to be able to locate projects easily, you are recommended to choose names which contain the name of the transaction or module pool. When you press the function key Create, you go to an attributes screen where you can enter a short description of the project. If you choose a project name that already exists, you get an error message. If you enter * as the project name, you get a list of all projects created so far. When you save with F11, you have to enter a correction number (see Corrections/Transport).

Assigning SAP enhancements to a project

On the initial screen, select SAP enhancements and then Change (or Goto -> Components on the attributes screen). On the next screen, you can specify SAP enhancements by name. By selecting SAP enhancements -> Find enhancements (and, if required, after restricting selection in the next dialog box, or with components), you can display a list of existing SAP enhancements you want to include in the project. When you choose enhancements from this list to assign to a project, they cannot be used by other projects.

Editing enhancement components

To edit SAP enhancement components, select Enhancement components and then Change. If you place the cursor on a function exit, you go into the ABAP/4 Editor where you can enter the appropriate code. If the cursor is on a menu enhancement, you can change the menu text. If it is on a screen enhancement and you press the Edit component key, you can create and design the screen (subscreen) you want to include. To find out what you can do with each component, refer to the SAP documentation.

When editing function exits and screen enhancements, you should be aware of the following:

Although you can create screens, text elements and such like for the main program SAPLXyyy, you cannot change the program itself, since it is created by SAP. The program contains the includes LXyyyTOP, LXyyyUXX, LXyyyUnn and LXyyyXXX, which also cannot be modified, as well as the include ZXyyyZZZ, which is created and edited by the customer. The includes LXyyyTOP and LXyyyUnn contain the includes ZXyyyTOP and ZXyyyUnn; these are also created and edited by the customer and do not exist for SAP. Since you have to define the message ID in the FUNCTION-POOL statement in the include LXyyyTOP, you must specify it when outputting a message:

MESSAGE E000(ID).

The include LXyyyUnn contains the function exit source code, which you can only display. It also contains the include ZXyyyUnn. If you double-click on the include name, you can display the source code of ZXyyyUnn and then use a pushbutton to switch to change mode and enter code. Of course, you can edit these includes "directly" using Transaction SE38. Since they appear within a function modules, they cannot contain events (subroutines, modules...).

If you want to define global data, the include LXyyyTOP contains the include ZXyyyTOP, which you can use to make data declarations. When you create global data while navigating through the transaction, it is automatically defined in the include ZXyyyTOP. You may require global data when editing the screen areas: if the function exit interfaces for data transfer are not global, then the fields required must firstly be copied to global fields, in order to make them known to the complete function group.

When creating your own includes, ensure that you observe the naming convention properly (the first 5 characters are ZXyyy) and that you store them in the include ZXyyyXXX, not in the main program SAPLXyyy. This is automatic if you are navigating through the transaction.

Sometimes example code from SAP is included with function modules. If desired, this can be incorporated into the include ZXyyyUnn belonging to the function module using CMOD (Change enhancement components --> move cursor to function module --> function ???). If this file already contains customer code, the SAP code is added at the end of the file. The function group can also contain subroutines written by SAP, which can be called if required. The customer cannot make changes to these subroutines. Refer to the SAP documentation for information on whether example code or subroutines exist, and how they may be used.

In the case of screen areas, note that when the relevant screen is created the screen type "subscreen" is selected in the screen attributes.

Since a project is generally inactive during editing, the SAP transactions affected are not changed.

Activating a project

When you activate a project, all its components are activated and the project status is set to "active". At the same time, all the programs, screens and menu interfaces associated with the project are regenerated (in the case of programs, only when they are started). When you start the enhanced transactions, you see the enhancements. If you use the Deactivate function to reverse activation of a project, the status is reset to "inactive". If the (de)activation process terminates, the project status does not change but may contain both active and inactive components. To restore the project to a consistent state, restart the (de)activation process.

Corrections/transports

When you create/change a project, you must create a correction. This correction contains only the attributes and the SAP enhancements associated with a project, as well as a program that is automatically started with the transport and activates the project in the target system. Corrections for individual components are created only when you edit the relevant component. This allows several users to edit different components from the same project at the same time without the use of a network. Since activating a project affects all components, you should transport all components associated with a project at the same time, in other words with the same transport request. To ensure that the project is activated automatically in the target system, the correction that contains the program concerned must also be in the same transport request. If this is not the case, or the project has not been activated in the target system for other reaons, you can also activate it by manually starting the program (RSMODACT).

Additional Information on User Exit

USER EXIT (SAP Enhancement)

________________________________________

User exit is a functionality provided by SAP to add custom validation or enhancements to existing SAP transaction. Every module pool has customer function FORM in PBO and PAI. This form is basically a function that has an INCLUDE object, for eg. INCLUDE ZXPADU01. User can include enhancements or source code, that will be triggered during execution of this transaction.

For eg. all HR infotype program (module pool) starts with the name MPnnnnnn. So infotype 0001 module pool name will be MP000000. Search for string 'customer_function' and you will find two FORM under each module pool. PERFORM customer_function_pbo(sapfp50m) and PERFORM customer_function_pai(sapfp50m). Place your cursor on 'customer_function' and double click. It will take you to 'FORM customer_function_pbo'. In this form you should see a CALL CUSTOMER-FUNCTION '001' function module. Double click on '001' and you can see SAP has provided an INCLUDE object, for eg. INCLUDE ZXPADU01. You can add your logic in this object ZXPADU01 and at runtime when you enter data in the respective infotype for eg. 0000, the validation included in the object will be executed.

Execute transaction CMOD to define Project that contains User Exit.

Here is an example of HR Benefit USER EXIT:

Enter Project name, for eg. ZBEN0003, select option 'Enhancement assignment' and enter for eg. PBEN0003 (name of SAP enhancement object). Click on 'Components' button and the screen will display 'EXIT_SAPLHRBEN00FEATURE_003'. Double click on this object and it will take you to FUNCTION EXIT_SAPLHRBEN00FEATURE_003. There will be an INCLUDE object starting with name 'Z' in this function module that you can update with your custom logic.

regds,

paras

Read only

Former Member
0 Likes
1,028

Hi Asha,

SAP has developed various modules with standards, but the requirements of customers differ from place to place.

SAP allows you to add your own functionality to SAP ’s standard business applications without having to modify the original applications.

There is 4 ways of Changing the SAP System to fit your needs

1) Customer Development

2) Customizing

3) Enhancement ( Changing of SAP Repository objects by Customer without affecting / modifying )

4) Modification

and there is 4 ways to Enhancement to your SAP System to fit your needs

User Exit

Customer Exit

BAdI (Business Add-In)

Enhancement Framework ( Latest tool )

and ‘Customer-Exit’ is better than the user-exit, in the sense that it is implemented using Function Modules and so has a well defined parameter interface.But now a day Enhancement Framework is use and user friendly.

Reward if its useful.