Sometimes in the interface, We need to convent the time between SAP ABAP and JAVA.
How to finish this?
In this post, we will use classes.
*UNIX时间戳(格林威治时间)
PERFORM FRM_GET_TIMESTAMP CHANGING lv_TIMESTAMP.
FORM FRM_GET_TIMESTAMP CHANGING CV_TIMESTAMP TYPE STRING.
DATA:LV_TIMESTAMP TYPE TIMESTAMPL,
LV_TIMESTAMP_STR(25) TYPE C,
LV_DATUM TYPE SY-DATUM,
LV_UZEIT TYPE SY-UZEIT,
LV_MSEC TYPE NUMC3.
GET TIME STAMP FIELD LV_TIMESTAMP.
MOVE LV_TIMESTAMP TO LV_TIMESTAMP_STR.
CONDENSE LV_TIMESTAMP_STR.
LV_DATUM = LV_TIMESTAMP_STR+0(8).
LV_UZEIT = LV_TIMESTAMP_STR+8(6).
LV_MSEC = LV_TIMESTAMP_STR+15(3).
CALL METHOD CL_PCO_UTILITY=>CONVERT_ABAP_TIMESTAMP_TO_JAVA
EXPORTING
IV_DATE = LV_DATUM
IV_TIME = LV_UZEIT
IV_MSEC = LV_MSEC
IMPORTING
EV_TIMESTAMP = CV_TIMESTAMP.
ENDFORM. ” FRM_GET_TIMESTAMP
我的微信公众号【 hot583 】 或者在这个链接联系我
本文链接 :http://www.hot583.com/2022/12/29/abap-date-time-convention-vs-java
本文为作者原创,如果这篇文章对您有用,欢迎转载,
转载请务必注明来源《今日热点在看》http://www.hot583.com/
微信原文《全文完》