ALV分类汇总

ALV分类汇总[@more@] REPORT ztest1.
None.gifTABLES:mara,mbew.
None.gifTYPE- POOLS:slis.
None.gifTYPES:BEGIN OF t_itab,
None.gif matnr LIKE mara- matnr,
None.gif ersda LIKE mara- ersda,
None.gif matkl LIKE mara- matkl,
None.gif lbkum LIKE mbew- lbkum,
None.gif salk3 LIKE mbew- salk3,
None.gif END OF t_itab.
None.gifDATA:itab TYPE TABLE OF t_itab WITH HEADER LINE.
None.gif
None.gifSELECTION- SCREEN BEGIN OF BLOCK blok WITH FRAME TITLE txt1.
None.gifSELECT-OPTIONS:matnr FOR mara- matnr.
None.gifSELECTION- SCREEN END OF BLOCK blok.
None.gif
None.gif
None.gifINITIALIZATION.
None.gif txt1 = '请输入选择条件' .
None.gif
None.gifSTART-OF- SELECTION.
None.gif
None.gifEND-OF- SELECTION.
None.gif PERFORM getdata.
None.gif PERFORM disalv.
None.gif*&---------------------------------------------------------------------*
None.gif *& Form getdata
None.gif*&---------------------------------------------------------------------*
None.gif * text
None.gif*----------------------------------------------------------------------*
None.gif * --&gt p1 text
None.gif* p2 text
None.gif*----------------------------------------------------------------------*
None.gifFORM getdata .
None.gif SELECT
None.gif mara ~ matnr
None.gif mara~ ersda
None.gif mara~ matkl
None.gif mbew~ lbkum
None.gif mbew~ salk3
None.gif INTO TABLE itab
None.gif FROM mara
None.gif JOIN mbew ON ( mara~matnr = mbew~matnr AND mbew~bwkey = '1000' )
None.gif WHERE mara~ matnr IN matnr
None.gif ORDER BY mara~ matnr
None.gif .
None.gifENDFORM. " getdata
None.gif *&---------------------------------------------------------------------*
None.gif *& Form disalv
None.gif*&---------------------------------------------------------------------*
None.gif * text
None.gif*----------------------------------------------------------------------*
None.gif * --&gt p1 text
None.gif* p2 text
None.gif*----------------------------------------------------------------------*
None.gifFORM disalv .
None.gif DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
None.gif is_variant LIKE disvariant,
None.gif it_events TYPE slis_t_event,
None.gif is_layout TYPE slis_layout_alv, "ALV的格式
None.gif i_list_comments TYPE slis_t_listheader,
None.gif i_callback_program TYPE sy- repid,
None.gif title TYPE lvc_title,
None.gif it_sort TYPE slis_t_sortinfo_alv
None.gif .
None.gif PERFORM fieldcat_init USING it_fieldcat."输出列表控件表头
None.gif * PERFORM layout_init USING is_layout.
None.gif* PERFORM eventtab_build USING it_events.
None.gif PERFORM e02_layout_sort_build CHANGING it_sort.
None.gif i_callback_program = sy- repid.
None.gif title = '测试' .
None.gif
None.gif CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
None.gif EXPORTING
None.gif i_callback_program = i_callback_program
None.gif i_grid_title = title
None.gif is_layout = is_layout
None.gif it_fieldcat = it_fieldcat
None.gif it_events = it_events
None.gif it_sort = it_sort[]
None.gif TABLES
None.gif t_outtab = itab
None.gif EXCEPTIONS
None.gif program_error = 1
None.gif OTHERS = 2 .
None.gif IF sy-subrc <> 0 .
None.gif ENDIF.
None.gif
None.gifENDFORM. " disalv
None.gif *&---------------------------------------------------------------------*
None.gif *& Form fieldcat_init
None.gif*&---------------------------------------------------------------------*
None.gif * text
None.gif*----------------------------------------------------------------------*
None.gif * --&gt P_IT_FIELDCAT text
None.gif*----------------------------------------------------------------------*
None.gifFORM fieldcat_init USING it_fieldcat TYPE slis_t_fieldcat_alv.
None.gif DATA: ls_fieldcat TYPE slis_fieldcat_alv.
None.gif
None.gif ls_fieldcat -fieldname = 'MATNR' .
None.gif ls_fieldcat-reptext_ddic = '物料号' .
None.gif ls_fieldcat-no_zero = 'X' .
None.gif APPEND ls_fieldcat TO it_fieldcat.
None.gif CLEAR ls_fieldcat.
None.gif
None.gif ls_fieldcat-fieldname = 'ERSDA' .
None.gif ls_fieldcat-reptext_ddic = '创建日期' .
None.gif APPEND ls_fieldcat TO it_fieldcat.
None.gif CLEAR ls_fieldcat.
None.gif
None.gif ls_fieldcat-fieldname = 'MATKL' .
None.gif ls_fieldcat-reptext_ddic = '物料组' .
None.gif APPEND ls_fieldcat TO it_fieldcat.
None.gif CLEAR ls_fieldcat.
None.gif
None.gif ls_fieldcat-fieldname = 'LBKUM' .
None.gif ls_fieldcat-reptext_ddic = '总评估的库存' .
None.gif ls_fieldcat-do_sum = 'X' .
None.gif APPEND ls_fieldcat TO it_fieldcat.
None.gif CLEAR ls_fieldcat.
None.gif
None.gif ls_fieldcat-fieldname = 'SALK3' .
None.gif ls_fieldcat-reptext_ddic = '估价的总库存价值' .
None.gif ls_fieldcat-do_sum = 'X' .
None.gif APPEND ls_fieldcat TO it_fieldcat.
None.gif CLEAR ls_fieldcat.
None.gifENDFORM. " fieldcat_init
None.gif *&---------------------------------------------------------------------*
None.gif *& Form e02_layout_sort_build
None.gif*&---------------------------------------------------------------------*
None.gif * text
None.gif*----------------------------------------------------------------------*
None.gif * P_IT_SORT text
None.gif*----------------------------------------------------------------------*
None.gifFORM e02_layout_sort_build CHANGING lt_sort TYPE slis_t_sortinfo_alv.
None.gif DATA ls_sort TYPE slis_sortinfo_alv.
None.gif *
None.gif CLEAR ls_sort.
None.gif ls_sort -fieldname = 'ERSDA'. "#EC *
None.gif ls_sort-spos = 1 .
None.gif ls_sort-up = 'X' .
None.gif ls_sort-subtot = 'X' .
None.gif APPEND ls_sort TO lt_sort.
None.gif
None.gif CLEAR ls_sort.
None.gif ls_sort-fieldname = 'MATKL'. "#EC *
None.gif ls_sort-spos = 1 .
None.gif ls_sort-up = 'X' .
None.gif ls_sort-subtot = 'X' .
None.gif APPEND ls_sort TO lt_sort.
None.gifENDFORM. " e02_layout_sort_build

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

转载于:http://blog.itpub.net/581999/viewspace-903756/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值