zoukankan      html  css  js  c++  java
  • 如何给表维护视图创建选择画面[VIEW_RANGETAB_TO_SELLIST]

    通常SAP系统中的表维护视图(sm30)把所有数据都显示在一个屏幕上,没有筛选,如下,左图是sm30,右图是SE11中的表数据显示。

    abap-selection-screen-tmg-1_thumb

    如何要按条件进行筛选,要用到VIEW_RANGETAB_TO_SELLIST创建筛选条件内表,

    b

    例子程序如下:

    简单介绍:

    1, 先创建一个选择画面包含3个range ,s_id,s_name, s_place,

    2, 调用VIEW_RANGETAB_TO_SELLIST创建sm30的筛选条件内表gt_seltab,三个条件之间是and关系。

    3, 调用VIEW_MAINTENANCE_CALL显示表维护视图

    REPORT ZTEST_SM30.
    TABLES: zemployee.
    CONSTANTS: c_view  TYPE   char30  VALUE 'ZEMPLOYEE',
               c_u     TYPE   char1   VALUE 'U',
               c_and   TYPE   char3   VALUE 'AND'.
    DATA: gt_seltab    TYPE STANDARD TABLE OF vimsellist.
    DATA: g_fieldname  TYPE vimsellist-viewfield.
    DATA: gt_exclude   TYPE TABLE OF vimexclfun,
          gwa_exclude  TYPE vimexclfun.
    
    SELECT-OPTIONS: s_id    FOR zemployee-id,
                    s_name  FOR zemployee-name,
                    s_place FOR zemployee-place.
    
    *Add ID column to selection criteria of Table maintenanace view
    g_fieldname = 'ID'.
    
    CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'
      EXPORTING
        fieldname          = g_fieldname
        append_conjunction = c_and
      TABLES
        sellist            = gt_seltab
        rangetab           = s_id.
    
    *Add Name column to selection criteria of Table maintenanace view
    g_fieldname = 'NAME'.
    
    CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'
      EXPORTING
        fieldname          = g_fieldname
        append_conjunction = c_and
      TABLES
        sellist            = gt_seltab
        rangetab           = s_name.
    
    *Add Place column to selection criteria of Table maintenanace view
    g_fieldname = 'PLACE'.
    
    CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'
      EXPORTING
        fieldname          = g_fieldname
        append_conjunction = c_and
      TABLES
        sellist            = gt_seltab
        rangetab           = s_place.
    
    * Call to the 'VIEW_MAINTENANCE_CALL' function module
    CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
      EXPORTING
        action         = c_u
        view_name      = c_view
      TABLES
        dba_sellist    = gt_seltab.

    运行结果:

    选择画面输入筛选条件LONDON,

    abap-selection-screen-tmg-2_thumb

    表维护视图只显示LONDON的数据。

    abap-selection-screen-tmg-3_thumb

    以上。

  • 相关阅读:
    Basic INFO InstallShield的版本区分
    月光博客 从软件保护到软件授权
    Basic INFO InstallShield Professional for AdminStudio版本中如何打开InstallScript工程类型
    Basic INFO InstallScript脚本编程的限制
    从软件加密到软件授权保护
    月光博客 再谈软件保护中软加密和硬加密的安全强度
    INFO:Visual Studio 11 Beta版本中去除对Visual Studio Installer的支持,只保留InstallShield LE版本
    android 抓包分析
    android 巧用 dimerns 分辨率
    android 抓包 2
  • 原文地址:https://www.cnblogs.com/datie/p/11435834.html
Copyright © 2011-2022 走看看