---
title: "REUSE_ALV_GRID_DISPLAY事件子过程和cl_gui_grid类的事件对应关系"
author: "e6621887"
date: "2010-12-29T11:14:07Z"
tags: ["HTML"]
categories: ["编程语言"]
slug: "reuse-alv-grid-display-cl-gui-grid"
draft: false
lastmod: "2010-12-29T11:14:33Z"
id: 854673
url: "https://e6621887.iteye.com/blog/854673"
---

**一、SLIS定义的ALV的事件名称**  
\* Events  
slis\_ev\_item\_data\_expand    type slis\_formname value 'ITEM\_DATA\_EXPAND',  
slis\_ev\_reprep\_sel\_modify  type slis\_formname value 'REPREP\_SEL\_MODIFY',  
slis\_ev\_caller\_exit\_at\_start  type slis\_formname value 'CALLER\_EXIT',  
slis\_ev\_user\_command        type slis\_formname value 'USER\_COMMAND',  
slis\_ev\_top\_of\_page         type slis\_formname value 'TOP\_OF\_PAGE',  
slis\_ev\_data\_changed        type slis\_formname value 'DATA\_CHANGED',  
slis\_ev\_top\_of\_coverpage    type slis\_formname value 'TOP\_OF\_COVERPAGE',  
slis\_ev\_end\_of\_coverpage    type slis\_formname value 'END\_OF\_COVERPAGE',  
slis\_ev\_foreign\_top\_of\_page  type slis\_formname value 'FOREIGN\_TOP\_OF\_PAGE',  
slis\_ev\_foreign\_end\_of\_page  type slis\_formname value 'FOREIGN\_END\_OF\_PAGE',  
slis\_ev\_pf\_status\_set       type slis\_formname value 'PF\_STATUS\_SET',  
slis\_ev\_list\_modify         type slis\_formname value 'LIST\_MODIFY',  
slis\_ev\_top\_of\_list         type slis\_formname value 'TOP\_OF\_LIST',  
slis\_ev\_end\_of\_page         type slis\_formname value 'END\_OF\_PAGE',  
slis\_ev\_end\_of\_list         type slis\_formname value 'END\_OF\_LIST',  
slis\_ev\_after\_line\_output   type slis\_formname value 'AFTER\_LINE\_OUTPUT',  
slis\_ev\_before\_line\_output  type slis\_formname value  'BEFORE\_LINE\_OUTPUT',  
slis\_ev\_subtotal\_text       type slis\_formname value  'SUBTOTAL\_TEXT',  
slis\_ev\_context\_menu        type slis\_formname value 'CONTEXT\_MENU'.

**二、和事件相关的函数**  
2.1 获取所有事件到内表  
  data  ct\_events type slis\_t\_event.  
  call function 'REUSE\_ALV\_EVENTS\_GET'  
    exporting  
      i\_list\_type     = 4  
    importing  
      et\_events       = ct\_events  
    exceptions  
      list\_type\_wrong = 1  
      others          = 2.  
注意： i\_list\_type值说明：  
0 = simple list                          REUSE\_ALV\_LIST\_DISPLAY  
1 = hierarchcal-sequential list          REUSE\_ALV\_HIERSEQ\_LIST\_DISPLAY  
2 = simple block list                    REUSE\_ALV\_BLOCK\_LIST\_APPEND  
3 = hierarchical-sequential block list   REUSE\_ALV\_BLOCK\_LIST\_HS\_APPEND  
4 ＝simple  grid   REUSE\_ALV\_GRID\_DISPLAY

2.2 获取所有事件名称  
REUSE\_ALV\_EVENT\_NAMES\_GET

**三、CL\_GUI\_ALV\_GRID的事件和 REUSE\_ALV\_GRID\_DISPLAY定义的子过程对应关系**

  CL\_GUI\_GRID's Event REUSE\_ALV\_GRID\_DISPLAY函数设置的用户定义子过程 end\_of\_list callback\_html\_end\_of\_list callback\_end\_of\_list print\_end\_of\_list callback\_end\_of\_list end\_of\_page callback\_end\_of\_page top\_of\_page callback\_html\_top\_of\_page callback\_top\_of\_page print\_top\_of\_page callback\_top\_of\_page user\_command  callback\_user\_command data\_changed callback\_data\_changed after\_user\_command callback\_user\_command(注意：根据函数设置先后触发CL\_GUI\_GRID的"TOP\_OF\_PAGE"和"END\_OF\_LIST"事件) before\_user\_command callback\_user\_command after\_refresh 无,系统根据选中设置grid的行选中处理  
call method gt\_grid-grid-&gt;set\_selected\_rows  
      exporting  
        it\_index\_rows = lt\_rows. double\_click callback\_user\_command hotspot\_click(同double\_click) callback\_user\_command subtotal\_text callback\_subtotal\_text context\_menu\_request callback\_context\_menu