ALV常用参数详细描述详解编程语言

调用功能模块:

 CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’

    EXPORTING

      i_interface_check        = ”                      接口一致性检查

      i_callback_program       = sy-repid                当前程序名

      is_layout                = layout                  输出样式

      it_fieldcat              = fieldcat[]              字段定义描述表

      i_callback_pf_status_set = ‘PF_STATUS_SET’         触发事件调用子程序

      i_callback_user_command = ‘USER_COMMAND’          鼠标事件操作子程序

      it_events                = i_events[]              出口程序触发事件

    i_callback_html_top_of_page = ‘ALV_TOP_OF_PAGE’   ALV输出表头设置

i_grid_settings = wl_lvc_s_glay                    打印表头设置

      it_sort = sortable[]                               排序设置

TABLES

      t_outtab                 = ig_out

EXCEPTIONS

 program_error            = 1

OTHERS                   = 2.

常用属性:(赋值’’中内容必须为大写)

1. Fieldcat

data: fieldcat type slis_t_fieldcat_alv with header line.

it_fieldcat              = fieldcat[]

属性 用来定义表单中的各个列的相关信息

   Fieldcat-col_pos = n.                  输出列

   Fieldcat-tabname = ‘FIELDNAME’.      对应的内表字段名

Fieldcat-seltext_s/m/l = ‘列名’.     输出列文本 _s:短文本 _l:长文本)

   Fieldcat-emphasize = ‘CX10’.    带有颜色的高亮列 (其中X=1-7 颜色同format

   Fieldcat-hotspot = ‘X’.           作为热点显示 可触发鼠标触发事件

   Fieldcat-currency = ‘CURRKEY’.    TCURX 中的货币名称

   Fieldcat-quantity(3)            计量单位

   Fieldcat-qfieldname          参考计量单位的字段名称

   Fieldcat-round = n.           四舍五入至小数位数下 n 

   Fieldcat-exponent = n.         浮点数的幂指数为n

   Fieldcat-key = ‘X’.           关键字段

   Fieldcat-icon = ‘X’.          作为图标输出

   Fieldcat-symbol = ‘X’.        输出作为符号

   Fieldcat-checkbox = ‘X’.      作为复选框输出

   Fieldcat-just = SPACE, ‘R’, ‘L’, ‘C’.   对齐方式

   Fieldcat-lzero = ‘X’.          输出前导零

   Fieldcat-no_sign = ‘X’.        输出抑制符号

   Fieldcat-no_zero = ‘X’.        为输出隐藏零

   Fieldcat-edit_mask = SPACE, mask..  输出为mask的模式

   Fieldcat-fix_column = ‘X’.      固定列

   Fieldcat-do_sum = ‘X’.        总计列值总和

   Fieldcat-no_out = ‘X’.         列不输出

   Fieldcat-tech = ‘X’.           该字段为技术字段

   Fieldcat-outputlen = n        列的字符宽度为n

   Fieldcat-decimals_out = n     能控制小数点的位数为

Fieldcat-datatype = C,I,N        定义数据类型

2. SORT

data: sortable type slis_t_sortinfo_alv with header line.

it_sort = sortable[]

属性 (排序)

   Sortable-Fieldname        字段名

             Up              升序排列

             Down            降序排列

             Subtot          

3. Layout

data: layout type slis_layout_alv .

is_layout                = layout

属性 (用于定义ALV表单的相关格式、属性)

        info_fieldname = ‘LINE_COLOR’. 设置特殊行颜色

(将LINE_COLOR增加到内表字段,写‘CX10’到特殊行的LINE_COLOR, X为颜色值)

        colwidth_optimize = ‘X’.   优化列宽设置

no_colhead = ‘X’.         不显示列名

no_vline = ‘X’.            不显示列间竖线

zebra      

        f2code = ‘&ETA’.    设置触发弹出详细信息窗口的功能码,这里是双击

no_vline           这个用来设置列间隔线

        detail_initial_lines   

detail_popup        是否弹出详细信息窗口

        detail_titlebar       设置弹出窗口的标题栏

        totals_text

        totals_only

        group_change_edit

        header_text

4按钮

   DATA: i_events TYPE slis_t_event WITH HEADER LINE.

事件:

it_events     = i_events[]   

i_callback_pf_status_set = ‘PF_STATUS_SET’   

i_callback_user_command = ‘USER_COMMAND’

出口程序触发事件对应子程序:

FORM PF_STATUS_SET USING rt_extab TYPE slis_t_extab.

FORM user_command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.  

功能代码:              函数文本:                          图标名称:

&ETA                   细节                        ICON_SELECT_DETAIL

&EB9                 调用报告…                     ICON_TABLE_SETTINGS

&REFRESH              刷新                        ICON_REFRESH

&ALL                 全部选择                      ICON_SELECT_ALL

&SAL                 取消全选                      ICON_DESELECT_ALL

&OUP                按升序排列                     ICON_SORT_UP

&ODN                按降序排列                     ICON_SORT_DOWN

&ILT                  设置过滤器                    ICON_FILTER

&UMC                  总计                         ICON_SUM

&SUM                  小计…                      ICON_INTERMEDIATE_SUM

&RNT_PREV           打印预览                      ICON_LAYOUT_CONTROL

&VEXCEL            Microsoft Excel                   ICON_XLS

&AQW                字处理…                       ICON_WORD_PROCESSING

%PC                   本地文件 …                   ICON_EXPORT

%SL                  邮件收件人                      ICON_MAIL

&ABC                 ABC 分析                      ICON_ABC

&GRAPH                图形                         ICON_GRAPHICS

&OL0                 更改布局…                      ICON_ALV_VARIANTS

&OAD                选择格式…                 ICON_ALV_VARIANT_CHOOSE

&AVE                 保存格式…                  ICON_ALV_VARIANT_SAVE

&INFO                  信息                      ICON_INFORMATION 

1. ALV表头设置

i_callback_html_top_of_page = ‘ALV_TOP_OF_PAGE’

form top_of_page using cl_dd type ref to cl_dd_document.

语法同HTML fomat  

原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/18354.html

(0)
上一篇 2021年7月19日
下一篇 2021年7月19日

相关推荐

发表回复

登录后才能评论