选择画面中日期F4输入帮助函数汇总
1, F4_DATE
弹出一个小的calendar,只有一个月的日期,能选择年月日。
代码
1
2
3
4
5
6
7
8
|
REPORT ZTEST_DATE_F4.
PARAMETERS: p_date TYPE sy-datum.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_date.
CALL FUNCTION 'F4_DATE'
IMPORTING
select_date = p_date.
|
显示:
2, POPUP_TO_SELECT_MONTH
函数POPUP_TO_SELECT_MONTH 可以选择年和月份,
代码:
1
2
3
4
5
6
7
8
9
10
|
REPORT ztest_date_f4.
PARAMETERS: p_date TYPE isellist-month.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_date.
CALL FUNCTION 'POPUP_TO_SELECT_MONTH'
EXPORTING
actual_month = sy-datum+0(6)
IMPORTING
selected_month = p_date. "传入参数值
|
显示:
3, F4_DATE_CONTROL
在弹出的日期窗口中,能通过滚动条移动年和月,比F4_DATE要方便。
代码:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
REPORT ztest_date_f4.
PARAMETERS: p_date TYPE d.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_date.
CALL FUNCTION 'F4_DATE_CONTROL'
EXPORTING
date_for_first_month = sy-datum
IMPORTING
select_date = p_date
EXCEPTIONS
calendar_buffer_not_loadable = 1
date_after_range = 2
date_before_range = 3
date_invalid = 4
factory_calendar_not_found = 5
holiday_calendar_not_found = 6
parameter_conflict = 7
OTHERS = 8.
|
显示:
4, ISU_EDM_DATE_CONTROL_POPUP
与F4_DATE_CONTROL很类似,只不过周六周日是红色显示,如下:
以上