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示例:

 

转载于:https://www.cnblogs.com/ruingy/p/3594246.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值