ABAP总结之十一,Enhancement(3)--User Exits
2008-07-29 08:02
471 查看
User Exits是SAP第一代增强技术,其技术原理就是在程序中预先置放一个Form...EndForm的子程序,并在事物运行时Call这个Form。当然,如果这个Form是空的,那么不执行任何操作,反之,执行相应的动作。User Exits的写法,和修改标准程序是一致的,要有向SAP申请Access Key才能对这些程序进行修改。与修改标程的区别在于,在SAP做升级的时候,User Exits会自动保留,标程的修改如果不做特殊处理,就会被覆盖。
在做这样的增强时,要养成一个习惯,那就是把你所要添加的代码都写在自己以Z开头的function中,然后在Form中调用这个function。
例如:
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L1S31 {
font-style: italic;
color: #808080;
}
.L1S33 {
color: #4DA619;
}
.L1S52 {
color: #0000FF;
}
FORM Add .
CALL FUNCTION 'ZGDTEST'
EXPORTING
I_CHAR =
I_FLOAT =
* IMPORTING
* E_DATE =
* E_CHAR =
* E_VAR =
.
ENDFORM.
下面来讲一下,如何找到此类出口:
方法1:
SPRO -> SAP Reference IMG,按
500)this.width=500;" border=0>,Search Term中填入’USER EXIT’就可以查到每个模块相应的出口了,每个出口SAP都会有相应的使用说明。
例子:
User Exits In Sales Document Processing
程序:MV45AFZZ
出口名:USEREXIT_SAVE_DOCUMENT
使用说明:
Use this user exit to fill user-specific statistics update tables.
The user exit is called up by the FORM routine BELEG-SICHERN before the COMMIT command.
Note
If a standard field is changed, the field r185d-dataloss is set to X. The system queries this indicator at the beginning of the safety routine. This is why this indicator must also be set during the maintenance of user-specific tables that are also to be saved.
方法二
进入你要做增强的那个screen,找到相应的程序名,例: va01以下屏幕的程序就是SAPMV45A
500)this.width=500;" border=0>
用T-CODE: SE38, 输入程序名SAPMV45A,进入,按下
500)this.width=500;" border=0>,屏幕左部出现以下对话框。
选择Subroutines进行扩展,那些以USEREXIT开头的routines就是我们要找的出口,这里可以很方便地找到USEREXIT_SAVE_DOCUMENT,和之前的方法效果是一样的。
500)this.width=500;" border=0>
相关文章推荐
- 【转载】ABAP总结之十一,Enhancement(3)--User Exits .
- ABAP总结之十一,Enhancement(4)--Customer Exits
- ABAP总结之十一,Enhancement(5)--Field Exits
- ABAP总结之十一,Enhancement(6)--BAdIs
- ABAP总结之十一,Enhancement(2)--Dictionary Elements
- ABAP总结之十一,Enhancement(1)--BTEs
- 用户出口(USER EXIT)总结
- SAP-SD-ABAP-VMOD 查找和应用SD模块用户出口(user exit) 好方法 .
- Enhancement--User exit documentation from SAP
- Enhancement--User exit documentation from SAP
- Enhancement--User exit documentation from SAP
- Enhancement(3)--User Exits {转载}
- Enhancement--User exit documentation from SAP
- SAP-SD-ABAP-VMOD 查找和应用SD模块用户出口(user exit) 好方法
- Enhancement--User exit documentation from SAP
- ABAP code to find all the User Exits and BADIs for any transaction
- 用户出口(USER EXIT)总结
- 用户出口(USER EXIT)总结
- linux设备驱动归纳总结(十一):写个简单的看门狗驱动
- 出现( linker command failed with exit code 1)错误总结