在WEB DYNPRO ABAP中日期有默认的输入帮助,但时间只是u201CHH:MM:SSu201D的文本输入框。
写了一个ABAP Dictionary Search Help来处理
SEARCH HELP: Z_SH_TIME
SERCH HELP EXIT: ZTIME_SHLP_EXIT
PARAMETER: TIME_CHAR 类型 UZEIT
ZTIME_SHLP_EXIT中代码如下:
FUNCTION ztime_shlp_exit.
*"----
""Local Interface:
*" TABLES
*" SHLP_TAB TYPE SHLP_DESCT
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" REFERENCE(SHLP) TYPE SHLP_DESCR
*" REFERENCE(CALLCONTROL) TYPE DDSHF4CTRL
*"----
Local data.
DATA ls_interface LIKE LINE OF shlp_tab-interface.
DATA lv_time_char TYPE uzeit.
EXIT immediately, if you do not want to handle this step
IF callcontrol-step <> 'SELECT'.
EXIT.
ENDIF.
READ TABLE shlp_tab INDEX 1.
READ TABLE shlp_tab-interface INTO ls_interface
WITH KEY shlpfield = 'TIME_CHAR'.
lv_time_char = ls_interface-value.
DATA lt_dynpselect TYPE STANDARD TABLE OF dselc.
DATA lt_dynpvaluetab TYPE STANDARD TABLE OF dval.
DATA selection.
DATA select_value LIKE help_info-fldvalue.
DATA rsmdy_ret LIKE rsmdy.
DATA ls_help_infos TYPE help_info.
ls_help_infos-call = 'D'.
ls_help_infos-object = 'F'.
ls_help_infos-docuid = 'FE'.
ls_help_infos-spras = sy-langu.
ls_help_infos-tabname = 'CDHDR'.
ls_help_infos-fieldname = 'UTIME'.
ls_help_infos-fieldtype = 'TIME'.
CALL FUNCTION 'DD_SHLP_CALL_FROM_DYNP'
EXPORTING
help_infos = ls_help_infos
IMPORTING
selection = selection
select_value = select_value
rsmdy_ret = rsmdy_ret
TABLES
dynpselect = lt_dynpselect
dynpvaluetab = lt_dynpvaluetab
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
EXIT.
ENDIF.