简体   繁体   中英

How to get Date format in Japanese in ABAP

NW ABAP 7.0 in SU01 You can set a users date format to Japanese . Example Format 7

在此处输入图片说明

In code this works when run by the user.

" 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 

However we need to get this from a user that doesnt and cannot have this date format set.

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 ?

What about the following solution?

REPORT YYY.

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

If the user date setting works, you can use, set country command, I guess. Or you tried it already?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM