ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ALV函数 REUSE_ALV_GRID_DISPLAY

ALV函数 REUSE_ALV_GRID_DISPLAY

原创 Linux操作系统 作者:ytfsrs2008 时间:2009-02-14 09:31:00 0 删除 编辑
type-pools: slis.
data: fc_alv type slis_fieldcat_alv occurs 10 with header line.
data: alv_variant      like disvariant.
data: alv_layout       type slis_layout_alv.
data: alv_repid        like sy-repid.
data: alv_detail_func(30).
*-- 定义内表结构
data: begin of itab occurs 0,
       AUFNR LIKE AFKO-AUFNR,
       GSTRP LIKE AFKO-GSTRP,
       GAMNG LIKE AFKO-GAMNG,
  end of itab.

*- start of selection
  start-of-selection.
     perform. getdata_form.
     perform. write_alv_gr.
     perform. call_alv_for_list.

*------------------------------------------------------*
* form. write_alv_gr
*-------------------------------------------------------*
form. write_alv_gr.
   clear: fc_alv.
   refresh: fc_alv.
   perform. append_fc_alv using:
      'ITAB' 'WERKS'     'C'    '4'    'Plant',
      'ITAB' 'AUFNR'     'C'    '10'   'Order',
      'ITAB' 'GSTRP'     'D'    '8'    'Prd date'. 
   endform.
*------------------------------------------------------*
* form. append_fc_alv
*-------------------------------------------------------*
form. append_fc_alv using p_tabname p_fieldname p_inttype p_outputlen
                         p_seltext.
  move:
        p_fieldname     to fc_alv-fieldname ,
        p_outputlen     to fc_alv-outputlen ,
        p_seltext       to fc_alv-reptext_ddic.    " SELTEXT.

  append fc_alv. clear fc_alv.
endform.                    " append_fc_alv

*------------------------------------------------------*
* form. call_alv_for_list
*-------------------------------------------------------*
form. call_alv_for_list.
   data i_repid type sy-repid.
   i_repid = sy-repid.
   move: sy-repid to alv_variant-report.

   call function 'REUSE_ALV_GRID_DISPLAY'
   exporting
   i_callback_program                = i_repid
   it_fieldcat                       = fc_alv[]
   i_default                         = 'X'
   i_save                            = 'A'
  tables
    t_outtab                          = itab.

  if sy-subrc <> 0.
  endif.
  endform.


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15117617/viewspace-551896/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-10-31

  • 博文量
    52
  • 访问量
    51712