• REUSE_ALV_POPUP_TO_SELECT的使用技巧


    通过函数的方法弹出一个对话框,提供选择数据的功能……

     1 DATA: BEGIN OF lt_exidv OCCURS 0,
     2        box TYPE char1,
     3        exidv TYPE exidv,
     4        status TYPE char4,
     5       END OF lt_exidv.
     6 DATA:   lt_fieldcat TYPE slis_t_fieldcat_alv,
     7         lh_fieldcat TYPE LINE OF slis_t_fieldcat_alv.
     8 DATA:l_message(100),l_line.
     9 
    10 lt_exidv-exidv = '620000000014597001'.
    11 lt_exidv-status = '001'.
    12 APPEND lt_exidv.
    13 lt_exidv-exidv = '620000000014597002'.
    14 lt_exidv-status = '002'.
    15 APPEND lt_exidv.
    16 lt_exidv-exidv = '620000000014597003'.
    17 lt_exidv-status = '003'.
    18 APPEND lt_exidv.
    19 
    20 IF lt_fieldcat[] IS INITIAL.
    21   CLEAR lh_fieldcat.
    22   lh_fieldcat-fieldname  = 'EXIDV'.
    23   lh_fieldcat-seltext_l = '箱码'.
    24   lh_fieldcat-outputlen = 20.
    25   APPEND lh_fieldcat TO lt_fieldcat[].
    26 *  CLEAR lh_fieldcat.
    27 *  lh_fieldcat-fieldname  = 'STATUS'.
    28 *  lh_fieldcat-seltext_l = '箱状态'.
    29 *  lh_fieldcat-outputlen = 10.
    30 *  APPEND lh_fieldcat TO lt_fieldcat[].
    31 ENDIF.
    32 
    33 CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
    34   EXPORTING
    35 *       I_TITLE                       =
    36 *       I_SELECTION                   = 'X'
    37 *       I_ALLOW_NO_SELECTION          =
    38    i_zebra                       = 'X'
    39 *       I_SCREEN_START_COLUMN         = 0
    40 *       I_SCREEN_START_LINE           = 0
    41 *       I_SCREEN_END_COLUMN           = 0
    42 *       I_SCREEN_END_LINE             = 0
    43    i_checkbox_fieldname          = 'BOX'
    44 *       I_LINEMARK_FIELDNAME          =
    45 *       I_SCROLL_TO_SEL_LINE          = 'X'
    46     i_tabname                     = 'LT_EXIDV'
    47 *       I_STRUCTURE_NAME              =
    48    it_fieldcat                   = lt_fieldcat[]
    49 *       IT_EXCLUDING                  =
    50 *       I_CALLBACK_PROGRAM            =
    51 *       I_CALLBACK_USER_COMMAND       =
    52 *       IS_PRIVATE                    =
    53 *     IMPORTING
    54 *       ES_SELFIELD                   =
    55 *       E_EXIT                        =
    56   TABLES
    57     t_outtab                      = lt_exidv
    58  EXCEPTIONS
    59    program_error                 = 1
    60    OTHERS                        = 2.
    61 IF sy-subrc <> 0.
    62 *  CALL FUNCTION 'MESSAGE_TEXT_BUILD'
    63 *    EXPORTING
    64 *      msgid               = sy-msgid
    65 *      msgnr               = sy-msgno
    66 *      msgv1               = sy-msgv1
    67 *      msgv2               = sy-msgv2
    68 *      msgv3               = sy-msgv3
    69 *      msgv4               = sy-msgv4
    70 *    IMPORTING
    71 *      message_text_output = l_message.
    72 *  MESSAGE l_message TYPE 'E'.
    73 ELSE.
    74   LOOP AT lt_exidv WHERE box = 'X'.
    75     l_line = sy-tabix.
    76     CONCATENATE l_message '您选中的有第' l_line '行...' INTO l_message.
    77   ENDLOOP.
    78   MESSAGE l_message TYPE 'I'.
    79 ENDIF.
    View Code

    弹出的DIALOG示例:

  • 相关阅读:
    这个开源组织里的项目都是精品
    动态代理大揭秘,带你彻底弄清楚动态代理!
    Python_对excel表格读写-openpyxl、xlrd&xlwt
    PostgreSQL 查看数据库,索引,表,表空间大小
    Mysql日志undo log、redo log、binlog、relay log
    python 高级
    win10 ssh 登录 ubuntu Access denied
    mysql5.7 ubuntu20.04
    pycharm 激活 成功
    Xmind:文件损坏怎么恢复
  • 原文地址:https://www.cnblogs.com/ruingy/p/3594246.html
Copyright © 2020-2023  润新知