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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 大学项目总结(一)——基于Android的智能点餐系统

    大学项目总结(一)——基于Android的智能点餐系统这个项目是在我大一下学期开始进行制作,并一直到大一暑假结束完成。一共由我和另一个同学两个人完成,我主要负责前端功能,他主要负责后台下面是主要的图册:…

    2022年6月19日
    29
  • win10怎么更新显卡驱动_win10系统AMD显卡驱动安装失败的解决方法

    win10怎么更新显卡驱动_win10系统AMD显卡驱动安装失败的解决方法我们在操作win10系统电脑的时候,win10系统AMD显卡驱动安装失败的问题对于我们来说其实是比较少见的,一般情况下的正常使用都不会遇到win10系统AMD显卡驱动安装失败的状况。但在win10系统中如果由于我们个人的不当操作导致win10系统AMD显卡驱动安装失败问题出现的话,我们应该怎样去处理解决呢?其实解决这个问题的方法并不复杂,我们只需要1、开始按钮点右键选“设备管理器”,找到显示适…

    2022年6月5日
    126
  • BACnet协议_bip协议

    BACnet协议_bip协议一、什么是BACnet?BACnet,BuildingAutomationandControlnetworks的简称,即楼宇自动化与控制网络。是用于智能建筑的通信协议。一般楼宇自控设备从功

    2022年8月4日
    9
  • java帝国时代_new java project

    java帝国时代_new java project1.C语言帝国的统治现在是公元1995年,C语言帝国已经统治了我们20多年,实在是太久了。1972年,随着C语言的诞生和Unix的问世,帝国迅速建立统治,从北美到欧洲,从欧洲到亚洲,无数程序员臣服在他的脚下。帝国给我们提供了极好的福利:贴近硬件,运行极快,效率极高。使用这些福利,程序员们用C开发了很多系统级软件,操作系统,编译器,数据库,网络系统..

    2022年9月23日
    7
  • nginx服务器配置/websocket nginx 配置笔记

    nginx服务器配置/websocket nginx 配置笔记

    2021年10月14日
    49
  • ntp网络时间协议_ntp网络时间协议特性

    ntp网络时间协议_ntp网络时间协议特性NTP是网络时间协议(NetworkTimeProtocol),它是用来同步网络中各个计算机的时间的协议。  原理:NTP要提供准确的时间,就必须有准确的时间来源,那可以用格林尼治时间吗?答案是否定的。因为格林尼治时间是以地球自转为基础的时间计量系统,但是地球每天的自转是有些不规则的,而且正在缓慢加速,因此,格林尼治时间已经不再被作为标准时间使用。新的标准时间,是由原子钟报时的

    2022年10月12日
    2

发表回复

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

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