ABAP--REUSE_ALV_GRID_DISPLAY的i_callback_user_command的调用跟踪摘抄

原创 2007年10月11日 15:01:00

1、跟踪调用关系列表

  主程序 类型 处理过程名 代码单元
1 ZHRR0005 EVENT END-OF-SELECTION    
2 SAPLSLVC_FULLSCREEN FUNCTION REUSE_ALV_GRID_DISPLAY   LSLVC_FULLSCREENU01
3 SAPLSLVC_FULLSCREEN MODULE (PAI) PAI   LSLVC_FULLSCREENI01
4 SAPLSLVC_FULLSCREEN Form PAI   LSLVC_FULLSCREENF01
5 CL_GUI_CFW METHOD DISPATH CL_GUI_CFW CL_GUI_CFW====================CM001
6 CL_GUI_ALV_GRID METHOD DISPATH CL_GUI_ALV_GRID  
7 SAPLSLVC_FULLSCREEN METHOD HANDLE_DOUBLE_CLICK LCL_EVENT_RECEIVER LSLVC_FULLSCREENTOP
8 SAPLSLVC_FULLSCREEN FORM METHOD_DOUBLE_CLICK   LSLVC_FULLSCREENF02
9 SAPLSLVC_FULLSCREEN FORM USER_COMMAND   LSLVC_FULLSCREENF01
10 ZHRR0005 FORM USER_COMMAND    

 2、各个函数代码摘抄(红色为断点处)
第2步代码摘抄
function reuse_alv_grid_display.                            "#EC *
.....
  if i_screen_start_column is initial and
     i_screen_start_line   is initial and
     i_screen_start_column   is initial and
     i_screen_end_line     is initial.
    gt_grid-flg_popup = space.
    call screen 500.
  else.
    gt_grid-flg_popup = 'X'.
    call screen 700
              starting at i_screen_start_column i_screen_start_line
              ending   at i_screen_end_column i_screen_end_line.
  endif.
.....
endfunction.

第3步代码摘抄
屏幕500
process after input.
  module pai.
module pai input.
 
perform pai.
endmodule.                             " PAI  INPUT

第4步代码摘抄
form pai.
.....
      when '&IC1'.
        if not gt_grid-s_layout-f2code is initial.
          perform method_double_click using l_okcode.
        endif.
      when others.
        if l_okcode(4) eq '%_GC'.
          call method cl_gui_cfw=>dispatch.
          l_okcode = g_temp_ok_code.    "via double_click
        else.
          perform user_command using l_okcode lflg_refresh lflg_exit
                                     ls_stable.
          if lflg_exit = 'X'.
            e_exit_caused_by_caller = 'X'.
            perform exit.
          else.
*           IF LFLG_REFRESH = 'X'.
            if not lflg_refresh is initial.
              if lflg_refresh = 'X'.
                call method gt_grid-grid->refresh_table_display
                  exporting
                    is_stable = ls_stable.
              elseif lflg_refresh = 'S'.
                call method gt_grid-grid->refresh_table_display
                  exporting
                    is_stable      = ls_stable
                    i_soft_refresh = 'X'.
              endif.
              if not gt_grid-i_callback_top_of_page is initial.
                call method gt_grid-grid->list_processing_events
                  exporting
                    i_event_name = 'TOP_OF_PAGE'
                    i_dyndoc_id  = gt_grid-top.
              endif.
              if not gt_grid-i_callback_end_of_list is initial.
                call method gt_grid-grid->list_processing_events
                  exporting
                    i_event_name = 'END_OF_LIST'
                    i_dyndoc_id  = gt_grid-bottom.
              endif.
            endif.
          endif.
        endif.
....
endform.

第5步代码摘抄(CL_GUI_CFW)
METHOD DISPATCH .
   if  IS_SHELLEVENT = 'X' and eventid = 15.
      call method handle_dragdrop_event
        exporting
           SHELLID           = MY_SHELL
           CARGO             = CARGO.
   else.
