`

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.

 

分享到:
评论

相关推荐

    ABAP事件块详解资料.pdf

    ABAP事件块详解 ABAP是一种事件驱动语言,意味着外部事件控制着一般的ABAP程序流。事件块是ABAP程序的组成部分,它们被分配到特定的事件中,并在相应事件出现时启动。事件关键字提供了事件和程序之间的接口。 事件...

    sap ABAP 事件 event 的声明及调用

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

    《abap经典面试题》

    常用的ABAP事件包括INITIALIZATION、START-OF-SELECTION、TOP-OF-PAGE、AT LINE-SELECTION等。 6.ABAP报表开发 ABAP报表开发是指使用ABAP语言开发报表程序的过程。报表开发需要考虑报表的结构、报表的设计、报表的...

    SAP ABAP基本语法

    ABAP事件处理允许程序响应特定事件,如用户操作或后台触发的事件。`AT EVENT`用于定义事件处理代码。 13. **异常处理**: 使用`TRY-CATCH`结构处理程序中的异常,确保程序的健壮性,如`TRY. ... CATCH INTO DATA ...

    abap开发小规则和注意点

    17. ABAP 事件驱动机制:当你改变了屏幕之后,需要 MODIFY SCREEN,不然是无法改变的;先把各个事件写上,在分析具体代码写在那个事件下。 18. SUBMIT:直接执行程序,并且可以传送参数。 19. OPEN SQL 与 NATIVE ...

    ABAP报表的事件介绍

    ### ABAP报表的事件介绍与应用详解 #### ABAP程序类型概述 在深入探讨ABAP报表的事件前,我们先来了解一下ABAP中程序的基本类型,这对于理解事件的上下文至关重要。 1. **REPORT(报表)**:主要用于数据查询、...

    abap-ALV.rar_ABAP系统ALV_abap_abap开发alv

    标题“abap-ALV.rar_ABAP系统ALV_abap_abap开发alv”暗示我们将深入探讨ABAP ALV的使用,特别是在ABAP系统中的应用以及如何进行开发。 描述中提到“ABAP ALV总结,ALV格式,REUSE_ALV_GRID_DISPLAY_LVC函数使用”,...

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

    委托和事件是C#编程中的核心概念,它们在构建可扩展和反应式的应用程序中起着至关重要的作用。本文将深入探讨这两个概念,并通过实例代码来帮助理解。 首先,让我们了解什么是委托。在C#中,委托是一种类型,它类似...

    abap学习资料abap

    7. **屏幕编程**:讨论如何利用屏幕事件和用户接口元素进行用户交互界面的设计。 8. **报表程序**:深入理解REPORT语句,包括如何生成简单的到复杂的报表。 9. **函数模块**:介绍如何创建和使用函数模块,理解其...

    内含ABAP入门资源(11天学会ABAP)以级中级ABAP篇,高级ABAP资料

    - 事件处理:学习程序的启动、结束事件,以及用户输入、屏幕事件的处理。 - ABAP/4函数模块(Function Module):理解和使用预定义的函数模块,以及如何创建自己的函数模块。 3. **ABAP高级篇**: - 类与对象...

    abap语言开发之报表的事件

    ### ABAP语言开发之报表的事件 在ABAP (Advanced Business Application Programming) 开发中,了解不同类型的程序及其对应的事件是非常重要的。根据给定的信息,本文将详细介绍与**报表**(REPORT)相关的事件。 ###...

    abap 维护表视图

    在IT领域,ABAP(Advanced Business Application Programming)是SAP公司的一种编程语言,主要用于开发SAP R/3系统中的业务应用程序。在这个特定的话题“ABAP维护表视图”中,我们将深入探讨如何在ABAP环境中管理和...

    ABAP程序相互调用

    ABAP程序相互调用 ABAP程序相互调用是指在ABAP中,通过SUBMIT关键字实现程序之间的调用,这是一个非常有用的关键字。下面我们将详细介绍ABAP程序相互调用的方法和用法。 一、调用另一个程序 在ABAP中,我们可以...

    ABAP中文帮助文档

    ABAP(Advanced Business Application Programming)是SAP公司开发的一种编程语言,主要用于开发SAP系统中的业务应用程序。这个“ABAP中文帮助文档”包含了对ABAP基础、报表编写以及事务处理的详细指南,对于学习和...

    ABAP WorkBenchABAP WorkBench

    13. **ABAP Dictionary**: 除了数据字典,ABAP Dictionary还包含了业务对象、业务数据和业务事件的定义,这些构成了SAP应用的基础。 14. **ABAP Development Tools (ADT)**: ADT是基于Eclipse的现代ABAP开发环境,...

    30天学会ABAP很好的教程

    ABAP也引入了事件驱动编程,尤其是在Dialog编程中体现,虽然相对其他平台的事件驱动机制,ABAP的实现并不那么直观且难度较高。此外,ABAP还响应了面向对象编程的潮流,允许开发者定义类和创建新的对象,利用SAP...

    ABAP 工作流配置示例

    ### ABAP工作流配置示例详解 #### 一、引言 ABAP(Advanced Business Application Programming)是SAP系统的核心编程语言,广泛应用于SAP系统的定制开发与集成。本文将基于给定的“ABAP 工作流配置示例”,详细介绍...

    ABAP_实现F4帮助联动

    3. 在ABAP语言中,可以使用FORM事件来实现F4帮助联动功能。 4. 在实现F4帮助联动功能时,需要定义数据结构来存储搜索结果,并使用条件语句来过滤搜索结果。 5. 在SAP ABAP系统中,F4帮助联动功能可以提高用户的工作...

    ABAP考试试题

    "ABAP考试试题" ABAP是一种高级编程语言,主要用于SAP系统的开发。ABAP考试试题是为了验证开发人员对ABAP开发语言基本知识、语法等掌握情况,并对ABAP开发能力做验证。 以下是ABAP考试试题中的知识点: 1. 在ABAP...

    ABAP4简介___ABAP4简介

    Reports是ABAP4中用于生成数据列表的独立事件处理程序。它们根据不同的依赖事件来读取数据库,并呈现数据。在报告中,可以定义logical database,这允许更灵活的数据访问,同时进行数据计算和生成报表输出。 Dialog...

Global site tag (gtag.js) - Google Analytics