SAP screen designer topic: Date and time (5)

Source: Internet
Author: User

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:



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.