1 *函数1
2 DATA lt_errormsg TYPE tsmesg.
3 DATA ls_errormsg LIKE LINE OF lt_errormsg.
4
5 CLEAR:lt_errormsg[],ls_errormsg.
6 ls_errormsg-msgty = 'E'."类型
7 ls_errormsg-arbgb = 'VL'."消息类
8 ls_errormsg-txtnr = '198'."编号
9 ls_errormsg-msgv1 = 'HHH'."信息
10 APPEND ls_errormsg TO lt_errormsg.
11
12 ls_errormsg-msgty = 'E'.
13 ls_errormsg-arbgb = 'VL'.
14 ls_errormsg-txtnr = '199'.
15 ls_errormsg-msgv1 = 'HHH'.
16 APPEND ls_errormsg TO lt_errormsg.
17
18 IF lt_errormsg[] IS NOT INITIAL.
19
20 CALL FUNCTION 'FB_MESSAGES_DISPLAY_POPUP'
21 EXPORTING
22 it_smesg = lt_errormsg[]
23 EXCEPTIONS
24 no_messages = 1
25 popup_cancelled = 2
26 OTHERS = 3.
27
28 ENDIF.
29
30 *函数2
31 DATA:gs_message TYPE LINE OF esp1_message_tab_type,
32 gt_message TYPE esp1_message_tab_type.
33
34 *单个报错可以不用内表
35 REFRESH gt_message .
36
37 CLEAR gs_message .
38 gs_message-msgid = 'VL' .
39 gs_message-msgty = 'W' .
40 gs_message-msgno = '199' .
41 gs_message-msgv1 = 'VL' .
42 gs_message-msgv2 = 'VL' .
43 gs_message-msgv3 = 'VL' .
44 gs_message-msgv4 = 'VL' .
45 gs_message-lineno = '001' .
46 APPEND gs_message TO gt_message .
47
48 CALL FUNCTION 'C14Z_MESSAGES_SHOW_AS_POPUP'
49 EXPORTING
50 i_msgid = 'VL'
51 i_msgty = 'E'
52 i_msgno = '198'
53 i_msgv1 = ''
54 i_msgv2 = ''
55 i_msgv3 = ''
56 i_msgv4 = ''
57 i_lineno = '002'
58 TABLES
59 i_message_tab = gt_message.*函数1
60 DATA lt_errormsg TYPE tsmesg.
61 DATA ls_errormsg LIKE LINE OF lt_errormsg.
62
63 CLEAR:lt_errormsg[],ls_errormsg.
64 ls_errormsg-msgty = 'E'."类型
65 ls_errormsg-arbgb = 'VL'."消息类
66 ls_errormsg-txtnr = '198'."编号
67 ls_errormsg-msgv1 = 'HHH'."信息
68 APPEND ls_errormsg TO lt_errormsg.
69
70 ls_errormsg-msgty = 'E'.
71 ls_errormsg-arbgb = 'VL'.
72 ls_errormsg-txtnr = '199'.
73 ls_errormsg-msgv1 = 'HHH'.
74 APPEND ls_errormsg TO lt_errormsg.
75
76 IF lt_errormsg[] IS NOT INITIAL.
77
78 CALL FUNCTION 'FB_MESSAGES_DISPLAY_POPUP'
79 EXPORTING
80 it_smesg = lt_errormsg[]
81 EXCEPTIONS
82 no_messages = 1
83 popup_cancelled = 2
84 OTHERS = 3.
85
86 ENDIF.
87
88 *函数2
89 DATA:gs_message TYPE LINE OF esp1_message_tab_type,
90 gt_message TYPE esp1_message_tab_type.
91
92 *单个报错可以不用内表
93 REFRESH gt_message .
94
95 CLEAR gs_message .
96 gs_message-msgid = 'VL' .
97 gs_message-msgty = 'W' .
98 gs_message-msgno = '199' .
99 gs_message-msgv1 = 'VL' .
100 gs_message-msgv2 = 'VL' .
101 gs_message-msgv3 = 'VL' .
102 gs_message-msgv4 = 'VL' .
103 gs_message-lineno = '001' .
104 APPEND gs_message TO gt_message .
105
106 CALL FUNCTION 'C14Z_MESSAGES_SHOW_AS_POPUP'
107 EXPORTING
108 i_msgid = 'VL'
109 i_msgty = 'E'
110 i_msgno = '198'
111 i_msgv1 = ''
112 i_msgv2 = ''
113 i_msgv3 = ''
114 i_msgv4 = ''
115 i_lineno = '002'
116 TABLES
117 i_message_tab = gt_message.