*   Notify object
    CALL METHOD CFW_SUBSCRIBER-REF->DISPATCH
      EXPORTING
        EVENTID           = EVENTID
        IS_SHELLEVENT     = IS_SHELLEVENT
        CARGO             = CARGO
        IS_SYSTEMDISPATCH = SPACE.
   endif.
   call method pop_event
         exporting current_event = l_event.
...
ENDMETHOD.

第6步代码摘抄(CL_GUI_ALV_GRID)
METHOD DISPATCH .
      call method cl_gui_cfw=>flush.
      append ls_row to lt_row.
        call method me->map_row_to_roid
          exporting
            it_index_rows = lt_row
          importing
            et_row_no     = lt_roid.
        read table lt_roid into ls_row_no index 1.

      read table m_cl_variant->mt_fieldcatalog into ls_fieldcat
                 with key fieldname = ls_col-fieldname.

      if sy-subrc eq 0.
        if not mr_trace is initial.
          call method mr_trace->add_trace_item
            exporting
              i_trace_item = 'EVENT: DOUBLE_CLICK'
              ir_variant   = m_cl_variant
              it_data      = mt_data
              it_info      = mt_info.
        endif.
        raise event double_click exporting e_row     = ls_row
                                           e_column  = ls_col
                                           es_row_no = ls_row_no.
...
ENDMETHOD.


第7步代码摘抄
  method handle_after_user_command.
    g_after = 'A'.
    perform event_exit_check using e_ucomm
                                   g_after.
    if g_after = 'X'.
      perform method_user_command using e_ucomm.
    endif.

    if not gt_grid-i_callback_top_of_page is initial.
      call method gt_grid-grid->list_processing_events
        EXPORTING
          i_event_name = 'TOP_OF_PAGE'
          i_dyndoc_id  = gt_grid-top.
    endif.
    if not gt_grid-i_callback_end_of_list is initial.
      call method gt_grid-grid->list_processing_events
        EXPORTING
          i_event_name = 'END_OF_LIST'
          i_dyndoc_id  = gt_grid-bottom.
    endif.

    clear g_after.
  endmethod.                    "handle_after_user_command
*
  method handle_data_changed.
    perform method_data_changed using er_data_changed.
  endmethod.                    "handle_data_changed
*
  method handle_top_of_page.
    perform method_top_of_page using e_dyndoc_id.
  endmethod.                    "handle_top_of_page

  method handle_end_of_page.
    perform method_end_of_page.
  endmethod.                    "handle_end_of_page

  method handle_double_click.
    perform method_double_click using g_temp_ok_code.
  endmethod.                    "handle_double_click

第8步代码摘抄
form method_double_click using r_ucomm type sy-ucomm.
  data: l_ucomm type sy-ucomm.
  data: l_save_ucomm   type sy-ucomm.
  data: lflg_refresh(1) type c.
  data: lflg_exit(1) type c.
  data: ls_stable type lvc_s_stbl.
*
  l_ucomm = gt_grid-s_layout-f2code.
  if l_ucomm(1) = '&'.
    call method gt_grid-grid->set_function_code
      changing
        c_ucomm = l_ucomm.
  else.
    if l_ucomm = space.
      l_ucomm = '&IC1'.
    endif.
    l_save_ucomm = l_ucomm.
    perform user_command using l_ucomm
                               lflg_refresh lflg_exit ls_stable.
    if l_ucomm ne l_save_ucomm.
      r_ucomm = l_ucomm.
    else.
      r_ucomm = space.
    endif.
    if lflg_exit = 'X'.
      e_exit_caused_by_caller = 'X'.
      perform exit.
    else.
      if lflg_refresh = 'X'.
        call method gt_grid-grid->refresh_table_display
          exporting
            is_stable = ls_stable.
      elseif lflg_refresh = 'S'.
        call method gt_grid-grid->refresh_table_display
          exporting
            is_stable      = ls_stable
            i_soft_refresh = 'X'.
      endif.
    endif.
  endif.
endform.                               " METHOD_DOUBLE_CLICK

