1 *函数1
2 DATA:lv_answer TYPE string .
3 DATA:value1 TYPE char30 .
4 CALL FUNCTION 'POPUP_TO_GET_ONE_VALUE'
5 EXPORTING
6 textline1 = 'haha'
7 * TEXTLINE2 = ' '
8 * TEXTLINE3 = ' '
9 titel = 'titel'
10 valuelength = 8
11 IMPORTING
12 answer = lv_answer
13 value1 = value1
14 * EXCEPTIONS
15 * TITEL_TOO_LONG = 1
16 * OTHERS = 2
17 .
18 IF sy-subrc <> 0.
19 * Implement suitable error handling here
20 ENDIF.
21 "lv_answer 根据用户的操作会有三个值
22 " J 继续
23 " A 取消
24 "value1就是用户输入的值
25
26 *函数2
27 DATA : itb_sval TYPE TABLE OF sval,
28 wa_sval LIKE LINE OF itb_sval.
29 DATA:l_returncode TYPE string .
30 CLEAR wa_sval .
31 wa_sval-tabname = 'MARA' . "表名
32 wa_sval-fieldname = 'MATNR' . "字段名
33 wa_sval-field_obl = 'X' . "强制输入
34 APPEND wa_sval TO itb_sval.
35
36 "如果是金额的话要把参考表和参考字段也写进来,然后隐藏,不然金额的输入框是不能输入的
37 CLEAR wa_sval .
38 wa_sval-tabname = 'BSIS'.
39 wa_sval-fieldname = 'WRBTR'.
40 APPEND wa_sval TO itb_sval.
41
42 CLEAR wa_sval .
43 wa_sval-tabname = 'BSIS'.
44 wa_sval-fieldname = 'WAERS'.
45 wa_sval-field_attr = '04'. "隐藏货币字段
46 APPEND wa_sval TO itb_sval.
47
48 CALL FUNCTION 'POPUP_GET_VALUES'
49 EXPORTING
50 * NO_VALUE_CHECK = ' '
51 popup_title = '请填写提交支付日期'
52 * START_COLUMN = '5'
53 * START_ROW = '5'
54 IMPORTING
55 returncode = l_returncode
56 TABLES
57 fields = itb_sval
58 EXCEPTIONS
59 error_in_fields = 1
60 OTHERS = 2.
61 *itb_sval-value 就是输入框的值