




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Enhancement FrameworkPurposeABAP Workbench(Enhancement Framework)的新增强概念使得不同概念的集成成为可能,它们都可以实现修改和增强开发对象。增强的概念通过Enhancement Builder tool和ABAP language element来支持。Previous Concepts从长远来看,新的增强框架是为了取代或者合并已存在的增强和修改的概念。在Changing the SAP Standard (BC)有具体描述。之前的概念被分成修改和增强两部分。修改:改变已发布的开发对象,增强:在SAP预定义的点插入用户的开发。修改
2、:通过Modification Assistant来实现,并且支持系统升级。在4.6之前,增强只能通过Customer Exits实现。在4.6中,功能模块出口(customer exits for source code enhancements)被Business Add-Ins所取代。以前概念的不足之处:在一个传输路线中的不同系统中做的修改和增强并不真正的支持升级。例如,SAP,对于合作伙伴的附加,或者客户的开发。在并行的系统中做的开发很难被追溯到一个系统中。在有大量用户开发和修改的系统中,一旦升级,追溯和测试这些开发是极其耗时的。Features在SAP NetWeaver Appli
3、cation Server ABAP 7.0(SAP Net Weaver 7.0)中,新增强概念的目标是统一所有可能修改和增强SAP产品(准确的说,是SAP NetWeaver Application Server ABAP的仓库对象)的方式,这超出了定义的范畴。相应的工具是集成在ABAP Workbench中的Enhancement Builder。在新增强概念的背景下,以下都可以被看做增强来处理:修改仓库对象用指定的同等对象取代一个仓库对象在预定义的位置增强仓库对象使用外部的对象增强框架知道关于增强的所有必需的信息,例如,对于升级或者对于ABAP运行时环境。增强概念中的增强可以通过Swi
4、tch Framework来转换。这意味着,存放定义增强组件的包被分配给Switch Framework的一个switch时,增强才起作用,并且这个switch是处于非激活状态。Multilayer Support和修改相比,通过增强,可以在不同开发层次上使用增强,例如:1. 核心开发(core development)2. 应用开发(application development)3. 附加开发(add-on development)4. 客户开发(customer development)Tips: It is possible to create multiple enhancement
5、 implementations on different layers or to replace an enhancement implementation, but enhancements cannot be nestedConstraints当前的版本,增强概念只合并了在预定义位置(called enhancement options)对仓库对象的增强。See also:Enhancement ConceptEnhancement TechnologiesEnhancement Builder一、Enhancement Concept Use对于修改和增强开发对象,增强概念使得下面的
6、概念能够集成在一起。Enhancement options 仓库对象中,增强的位置 Enhancement spots 用来管理显式的enhancement options。 Enhancement implementations 管理enhancement options的增强实现,包括显式和隐式。当隐式enhancement options总是存在,并且不需要任何特殊的管理时,在最初的系统中创建的显式的enhancement options,必须通过enhancement spots让目标系统中的开发人员知道。相应地,在接下来的系统中,必须用enhancement implementati
7、ons来管理开发人员做的增强。这适用于所有的enhancement options,包括显式和隐式。下图是enhancement spots和enhancement implementation的概览:左图显式的是enhancement spots和个体关系的相关术语。它只适用于enhancement options。隐式enhancement options不需要enhancement spots。右图显式的是enhancement implementation和个体关系的相关术语。它适用于显式和隐式enhancement options的增强。Enhancement Options Def
8、initionEnhancement options是在仓库对象中可以做增强的位置。这些options要么是被(开发人员)显式定义的,要么是隐式存在的。显式Enhancement options一般是在主要的最初系统给中定义的。在后继的系统中做增强。Use当前,显式enhancement options可以通过以下来定义:Explicitly flagging ABAP程序中的源代码点或者块。对于一个增强,可以插入源代码来增强或取代它们。Including Business Add-Ins (BAdIs) in ABAP programs。用插入带有预定义接口的对象来增强这些程序。显式的增强选
9、项是通过enhancement spots来管理的,通过enhancement implementations实现增强。目前,隐式的enhancement options是: ABAP programs中特定的options例如在程序的结尾,这里可以插入源代码实现增强。 function modules的参数接口,可以用参数实现增强。 global classes的属性和参数接口,可以用属性和参数来实现增强。隐式enhancement options总是存在,并且不需要enhancement spots。他们也是通过enhancement implementation实现增强。Enhancem
10、ent Spots Definition增强点是用来管理显式增强选项的。增强点带有创建增强选项的位置信息,一个增强点可以管理一个仓库对象的多个增强选项。相反,多个增强点只能分配给一个增强选项。Use当使用相关工具处理一个仓库对象时,在可能的点,通过创建一个增强点元素定义,创建了一个显式的增强选项。通过增强点元素调用,可以在不同的点调用增强选项。增强点元素定义和相应的增强点元素调用组成了增强选项的定义。例如,当使用ABAP编辑器编辑一段ABAP程序时,可以使用ENHANCEMENT-POINT语句的形式来定义显式的增强选项,这既代表了元素定义,也代表了元素调用。每个增强点元素定义必须被分配给至少
11、一个增强点。因此,一个增强点元素定义被分配给了一个或多个简单的增强点,这些增强点又依次被分配给至少一个组合增强点。简单和组合增强点都是仓库对象,他们形成了一个树形结构,树叶表示简单的增强点,分枝表示组合的增强点。简单的增强点总是严格地被分配到一个增强技术(ABAP源代码增强或者BAdi)。组合增强点是用来进行简单增强点的语义分组。一个组合增强点包含一个或多个简单增强点,并且/或者包含一个或多个相关类型的组合增强点。可以使用组合增强点把简单增强点组合成有意义的单元。使用Enhancement Builder工具来处理增强点,它已经集成在了ABAP Workbench中。在一个系统中,Enhanc
12、ement Building中增强点的层级显示标示着,对开发人员而言,可能的增强(即:增强选项)。Enhancement Implementations Definitionenhancement implementations管理增强选项的增强实现,包括显式和隐式。同样地,关于增强点,我们区分增强选项和他们的管理;关于增强实现,我们也区分实际的增强和他们的管理。(The enhancement implementations manage the enhancements of the enhancement options, both explicitly and implicitly.I
13、n the same way that we differentiate between enhancement options and their management in the case of enhancement spots, we also differentiate between the actual enhancement and its management in the case of enhancement implementations.)Use通过分配一个或多个增强实现给一个确切的增强点元素定义的一个增强点,来实现对增强的管理。相反地,每个简单的增强实现严格地属于
14、一个增强点。一个简单的增强实现可以有一个或多个增强实现元素,这些元素被分配给增强点的增强点元素定义。一个简单的增强实现必须被分配个至少一个组合增强实现。(An enhancement is managed by assigning one or more simple enhancement implementations to an enhancement spot of a concrete enhancement spot element definition. Conversely, every simple enhancement implementation belongs to
15、exactly one enhancement spot. A simple enhancement implementation can have one or more enhancement implementation elements, which are assigned to the enhancement spot element definitions of the enhancement spot. A simple enhancement implementation must be assigned to at least one composite enhanceme
16、nt implementation:)Simple and composite enhancement implementations are Repository objects that form a tree-like structure, where the leaves and branches represent simple and composite enhancement implementations respectively.Therefore, to implement the actual enhancement, one or more enhancement im
17、plementation elements are assigned to an enhancement spot element definition of an explicit or implicit enhancement option.Tips:可以给增强选项(使用ENHANCEMENT-POINT定义)分配源代码插件(ABAP程序中ENHANCEMENT和ENDENHANCEMENT之间的定义)。如果开关是在相关的位置,这些源代码插件被插入到没有改变的代码中。使用集成在ABAP工作台中的Enhancement Builder工具,来处理增强的实现。在一个系统中,增强实现在Enhan
18、cement Builder中的层级显示了系统中作出的增强。增强实现描述了仓库对象在一个或者多个增强选项上的增强。一个增强实现元素总是属于一个增强选项。然而,几个增强实现元素可以被分配给一个增强选项。增强实现元素包含实际的增强。for example, a source code plug-in contains the source code to be added. However, an enhancement implementation element contains no information concerning at which positions of a Reposit
19、ory object the enhancement options were created. Composite enhancement implementations are used for the semantic grouping of simple enhancement implementations. A composite enhancement implementation contains either one or more simple enhancement implementations and/or one or more composite enhancem
20、ent implementations of the relevant type. You can use composite enhancement implementations to combine simple enhancement implementations into meaningful units.The position of a Switch Framework switch assigned to the package of an enhancement implementation specifies whether or not an enhancement i
21、s taken into account in a system.二、Enhancement Technologies UseThis section introduces the basic technologies you can use through the Enhancement Framework: ABAP Source Code Enhancements Function Module Enhancements Global Class Enhancements Business Add-Ins (BAdIs)For enhancing Web Dynpro ABAP see
22、Web Dynpro Enhancements.ABAP Source Code Enhancements UseAs part of the enhancement concept, it is possible to enhance ABAP source code, without modifications, using source code plug-ins.You can execute enhancements to implicit and explicit enhancement options. The Enhancement Builder tool for defin
23、ing explicit enhancement options and for implementing enhancements is integrated in the ABAP Editor.In the nomenclature of the enhancement concept, an enhancement option represents (in an ABAP source code) both the enhancement spot element definition, and the enhancement spot element call. A source
24、code plug-in, however, refers to an enhancement implementation element of a (simple) enhancement implementation.Source Code Plug-in TechnologyAlthough source code plug-ins are displayed in the same source code as the respective enhancement options, the plug-ins are actually stored in other include p
25、rograms managed by the Enhancement Builder:The following enhancement option types are available in a source code:ENHANCEMENT-POINT can either be static (for example, additional data declaration) or dynamic (for example, additional coding).1. ENHANCEMENT-SECTION can either be static (for example, rep
26、lace an existing data declaration) or dynamic (for example, replace coding).1. Overlay enhancement overwrite an existing enhancement instead of modifying it.Enhancement options and sections are hooks to which you can assign an enhancement. That is, you can enhance an option by an enhancement.Data de
27、clarations are always static, even if they are inside a dynamic enhancement option.Form routines, methods, and local classes cannot be part of dynamic enhancement options/sections. Therefore, it is necessary to place them into static enhancement options/sections.Static enhancement options/sections a
28、re marked with STATIC in coding. Dynamic enhancement options/sections do not contain an addition.Source Code Enhancements vs. ModificationsAdvantages of source code enhancements:1. no modifications;2. no object key is needed;3. are switchable by the switch framework;4. fewer upgrade effort.Disadvant
29、ages of source code enhancements:1. exist only at special source code lines (implicit, explicit).For more information about the usage of source code enhancements, see:Implicit Enhancement Options in ABAP Source CodesExplicit Enhancement Options in ABAP Source CodesCreating Source Code Plug-InsImplic
30、it Enhancement Options in ABAP Source Codes UseIn ABAP programs, implicit enhancement options are predefined at the following places: At the end of an include. There are some restrictions, for example, not at the end of a method include. At the end of a PUBLIC-, PROTECTED-, PRIVATE-SECTION of a clas
31、s. At the end of the implementation part of a class (before the ENDCLASS, which belongs to CLASS IMPLEMENTATION). At the end of an interface definition (before the ENDINTERFACE). At the end of a structure definition (before TYPES END OF, DATA END OF, CONSTANTS END OF, and STATICS END OF). At the beg
32、inning and at the end of a procedure (FORM, FUNCTION, METHOD). That is, after commands FORM, FUNCTION, and METHOD, and before statements ENDFORM, ENDFUNCTION, and ENDMETHOD. At the end of the CHANGING-, IMPORTING-, EXPORTING-parameter list of a method. These enhancement options are located in the mi
33、ddle of a statement.Implicit enhancement options always exist and no enhancement spot is assigned to them.ActivitiesThe implicit enhancement options can be displayed in the ABAP Editor by following the path: Edit Enhancement Operations Show Implicit Enhancement Options, and then enhanced using sourc
34、e code plug-ins.Explicit Enhancement Options in ABAP Source Codes UseIn ABAP programs, you can select either a position or a program section as an explicit enhancement option. Source code plug-ins for an enhancement are either entered at such a position or they replace the selected section.An explic
35、it enhancement option of an ABAP program is part of the program. It is thus assigned to the package of the program and not necessarily to the package of the enhancement spot to which it belongs.ActivitiesTo mark a position in an ABAP program as an explicit enhancement option, use the following ABAP
36、statement:ENHANCEMENT-POINT enh_id SPOTS spot1 spot2 .1. To mark a section in an ABAP program as an explicit enhancement option, use the following ABAP statement:ENHANCEMENT-SECTION enh_id SPOTS spot1 spot2 . . END-ENHANCEMENT-SECTION.Using enh_id, you define the name of the enhancement option or th
37、e source code enhancement. After SPOTS, the enhancement option must be assigned to at least one (simple) enhancement spot. For a detailed description of the statements, refer to the ABAP keyword documentation.An enhancement spot for source code enhancements is created using forward navigation from w
38、ithin the ABAP Editor. The statements can either be entered directly or generated by selecting Enhancements Create Enhancement.After the program has been saved, the enhancement option is managed by the Enhancement Builder, and can only be deleted using the function Enhancements Remove Enhancement.Du
39、ring program generation, the source code plug-ins that are in the current system for the assigned enhancement implementations and have the switch status stand-by or on, are included at this position or they replace the selected section.Creating Source Code Plug-Ins Procedure. 1. Call the Enhancement
40、 Builder from the ABAP Editor using forward navigation. 2. Create an enhancement implementation for an implicit or explicit enhancement option. For more information, see Creating an Enhancement Implementation.An empty source code plug-in is automatically created. It has a unique ID and is displayed
41、in the ABAP Editor below the enhancement option as follows: ENHANCEMENT id. . ENDENHANCEMENT. 3. Implement the enhancement between the ENHANCEMENT and ENDENHANCEMENT lines.A source code plug-in is assigned to exactly one enhancement option. An enhancement option can be enhanced through several sourc
42、e code plug-ins of an enhancement implementation and through several enhancement implementations.Although source code plug-ins are displayed in the same source code as the respective enhancement options, they are actually stored in other Include programs managed by the Enhancement Builder.Function M
43、odule Enhancements UseThe function module enhancements can be separated into: Source code enhancements Enhancements to the source code are carried out by means of ABAP source code enhancements. Parameter interface enhancements You can enhance the parameter interface of a function module with new, op
44、tional formal parameters as enhancement implementation elements. For more information, see Enhancing Parameter Interfaces.Enhancing Parameter Interfaces UseYou can enhance the parameter interface of a function module with new, optional formal parameters as enhancement implementation elements. Enhanc
45、ing by adding new exceptions is not possible.In the context of the enhancement concept, the parameter interface of a function module provides corresponding enhancement options.ProcedureTo implement an enhancement of the interface, use the Function Builder to call the Enhancement Builder:. 1. Choose
46、the tab of the parameter type for which you want to insert a formal parameter. 2. Choose Edit Enhancement Operations Enhance Interface for a function module.A dialog box appears. 3. Select an existing enhancement implementation or create a new one (see Creating an Enhancement Implementation).This ta
47、kes you to the enhancement mode of the Function Builder in which the original components of the function module are displayed and cannot be changed. 4. Insert the new formal parameter in the same way as when you create a function module. 5. Save and activate the function module.The new parameter can
48、 now be used at implicit and explicit enhancement options in enhancements to the source code of the function module. This can be done using ABAP source code enhancements.Enhancements to Global Classes and Interfaces UseThe enhancements to global classes and interfaces can be separated into: Enhancem
49、ents to the source code of methods, local classes, and so on these enhancements are carried out by means of ABAP Source Code Enhancements. Enhancements to components of classes and interfacesEnhancements to Components of Classes and InterfacesYou can enhance the components of a global class or globa
50、l interface by: Inserting new attributes Inserting new, optional formal parameters for existing methods (but no new exceptions) Adding the implementation of a pre and/or post method for an existing method of a class. A pre-method is called directly after the call of the existing method before the fi
51、rst statement. A post-method is called after the last statement of the existing method before ENDMETHOD (only if the method is exited using ENDMETHOD).The chain pre-method Method xyz post-method can be interrupted at runtime (parts are not executed) under the following circumstances:l If an exceptio
52、n is raised within the pre-method, the method xyz and the post-method will not be executed.l If statements like CHECK, RETURN, and so on are used within the method xyz that stop the execution of method xyz, the post-method will not be executed. Adding the implementation of an overwrite-method for an
53、 existing method of a class. The creation/deletion is similar to the pre or post methods. However, an overwrite method is executed instead of the original method. When an overwrite method is created, it is not allowed to have pre or post methods for the same original method. Inserting new methodsFor
54、 more information how to implement enhancements of classes and interfaces, see Enhancing the Components of Classes or Interfaces.Enhancing the Components of Classes or Interfaces UseUse this procedure to implement enhancements (pre, post, and overwrite methods) of global classes or interfaces.In the
55、 context of the enhancement concept, a global class or global interface provides corresponding implicit enhancement options.ProcedureTo implement an enhancement of global classes or interfaces, use the Class Builder to call the Enhancement Builder.Choose Edit Enhancement Operations Enhance Class/Int
56、erface for an existing class or interface.A dialog box appears.Select an existing enhancement implementation or create a new one (see Creating an Enhancement Implementation.)This takes you to the enhancement mode of the Class Builder in which the original components of the class or interface are dis
57、played and cannot be changed.Create your enhancements following the steps below:1. Create the new attributes in the same way as when you create a class or interface.2. Insert new, optional formal parameters in the same way as when you create a method.3. Insert or delete pre- and/or post-methods:1. Select the desired meth
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 视觉感知行业面临的机遇分析
- 山东省济宁市任城区2024-2025学年下学期期中质量检测六年级数学试题(含部分答案)
- 江苏省常州市2024-2025学年七年级下学期期末模拟练习英语试卷(含答案)
- 河北省保定市定州市2024-2025学年八年级下学期4月期中数学试题(含答案)
- 2024-2025学年四校联合教学质量检测高一地理
- 部编版三年级上册第三单元《去年的树》教案
- 建筑施工特种作业-建筑起重机械司机(塔式起重机)真题库-4
- 建筑施工特种作业-建筑起重机械安装拆卸工(施工升降机)真题库-2
- 入队教育考核题目及答案
- 2023-2024学年四川省泸州市江阳区高二下学期6月期末数学试题(解析版)
- DB37T 2906-2019 运动场地合成材料面层 验收要求
- DB34∕T 451-2017 地理标志产品 舒城小兰花
- 《卓有成效的管理者》Word电子版电子版本
- 三生事业六大价值
- 锆石基本特征及地质应用
- 丝网除沫器小计算
- 制钵机的设计(机械CAD图纸)
- 学校财务管理制度
- 三年级下册美术课件-第15课色彩拼贴画|湘美版(共11张PPT)
- 水稻病虫统防统治工作总结
- 水在不同温度下的折射率、粘度和介电常数
评论
0/150
提交评论