User Exits和Customer Exits

User Exits和Customer Exits一 ExtensionofS 3withoutmodi 3 Standard Thustheseext

 

一、Extension of SAP functionality

SAP makes different possibilities available to extend SAP functionality in the R/3 without modifying the delivered R/3-Standard. Thus these extensions are further present also after a R/3-Release-Wechsel.

  • User exit
  • Field exit
  • Text extensions
  • Customer exit
  • Table extensions

1. User exit

User exits are original one in the selling module (SD) developed expandability.

They consist of empty subroutines (FORM) in special Includes, which can be filled by a ABAP Use developer. In special places in the SA P-CODE such subroutine references were inserted by SAP. An extension is thus only possible, where SAP planned it.

They usually offer a rather rudimentary expandability, since purely technically objects in the SAP name area are modified.

2. Field exit

Field exits are bypasses of a Dynprofield with data element purchase into a functional module. These will go through when leaving the Dynpros. There are global and local field exits.

3. Text extensions

With text extensions it acts around user keywords and user documentation (F1-Hilfe) to data elements. The new keywords can refer to SAP documentation and to user documentation. Thus one has also the possibility of overwriting the keywords delivered by SAP.

With text extensions the changes are global effective for all SAP applications concerned contrary to application extensions after activation.

4. Customer exit

An application function can be extended by application extensions by the customer. Customer exits must be intended by SAP. They consist generally of several components. The interface SAP/Kunde is clearly defined.

With a R/3-Release-Wechsel and/or. Upgrade remain the customer extensions without effort.

  • Function exit
  • Menu exit
  • Dynpro exit

A) Function exit

By functional module exits the customer can implement additional logic in an application function.

SAP built such exits in different places into many application functions. Thus are the interfaces are already given, and/or which data handed over.

These functional modules can be filled now by the customer. It can insert also user Dynpros with associated processing logic and GUI surface and put on user text elements.

B) Menu exit

Menu exits make it for the customer possible to build and occupy with a function code in an SAP application new menu entries.

SAP determined, where in the program additional function codes are queried and like to it is being reacted, either by a functional module exit or by an already firmly given functionality.

C) Dynpro exit

Dynpro exits permit the customer to arrange ranges of a dynpros reserved by SAP. Within these ranges large information can be indicated or data be seized. Those for this force fields by the customer on a user Dynpro are arranged.

 

 

 二、How to find user exits and Customer exits

 

1. How to find user exits

Using t-code: SE93 and specify the transaction code. from here goto the main program and click on the FIND button. Specify USEREXIT and select find in main program radio button and click search… if any user exit is used, it will list all the places as in SAP if any user exit is used, a comment is been written above the user exit.

 

2. How to find Customer exits

    1. 通过一些专门的程序. 网上找。

 

三、An example of a user exits and Customer Exits

1. An example of a user exits

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

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 routines will be displayed. You’ll have to roughly decide which is the correct userexit routine to used.

Another way of determining the list of user exits could be bus executing the Tcode SE80.

For example if U need to search for the user exits for the above mentioned program, execute the Tcode SE80 and enter the above program name, the following screen appears:

User Exits和Customer Exits

The highlighted row denotes a user exit, which is used in this program

                                                            Finding the user-exits of a SAP transaction code

*
* 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.
*
* Written by : SAP Basis, ABAP Programming and Other IMG Stuff
*
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

Validation Rules & Substitution User exits

Syntax:

=Uzzzz (zzzz = up to 4 characters – this is true for Document Level validations – call point 3 – *Header Level & Line Item Level – call points 1 & 2 – allow up to 30 charaters.)
/NORFB->Bus.transactions->Base parameters->Validation
/NORFB->Bus.transactions->Base parameters->Substitution

Example

User exits are form routines that the user programs. There are two types of user-exits:

1. Validation exits are used in the prerequisites and checks. They have either the value ‘T’ for true or ‘F’ for false. They are interpreted as a part of the logical statement, like a constant or field comparison. For this type of user exit, you must fill a parameter with the results of your check (‘T’ for true; ‘F’ for false).

Example

2. Substitution exits are used to change one or more fields. However, you can only change those fields that are permitted in the Boolean class for the substitution. You can display these fields by selecting the following menu options in substitution maintenance: Fields for substitutions>

Example

The name of the form pool (e.g., ZGGBR000 & ZGGBS000) that contains your user exit must be stored in table T80D.

Note

1. Data declaration

Tables and field stings cannot be declared in form routines, so that the contents can be used along with the calling transaction.

2. Parameter definition

You can find additional information on the creation of user exits in the online documentation on validations and substitutions.

SAP exits

