如何在ABAP中获取日语的日期格式

时间:2017-09-01 14:35:37

标签: sap abap

NW ABAP 7.0 在SU01中您可以将用户日期格式设置为日语。示例格式7

enter image description here

在代码中,这在用户运行时有效。

" user date format set to JAPANESE   DATFM 7  
DATA: l_char TYPE text240, l_char1 TYPE c.
write sy-datum to l_char.
l_char1 = l_char(1).  " THIS WORKS 

但是我们需要从没有且不能设置此日期格式的用户那里得到这个。

write someDate to l_char 'YYYY.MM.DD'  is possible.
   But the format for Japanese is not available.

function CONVERT_DATE_TO_EXTERNAL
only works for the logged in users format.


Is there a functional that can delivery the japanese date string ?

2 个答案:

答案 0 :(得分:3)

以下解决方案如何?

REPORT YYY.

WRITE |{ sy-datlo COUNTRY = 'JP ' }|.

答案 1 :(得分:1)

如果用户日期设置有效,我猜你可以使用set country命令。或者你已经尝试过了吗?