QQ在线咨询
咨询热线
咨询热线
他们都在搜索:进入官网 备用网址 手机版入口 会员登入 app下载安装 线路检测
产品中心
联系方式
北京五月艺苑工艺美术品有限责任公司
地 址:北京五月艺苑工艺美术品有限责任公司
联系人:
手 机:
电 话:
QQ:
书法美术图书当前位置: 太阳城亚洲 > 书法美术图书

关于SAP的日期和时刻

1.日期范例(D,Date)
    在sap里Date范例通过隐含的转换函数变为CHARACTER*8.
    Elementary data type = D 内部长度和 输出长度都便是8
    System data type = DATS 内部长度 = 8 输出长度 = 10
    全部的日期范例在sap里城市通过转换函数存为 'YYYYMMDD'名目.
    Most of the times both type 'D' and 'DATS' behaves similarly except when they are output without any overriding additions. In such cases a 'DATS' type variable will be output with separators as specified in the "Date Format Settings" while a type 'd' variable will be output without separators.

输格外式:输格外式可以有三种要领配置:

1. 用户设定 - Transaction SU3
    a. 配置用户参数
    2. 当地/国度名目日期设定 - Transaction OY01
    a. 先行使SET COUNTRY <xx> or SET LOCALE COUNTRY <xx>呼吁,, 在挪用输出表现.
    3. 直接行使 "WRITE' 的名目
    a. DD/MM/YY
    b. MM/DD/YY
    c. DD/MM/YYYY
    d. MM/DD/YYYY
    e. DDMMYY
    f. MMDDYY
    g. YYMMDD
    h. USING EDIT MASK '==SDATE' -value checked for validity
    i. USING EDIT MASK '==LDATE' -value checked for validity


    2.时刻(Time)

在sap里Time范例通过隐含的转换函数变为CHARACTER*6.
    Elementary data type = T 内部长度和 输出长度都便是 6
    System data type = TIMS 内部长度 =6  输出长度都便是= 8
    全部的时刻范例在sap里城市通过转换函数存为 'HHMMSS'名目.
    Most of the times both type 'T' and 'TIMS' behaves similarly except when they are output without any overriding additions. In such cases a 'TIMS' type variable will be output with separators as specified (HH:MM:SS) while a type 'T' variable will be output without separators.

Working with Timestamp
    An extension of the DATE data type that can store date and time data (including fractional seconds).

The ABAP Dictionary contains the data elements TIMESTAMP, TIMESTAMPL,

TIMESTAMP = P(8) Decimal 0
    TIMESTAMPL = P(11) Decimal 7 ( decimal for fraction of second)

Commands
    GET TIME: Places the current time in the system field SY-UZEIT. At the same time, SY-DATUM is set, and the system fields for the local time zone (SY-TIMLO,SY-DATLO, and SY-ZONLO) are refreshed.

GET TIME STAMP FIELD <F> Returns the timestamp in short or long form. The short form contains the current date and time; the long form also contains seven decimal places for fractions of a second, making the timestamp accurate to within 100 nanoseconds.

Time Zone
    the world is divided into 24 time zones spaced at intervals of 15 degrees in longitude. The zones start at 0 with Greenwich. Within each time zone, the hour and minute of the day is defined to be the same. Time zones are usually specified by the number of hours they differ from GMT

TTZCU Customizing time zones table.

DST : Daylight Saving Time gives us the opportunity to enjoy sunny summer evenings by moving our clocks an hour forward in the spring.

Note :
    Simple write statement is not going to put Timestamp in the desired output format. One has to specify a TIME ZONE for output formatting.

Transaction STZBD维护时区.
    1. TTZZ : Time zones
    2. TTZR : Time zone rules
    3. TTZD : Summer time rules (Daylight saving).
    4. TTZDF : Summer time rules (fixed annual dates)
    5. TTZDV : Summer time rules (variable dates)

日期时刻相干的体系变量
    1. SY-TZONE Date and time, time difference from Greenwich Mean Time.
    2. SY-DATUM Date and time, current (application server) date.
    3. SY-UZEIT Date and time, current application server time.
    4. SY-ZONLO Date and time, time zone of user.
    5. SY-DATLO Date and time, local date of user.
    6. SY-TIMLO Date and time, local time for user.

Time Stamp转换
    CONVERT TIME STAMP tst
    TIME ZONE tz
    INTO DATE d
    TIME t [DAYLIGHT SAVING TIME dst].

CONVERT DATE d
    TIME t [DAYLIGHT SAVING TIME dst]
    INTO TIME STAMP tst
    TIME ZONE tz.


    The time stamp tst is always UTC time while d and t are always based on the time zone tz.The system always converts using the difference between the timezone tz and UTC time.

This implies that if you want to convert between non-UTC time zones then you can use the above statements in conjunction, First convert date & time in time zone 1 into UTC time stamp and then convert the UTC time stamp into date & time in time zone 2. 


更新日期: 2018-05-09 09:02
编辑作者: 太阳城亚洲
文章链接:http://www.bj-wyyy.cn/shufameishutushu/1786.html  [分享本文-关于SAP的日期和时刻]
太阳城亚洲_太阳城亚洲备用网址_太阳城亚洲官方网站 ©Copyright 2008-2018 北京五月艺苑工艺美术品有限责任公司 http://www.bj-wyyy.cn 版权所有 陕ICP备09013482号-1
Copyright © 2018年 北京五月艺苑工艺美术品有限责任公司 http://www.bj-wyyy.cn 版权所有