SAP exits are form rountines programmed by SAP. The name of the form pool is SAPFGBEB.

Syntax:

Example

=S01 “SAP exit S01”

Display description of T80D configuration

Return ->

Change Validation: FI_ITEM (Message view)

 

2. An example of a Customer Exits

 

Example:

The program for transaction VA01 Create salesorder is SAPMV45A

The exit calls function module EXIT_SAPMV45A_003

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

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”

 

 

 

四、User Exits和Customer Exits区别

1. USER EXITS are FORMS and are called by SAP standard programs using PERFORM. CUSTOMER EXITS are FUNCTIONS so they are called using CALL FUNCTION (or more exactly CALL CUSTOMER FUNCTION). 2. Inside the form (user exit) you can read and change almost any global data from host program. Inside a function (customer exit) you can only acces your import/export/changing/tables parameters. 3. User exits are more flexible because you have more information to use in your code but on the other hand , it is very easy to manipulate erroneously global data and lead the standard program to a dump or even to make database inconsistent. Customer exits are more restrictive but you are sure any change you can make to any parameters will never lead to inconsistency 4. User-exit doesn’t have any classification. In customer-exit we have function-module exit , screen exit , menu exit. 5. User exits are Basically designed For SD module. Costomer exits Are available for MM,SD,FI,HR…..Basically designed for all modules.

 

1. USER EXITS 是以 FORM的形式存在,所以通过被SAP standard programs 通过 PERFORM调用.   CUSTOMER EXITS 以 FUNCTION module形式存在, 通过CALL CUSTOMER-FUNCTION语句调用.  

 2. 在user exit里你可以读写几乎所有的全局变量.    在customer exit里你只能访问import/export/changing/tables parameters.  

3. User exits 更加灵活(因为你可以获得更多的信息,例如所有的全局变量),但同时也很容易因为对数据的不合理处理导致系统级错误,甚至是数据库数据的一致性出现问题.

Customer exits 更具有限制性,但是你可以确性你的程序不会导致数据库一致性出现问题.  

4. User-exit 没有什么分类.     而customer-exit 可以分为function-module exit, screen exit, menu exit.  

5. User exits 基本上都是为SD模块设计的.       Customer exits被运用在MM, SD, FI, HR… 等几乎所有的模块当中.

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/231676.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • vue自定义组件封装_vue组件的双向绑定实现

    vue自定义组件封装_vue组件的双向绑定实现vue组件封装,vueelementui组件封装,vue图片上传,elementui图片上传

    2022年9月23日
    6
  • 查看sqlite_sqlite数据库手机版

    查看sqlite_sqlite数据库手机版这是什么用于SQLite的数据库浏览器(DB4S)是一种高质量,可视化的开源工具,用于创建,设计和编辑与SQLite兼容的数据库文件。DB4S适用于想要创建,搜索和编辑数据库的用户和开发人员。DB4S使用熟悉的类似电子表格的界面,并且不必学习复杂的SQL命令。控件和向导可供用户使用:创建并压缩数据库文件 创建,定义,修改和删除表 创建,定义和删除索引 浏览,编辑,添加和删除记录 搜索记录 导入和导出记录为文本 从CSV文件导入和导出表格 从/到SQL转储文件导入和导出数据库

    2025年10月11日
    3
  • CDatabase::ExecuteSQL()

    CDatabase::ExecuteSQL()CDatabase::ExecuteSQLCallthismemberfunctionwhenyouneedtoexecuteaSQLcommanddirectly.当你要直接执行SQL命令的时候就访问这个成员函数voidExecuteSQL(  LPCTSTRlpszSQL );lpszSQLPointertoanull

    2022年5月21日
    42
  • Java8新特性学习之二:lambda表达式深入学习

    Java8新特性学习之二:lambda表达式深入学习

    2021年8月3日
    69
  • THINKPHP框架的优秀开源系统推荐

    THINKPHP框架的优秀开源系统推荐

    2021年10月21日
    46
  • 第一讲 数域_域 数学

    第一讲 数域_域 数学1.引入数是数学的一个最基本概念,回顾一下我们曾经学习过的数的发展过程:(1)代数性质:关于数的加,减,乘,除等运算的性质称为数的代数性质.(2)数集:数的集合简称数集.常见的数集:复试C;实数R;有理数Q等等.它们有一个共同的性质就是对加减乘除运算封闭.2.数域的定义设F是由一些复数组成的集合,其中包括0和1,如果F中任意两个数的和,差,积,商(除数不为0)扔是F中的数,则称F为一个数域.从数域的定义可以看出一个数域要满足:为复数的子集;包含0

    2025年8月8日
    6

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号