`
Jack Wu
  • 浏览: 887477 次
  • 来自: ...
社区版块
存档分类
最新评论

ABAP--关于SAP Control Framework(入门GUI编程的不错的基础介绍)

阅读更多

一、SAP Control Framework的架构

SAP Control Framework的架构分为客户端和应用服务器端,其中客户端包含重要的部件:“Automation Controller”,应用服务器端包含:“ABAP Objects Control Framework”;
Automation Controller的功能
1) The automation controller is the central instance at the frontend. It administers all instances of custom controls.
2) The Automation Controller also contains a list of the events that a custom control can trigger .
3) All communication between the controls at the frontend and the application program at the backend runs through the Automation Controller.

 

 

ABAP Objects Control Framework的功能
1) The ABAP Objects Control Framework has a similar function at the backend to that of the Automation Controller at the frontend. All method calls from an application program to a custom control run through the Control Framework. In order to avoid each method call establishing a separate connection to the frontend, the method calls are buffered in the automation queue. The automation queue is not sent to the frontend until you reach a synchronization point.
2) Like the Automation Controller, the Control Framework has a list of control events. This list also contains the corresponding handler methods that need to be called when the event occurs .
3) The Control Framework also maintains a list of the control instances you have created. This list is the basis for the lifetime management of controls

二、SAP Control Framework的事件类型
System events:
该事件发生时,不会发生自动对象的数据交换,不会触发PBO和PAI事件。
在该事件的处理过程里你可以通过set_new_ok_code 函数设置新值到OK_CODE,人为的触发PAI和PBO事件。

Application events:
该事件在PAI event处理完后会自动触发(这种情况下屏幕字段已经传输到程序变量),你也可以在PAI事件当中使用CL_GUI_CFW=>DISPATCH 来人为触发Application events事件的处理。

三、SAP Control Framework事件的交互图

先由控件触发事件,“Automation Controller”就会检查是否有该事件的注册,有就会向应用服务器提交,应用服务器就将由“ABAP Objects Control Framework”来检测事件的注册,找出对应处理过程并调用处理

四、SAP Control Framework的程序设计步骤
1)定义事件处理类
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS Event_Handler
   FOR EVENT event_name OF cl_gui_picture 
   IMPORTING event_parameter
             sender .
ENDCLASS.
2)事件类实现
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
CLASS-METHODS Event_Handler
        FOR EVENT event_name OF cl_gui_picture
        IMPORTING event_parameter
                  sender .
ENDCLASS.3) 定义自定义控件容器变量
DATA container TYPE REF TO cl_gui_custom_container.
4)定义自定义变量
DATA my_control  TYPE REF TO cl_gui_picture. 

5)定义事件内表变量
DATA events TYPE cntl_simple_events.
DATA wa_events TYPE  cntl_simple_event.
6)定义事件处理类的对象
DATA event_receiver TYPE REF TO lcl_event_receiver.
6)创建容器和控件
CREATE OBJECT container
    EXPORTING container_name = 'CUSTOM'
                            lifetime       = lifetime.

CREATE OBJECT my_control
     EXPORTING parent  = container 
              lifetime = lifetime.
7)创建事件处理类的对象
CREATE OBJECT event_receiver.
8)维护事件内表并注册事件
wa_events-eventid = event_id .
wa_events-appl_event = appl_event . “为X是表示应用类型事件,空表示系统类型事件
APPEND wa_events TO events.

CALL METHOD my_control->set_registered_events
            events = events.

9)设置事件处理过程
SET HANDLER event_receiver->Event_Handler
            FOR my_control.

五、SAP的GUI的类列表

CLASS NAME Super CLASS NAME DESCRIPTIO
CL_GUI_OBJECT   Proxy Class for a GUI Object
CL_FORMPAINTER_BASEWINDOW CL_GUI_OBJECT SAP Form Painter Window Base Class
CL_FORMPAINTER_BITMAPWINDOW CL_FORMPAINTER_BASEWINDOW SAP Form Painter Bitmap Window Class
CL_FORMPAINTER_TEXTWINDOW CL_FORMPAINTER_BASEWINDOW SAP Form Painter Text Window Class
CL_GUI_CONTROL CL_GUI_OBJECT Proxy Class for Control in GUI
CL_DSVAS_GUI_BUSIGRAPH CL_GUI_CONTROL DSVAS: Proxy for Business Graphic
CL_GFW_GP_PRES_CHART CL_GUI_CONTROL GFW: Product-specific section of CL_GUI_GP_PRES (Chart)
CL_GFW_GP_PRES_PIG CL_GUI_CONTROL GFW: product specific section for web view
CL_GFW_GP_PRES_SAP CL_GUI_CONTROL GFW: product-specific section of CL_GUI_GP_PRES (SAP BUSG)
CL_GUI_ALV_GRID_BASE CL_GUI_CONTROL Basis Class for ALV Grid
CL_CALENDAR_CONTROL_SCHEDULE CL_GUI_ALV_GRID_BASE Calendar View (Day, Week, Month)
CL_GUI_ALV_GRID CL_GUI_ALV_GRID_BASE ALV List Viewer
CL_ALV_DD_LISTBOX CL_GUI_ALV_GRID D&D List Box
CL_BUKF_CAT_GRID CL_GUI_ALV_GRID Key Figures - Grid of categories
CL_BUKF_DSRC_GRID CL_GUI_ALV_GRID Key Figures - Grid for Data sources
CL_BUKF_FILTER_GRID CL_GUI_ALV_GRID Key Figures - Filter for Key Figure
CL_BUKF_KF_GRID CL_GUI_ALV_GRID Key Figures - Grid for Key Figures
CL_BUKF_TERMS_GRID CL_GUI_ALV_GRID Key Figures - Grid for terms
CL_FTR_GUI_ENTRY_ALV CL_GUI_ALV_GRID Class: ALV Grid Control for Initial Screen (Without Toolbar)
CL_GFW_GP_GRID_ALV CL_GUI_ALV_GRID ALV grid proxy
CL_GUI_AQQGRAPHIC_ADAPT CL_GUI_CONTROL Network Adapter
CL_GUI_AQQGRAPHIC_CONTROL CL_GUI_CONTROL BW Basis Class Network Control
CL_GUI_AQQGRAPHIC_NETPLAN CL_GUI_AQQGRAPHIC_CONTROL Network Control
CL_GUI_BARCHART CL_GUI_CONTROL Bar chart wrapper
CL_GUI_BORDERPAINTER CL_GUI_CONTROL SAP Border Painter Control Proxy Class
CL_GUI_BTFEDITOR CL_GUI_CONTROL SAP BTF Editor Control Proxy Class
CL_GUI_CALENDAR CL_GUI_CONTROL Calendar Control Proxy Class
CL_GUI_CHART_ENGINE_WIN CL_GUI_CONTROL Graphics: Presentation Graphics (SAP GUI for Windows)
CL_GUI_CONTAINER CL_GUI_CONTROL Abstract Container for GUI Controls
CL_GUI_CONTAINER_INFO CL_GUI_CONTAINER Information on Container Controls
CL_GUI_CUSTOM_CONTAINER CL_GUI_CONTAINER Container for Custom Controls in the Screen Area
CL_GUI_DIALOGBOX_CONTAINER CL_GUI_CONTAINER Container for Custom Controls in the Screen Area
CL_ECL_VIEWER_FRAME CL_GUI_DIALOGBOX_CONTAINER Manage EAI Control in Own Window
CL_GUI_ECL_VIEWERBOX CL_GUI_DIALOGBOX_CONTAINER ECL Viewer as Dialog Box
CL_GUI_DOCKING_CONTAINER CL_GUI_CONTAINER Docking Control Container
CL_GUI_EASY_SPLITTER_CONTAINER CL_GUI_CONTAINER Reduced Version of Splitter Container Control
CL_EU_EASY_SPLITTER_CONTAINER CL_GUI_EASY_SPLITTER_CONTAINER Internal Test; Do Not Use
CL_GUI_GOS_CONTAINER CL_GUI_CONTAINER Generic Object Services Container
CL_GUI_SIMPLE_CONTAINER CL_GUI_CONTAINER Anonymous Container
CL_GUI_SPLITTER_CONTAINER CL_GUI_CONTAINER Splitter Control
CL_GUI_ECL_2DCOMPARE CL_GUI_CONTROL Compare Module for 2D Viewer
CL_GUI_ECL_3DCOMPARE CL_GUI_CONTROL Compare Module for 3D Viewer
CL_GUI_ECL_3DMEASUREMENT CL_GUI_CONTROL Measurement Module for 3D Viewer
CL_GUI_ECL_3DSECTIONING CL_GUI_CONTROL Sectioning Module for 3D Viewer
CL_GUI_ECL_MARKUP CL_GUI_CONTROL Markup (Redlining) Component
CL_GUI_ECL_PMI CL_GUI_CONTROL PMI Module for the 3D Viewer
CL_GUI_ECL_PRIMARYVIEWER CL_GUI_CONTROL Basis Class for ECL Viewers (2D und 3D)
CL_GUI_ECL_2DVIEWER CL_GUI_ECL_PRIMARYVIEWER Engineering Client 2D Viewer
CL_GUI_ECL_3DVIEWER CL_GUI_ECL_PRIMARYVIEWER Engineering Client 3D Viewer
CL_GUI_ECL_VIEWER CL_GUI_CONTROL Proxy Class for Engineering Client Viewer
CL_GUI_FORMPAINTER CL_GUI_CONTROL SAP Form Painter Control Proxy Class
CL_GUI_GLT CL_GUI_CONTROL Internal; Do Not Use!
CL_GUI_GP CL_GUI_CONTROL GFW: Superclass of all graphics proxies
CL_GUI_GP_GRID CL_GUI_GP GFW: Grid proxy
CL_GUI_GP_HIER CL_GUI_GP GFW: Structure graphics
CL_GUI_GP_PRES CL_GUI_GP GFW: Business graphic
CL_GUI_GRLT CL_GUI_CONTROL Internal; Do Not Use !! ( restricted license - see docu)
CL_GUI_HTML_EDITOR CL_GUI_CONTROL HTML Editor
CL_GUI_ILIDRAGNDROP_CONTROL CL_GUI_CONTROL Interactive List: Drag & Drop
CL_GUI_MOVIE CL_GUI_CONTROL SAP Movie Control
CL_GUI_NETCHART CL_GUI_CONTROL Network wrapper
CL_GFW_GP_HIER_SAP CL_GUI_NETCHART GFW: Product-specific section of CL_GUI_GP_HIER (NETZ)
CL_GUI_PDFVIEWER CL_GUI_CONTROL PDF Viewer
CL_GUI_PICTURE CL_GUI_CONTROL SAP Picture Control
CL_GFW_GP_PRES_WEB CL_GUI_PICTURE
分享到:
评论

相关推荐

    ABAP开发从入门到精通-高清自学版 SAP+ABAP开发从入门到精通 SAP开发自学必读 SAP SAP开发自学入门到精通

    总之,"ABAP开发从入门到精通"的学习路径是一个全面的过程,不仅要求掌握编程基础,还要熟悉SAP系统的架构和业务流程。这个过程可能会涉及大量的实践项目,以便更好地将理论知识应用于实际工作场景。如果你对SAP和...

    SAP中文教材全系列之ABAP-BC400_ZH

    总的来说,《SAP中文教材全系列之ABAP-BC400_ZH》是一套全面、系统地介绍SAP ABAP编程的教材,适用于SAP专业开发者和ABAP程序员的学习和参考。通过本系列教材的学习,开发者可以充分理解ABAP编程的原理和实践,为SAP...

    ABAP751 ABAP - Keyword Documentation

    ABAP - Keyword Documentation This documentation describes the syntax and meaning of the keywords of the ABAP language and its object-oriented part ABAP Objects. Alongside this, language frameworks ...

    SAP-ABAP 入门培训

    SAP-ABAP 入门培训 SAP-ABAP 入门培训 SAP-ABAP 入门培训

    sap BC412_ABAP_Dialog_Programming_Using_Enjoy_SAP_Control

    本课程旨在通过介绍SAP Control Framework(控制框架),使学员能够掌握如何在ABAP对话程序中使用Enjoy SAP Control进行开发。Enjoy SAP Control是一种基于Web的应用程序,它允许开发者在SAP GUI环境中集成图像、...

    SAP-ABAP-SAPLINK及插件

    简单来讲,SAPLINK就是用来导入和导出ABAP程序,等开发对象的一个开源分享项目的产物. 1.上载前置工具程序 导入SAPLINK需要使用ZSAPLINK_INSTALLER程序进行导入. TCode:SE38,新建名为ZSAPLINK_INSTALLER的程序. 2....

    实战SAP程序开发--从实例学SAP ABAP编程

    "实战SAP程序开发--从实例学SAP ABAP编程"这本书无疑为我们提供了一个深入学习和实践SAP ABAP的机会。 ABAP是SAP NetWeaver平台的核心部分,它允许开发者创建业务应用程序、报表、用户接口以及与其他系统的接口。...

    ABAP-ALV进阶

    ABAP-ALV进阶是指在SAP系统中使用ABAP语言开发的高级列表查看器(ALV)。ALV是SAP系统中心的列表标准,可以在ABAP程序中进行报表输出。下面是ABAP-ALV进阶的知识点详解: 一、ALV概要 ALV 全称为 ABAP List Viewer...

    SAP ABAP-采购申请释放后到更新发布标识.zip

    在SAP系统中,ABAP(Advanced Business Application Programming)是一种编程语言,用于开发和定制企业资源规划(ERP)软件,而MM(Materials Management)模块则是SAP中的一个重要部分,主要处理采购、库存管理和...

    SAP-ABAP-Certification-Review.pdf

    SAP-ABAP-Certification-Review.pdf

    SAP中文教材全系列之ABAP-BC401

    SAP ABAP-BC401是SAP ABAP(高级商业应用编程语言)的一部分,它是一种编程语言,专门为SAP软件应用开发。ABAP-BC401的内容覆盖了SAP ABAP开发的各个方面,旨在帮助读者深入掌握ABAP开发技能。从提供的文件内容来看...

    实战SAP程序开发——从实例学SAP ABAP编程

    本书《实战SAP程序开发——从实例学SAP ABAP编程》的前12章,深入浅出地介绍了SAP ABAP的基础知识和实战技巧。以下是根据章节标题和内容概要提取的相关知识点: 1. **第二章 创建HELLO WORLD程序**: - ABAP编程...

    SAP GUI770-9-70004692.zip

    在SAP GUI中,用户可以编写和运行ABAP(Advanced Business Application Programming)代码,这是一种专为SAP系统设计的编程语言。ABAP是SAP系统的核心,用于构建企业级应用,如报表、业务流程和接口。SAP GUI 770-9...

    ABAP-exercises:在SAP ABAP开发环境中进行编程

    ABAP-exercises:在SAP ABAP开发环境中进行编程

    SAP-ABAP-OO-实现-CL-SALV-TABLE

    ### SAP-ABAP-OO 实现 CL-SALV-TABLE 的关键知识点 #### 1. ABAP 面向对象的 ALV 显示方法 在 SAP 的 ABAP 环境中,ALV (Application List Viewer) 是一种非常常用的技术,用于在屏幕上以表格的形式展示数据。传统...

    sapabap开发从入门到精通

    资源名称:sap abap开发从入门到精通 内容简介: 《SAP ABAP开发从入门到精通》以应用实例的形式,讲解了SAPABAP开发的相关知识点,详细介绍了SAPABAP开发者必须掌握的包与变更传输系统(CTS)、数据类型、数据库...

    SAP资料集有ABAP-PP-MM-RFC-BAPI-JCO等.rar

    这个名为"SAP资料集有ABAP-PP-MM-RFC-BAPI-JCO等.rar"的压缩包文件包含了多个与SAP相关的学习资料,涵盖了许多关键模块和技术,包括ABAP编程、生产计划(PP)、物料管理(MM)、远程功能调用(RFC)、业务对象接口...

    eclipse-abap-keywordcolors-master.rar

    eclipse-abap-keywordcolors eclipse-abap-关键字颜色

Global site tag (gtag.js) - Google Analytics