`

ABAP 事件

    博客分类:
  • abap
阅读更多
******************************************************

There will be different types of events in ABAP.

Events in Dialog Program
PBO - Process Before Output
PAI - Process After Input
POH - Process on Help
POV - Process on Value Request.

Events in Classical Report
INITIALIZATION
AT SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN
START-OF–SELECTION.
TOP OF PAGE
END OF PAGE
END-OF-SELECTION.

Control Break events related to Internal Tables
AT NEW FIELD
AT END OF FIELD
AT FIRST
AT LAST

Events in Interactive Report
AT USER-COMMAND.
AT LINE-SELECTION
AT PF-FUNCTION KEY

 

-------------------------------------------------------------

 

Events in an ABAP/4 Report Program
There is no mandatory event in a report program. Events are actually used to organize the statements and control the flow of the program. If the program contains no explicitly defined event blocks, all the statements in the program form the entire event block START-OF-SELECTION. ABAP runtime environment automatically introduces a START-OF-SELECTION at the first execution line.

ABAP/4 report programs are event driven programs. Following events are triggered in a report.

LOAD OF PROGRAM. - If propgram is of type 1, M, F, or S; then LOAD-OF-PROGRAM is trigerred first and then INITIALIZATION. The purpose of load of program is to load the program into system memory so that the program can be executed.

INITIALIZATION. - just once.

AT SELECTION-SCREEN OUTPUT. - when there is selection-screen

AT SELECTION-SCREEN. - when user interacts.

START-OF-SELECTION. - when F8.This is the default event in ABAP.

END-OF-SELECTION. - At the end

EVENTS IN A CLASSICAL REPORT:

1. INITIALIZATION: This is triggered when the report is loaded in memory.

2. AT SELECTION-SCREEN OUTPUT: This is triggered when the selection screen is loaded in memory before being displayed.

3. AT SELECTION-SCREEN/<field> : This event is triggered before leaving the selection screen.

4. START-OF-SELECTION: This is the the first and default event for displaying the report. Data retrieval logic is written under this event.

OUTPUT EVENT(5, 6):
5. TOP-OF-PAGE: This event is triggered every time a new page is started in the list.

6. END-OF-PAGE : This event is triggered every time the list data reaches the footer region of the page.

7. END-OF-SELECTION: This event is triggered after the START-OF-SELECTION is completed.
This event is used when there is use of logical data base in the report. It is triggered in type 1 programs once the logical database completes reading all data i.e. all the selection is finished and before the list processor is started. This statement tells the server that all the database reading is completed and no more data reading is going to take place. END-OF-SELECTION is generally used for the summary/results of reports. In an executable program without logical data base, there is no need to implement the event block END-OF-SELECTION.
After a program is executed by the user, the database is locked when it encounters a START-OF-SELECTION statement and the lock is released when an END-OF-SELECTION statement is encountered (to maintain the consistency). Data selection is done between START-OF-SELECTION and END-OF-SELECTION. Now if we don’t write the END-OF-SELECTION statement, the database will remain locked till the programs get terminated. Hence, the performance will be reduced. So it is always good practice to write END-OF-SELECTION statement after finishing the data selection from database.

EVENTS IN AN INTERACTIVE REPORT:

In addition of the above, the following events are possible in case of Interactive Reports.

1. Top of page during line selection : top of page event for secondary list.

2. At line-selection : evey time user dbl-clicks(F2) on the list data.

3. At pF<key> : function key from F5 to F12 to perform interactive action on the list.

4. At user-command.

==================================================

Finally I want to include one point:
If you debug your report program from the Abap editor screen then it triggers from
1.Initialization,
2.At Selection-screen,
3.Start-of Selection,
4.End-of Selection,
5.Top-of-page,
6.End-of-page.

But if you debug from the selection-screen then it triggers from
1.At Selection-Screen,
2.Start-of-selection,
3.Top-of-page,
4.End-of-page.

 

分享到:
评论

相关推荐

    sap ABAP 事件 event 的声明及调用

    sap中ABAP开发常用事件的定义及调用 文档展示了逻辑关系

    ABAP事件块详解资料.pdf

    ABAP事件块详解资料.pdf

    ABAP报表的事件介绍

    详细描述了ABAP报表的各种事件,及何时使用。

    委托事件实例讲解(附源码)

    委托事件实例讲解 委托事件实例讲解 委托事件实例讲解

    30天学会ABAP很好的教程

    程序员都知道Windows平台下开发都支持事件驱动,Windows系统本身也支持事件驱动,ABAP也提供了事件驱动,这表现在Dialog编程方面,但是ABAP在此方面并不强,而且相对讲也比较难于掌握(在后面会讨论). 5.基于面向对象的...

    ABAP 开发技巧

    报表中所用到的事件以及作用 SAP-ABAP SELECT-SCREEN 的几个用法 SAP中调用外部程序(RFC) ABAP 读EXCEL 到内表 ABAP总结之BDC完整版 ABAP的面向对象-class的定义 SAP ABAP程序优化方法 table_control中的小操作 ...

    abap tablecontrol 控件动态显示列

    abap tablecontrol 控件动态显示列

    abap语言开发之报表的事件

    首先介绍一下ABAP的程序的类型: Program type(程序类型)Introductory statement(类型描述) 1 REPORT(报表) M PROGRAM(屏幕程序) F FUNCTION-POOL(函数组) K CLASS-POOL(类组) J CLASS-POOL(接口组) T...

    ABAP程序相互调用

    ABAP程序相互调用例子及说明!如带select-options程序的Submit的用法和带parameters程序的Submit的用法等!

    SAP ABAP 官方用户指南电子版 (ABAP/4 用户指南 和SAP联机帮助中的一样)

    通过事件控制 ABAP/4 程序流 列表过程 提炼数据 创建列表 交互式列表 打印列表 报表的特殊 技术 程序的动态生成 逻辑数据库的特征和维护 Neither this documentation nor any part of it may be copied or ...

    在ALV里编写回车事件

    在ALV里编写回车事件,通过回车操作数据!

    ABAP-选择屏幕

    ABAP-选择屏幕 Dynpros 基础 通过这个屏幕实例可以了解屏幕元素的构成,及屏幕事件。

    SAP ABAP语法简明资料.doc

    呼叫一个独立的事件(Depending Event), 读取database 产生数据列表 3.Dialog 屏幕参数输入的对话框, 专门处理database 读取或异动的tranaction process Basic Languange Overview 1.data element 宣告方式, ...

    ABAP OO的八个理由

    1.ABAP OO具有更高层次的数据封装性 ...5.ABAP OO非常容易与事件驱动的模式结合在一块 6.ABAP OO更加明确所以更易于使用 7.ABAP OO具有更加清晰的语法和语义规则 8.ABAP的一些新技术只能通过ABAP OO来实现

    SAP abap4教材

    ABAP/4(Advanced Business Application Programming)是SAP/R3目前唯一的系统发展工具, 属 4GL, 语法比较近似Visual Basic或JAVA, 和传统third-generation 语言, 如C,PASCAL 有很大不同, 在程序模块(Program ...

    第007章 控制ABAP.doc

    时间事件和 ABAP/4 程序的连接 由事件关键 字提供。ABAP/4 程序中的每 个语句都属 于特别的事 件关键字。 即使在程序 中没有指定 任何事件关 键字,所有 语句都自动 归属于标准 事件关键字 (START-OF-SELECTION) ...

    ABAP用户指南-ABAP/4(Advanced Business Application Programming)是SAP/R3目前唯一的系統發展工具

    ABAP/4 Introduction Introduction ... 呼叫一個獨立的事件(Depending Event), 讀取database 產生資料列表 3.Dialog 螢幕參數輸入的對話框, 專門處理database 讀取或異動的tranaction process

    ABAP语法简明资料.doc

    ABAP/4(Advanced Business Application Programming)是SAP/R3目前唯一的系统发展工具, 属 4GL, 语法比较近似Visual Basic或JAVA, 和传统third-generation 语言, 如C,PASCAL 有很大不同, 在程序模块(Program ...

    abap中文帮助和编程入门

    ABAP/4(Advanced Business Application Programming)是SAP/R3目前唯一的系统发展工具, 属 4GL, 语法比较近似Visual Basic或JAVA, 和传统third-generation 语言, 如C,PASCAL 有很大不同, 在程序模块(Program ...

    ABAP面试大全

    ABAP面试大全 目录 1. 报表知识 6 1.1 基础知识 6 1.1.1 报表事件,有哪些? 6 1.1.2 报表选择画面 7 1.2 ALV报表 8 1.2.1 ALV报表实现的流程 8 1.2.2 显示ALV常用的两个FM 8 1.2.3 如何设置ALV中的热键 8 1.2.4 ...

Global site tag (gtag.js) - Google Analytics