第9步代码摘抄
form user_command using r_ucomm type sy-ucomm
                        r_refresh
                        r_exit
                        rs_stable type lvc_s_stbl.
  data: ls_selfield type slis_selfield.
*
  check not gt_grid-i_callback_user_command is initial.
  check not i_callback_program is initial.

  perform selfield_get using ls_selfield.
  if r_ucomm is initial.
    r_ucomm = '&IC1'.
  endif.

  perform (gt_grid-i_callback_user_command)
                                    in program (i_callback_program)
                                    using r_ucomm
                                          ls_selfield.

  rs_stable-row = ls_selfield-row_stable.
  rs_stable-col = ls_selfield-col_stable.

  r_refresh = ls_selfield-refresh.
  r_exit    = ls_selfield-exit.
endform.                    "user_command

版权声明:本文为博主原创文章,未经博主允许不得转载。

修改ALV 工具条,在ALV toolbar上添加、移除按钮

以下针对于FM:REUSE_ALV_GRID_DISPLAY的ALV,以添加一个按钮为例,修改OO ALV工具条的方式大致相同。 1、创建一个GUI status 首先在程序中创建一个工具条,一般是希...
  • champaignwolf
  • champaignwolf
  • 2015年07月29日 10:45
  • 3971

一个程序的ALV显示之后还可以进行数据操作。

这个也是简单的ALV的user_command的功能: ALV显示 里面设计好user_command 当点到里面的button,就触发form user_command using ucomm...
  • zzj_rainbow
  • zzj_rainbow
  • 2013年10月19日 21:00
  • 949

ABAP 给选择屏幕添加按钮

效果如图: CODE: REPORT Z_WUWEI_0009. TABLES SSCRFIELDS. SELECTION-SCREEN: ULINE /1(83...
  • szlaptop
  • szlaptop
  • 2013年01月10日 09:31
  • 5865

ALV中的回车事件相应及添加F4帮助

*===================================================================== *& Report ZPM_RP_01_TB *===...
  • liupengpeng1109
  • liupengpeng1109
  • 2015年12月17日 11:52
  • 1367

ABAP行转化为列(转)

来源:http://scnblogs.techweb.com.cn/laobai/archives/184.html 转换为: REPORT z_barry_test_fi...
  • zeewjj
  • zeewjj
  • 2012年09月11日 10:51
  • 2104

可编辑ALV的内表同步更新

本文所用ALV FUNCTION是REUSE_ALV_GRID_DISPLAY_LVC。该FUNCTION有一个USER_COMMAND参数,可以实现触发事件功能码判断,比如鼠标双击事件,点击保存按钮...
  • Raffin
  • Raffin
  • 2013年11月07日 14:40
  • 2971

如何在屏幕上显示多个alv

如何在屏幕上显示多个alv
  • champaignwolf
  • champaignwolf
  • 2015年06月24日 19:43
  • 2974

SAP ABAP ALV控制显示的网格中的每一个字段属性

字段目录是用来控制ALV显示的网格中每个字段的属性的,比如字段的顺序,对齐方式,可编辑状态,颜色,等等.常用的字段如下:         row_pos:默认值为0,可选值为1、2、3,既最...
  • hugh_Lee
  • hugh_Lee
  • 2016年11月03日 10:13
  • 2438

ABAP 屏幕容器ALV显示

抬头: ************************************OO ALV属性声明及定义*************** DATA: gcl_alv       TYPE REF ...
  • u012413770
  • u012413770
  • 2013年10月12日 09:36
  • 605

ABAP开发中ALV如何设置行/列/单元格的颜色

在ABAP开发过程中,有的时候,我们需要在 ALV 网格上绘上一些颜色.可以给特定的行,某个特定的列,某个特定的单元格绘制颜色. 如果某列被设置为关键列,这列的颜色将被自动绘制,而不需要我们额外的指...
  • wanglei880526
  • wanglei880526
  • 2015年03月07日 11:05
  • 2320
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:ABAP--REUSE_ALV_GRID_DISPLAY的i_callback_user_command的调用跟踪摘抄
举报原因:
原因补充:

(最多只允许输入30个字)