The date and time are often used in the development process. This item naturally cannot allow users to manually enter the KEY. If there is a way to choose.
1. Date selector:
First, SE38 creates a program, SE51 creates screen 0100, and draws the following controls:
The date control property page is as follows:
Code of the F4 search auxiliary function is: BU_DATE_CHAR
The property page of the time control is as follows:
In the logic function of the screen, add the following code to PAI:
Process on value-REQUEST.
FIELD TIME1 MODULE CHOOSE_TIME1.
Process on value-REQUEST. indicates that the F4. this code is required because the F4.
The main program declaration variables are as follows:
DATA: TIME1 (8) type c,
DATE1 type d.
In SE38, The CHOOSE_TIME1 code is as follows:
MODULE CHOOSE_TIME1 INPUT.
Call function 'help _ VALUES_GET'
EXPORTING
* DISPLAY =''
FIELDNAME = 'laststrttm'
* INPUT_VALUE =''
TABNAME = 'btch1010'
* SHOW_ALL_VALUES_AT_FIRST_TIME =''
IMPORTING
SELECT_VALUE = TIME1
* SELECT_INDEX =
* EXCEPTIONS
* NO_HELP_FOR_FIELD = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
* Message id SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3.
ENDIF.
ENDMODULE. "CHOOSE_TIME1 INPUT
SELECT_VALUE is the control on which the F4 function is to be placed. Here is TIME1.
The program runs as follows:
Click the small button next to the date control:
Click the time control button: