‎2007 Mar 06 2:57 AM
I have managed to copy the system date to a field using the sy-datlo. Now i want to change the date format to 'MM/DD/YYYY'. Please Help.
‎2007 Mar 06 3:03 AM
welcome to SDN.
Concatenate sy-datum4(2) '/' sy-datum6(2) '/' sy-datum+0(4) into v_date.
Regards,
Amit
Reward all helpful replies.
‎2007 Mar 06 3:03 AM
Hi,
use the Function module CONVERT_DATE_TO_EXTERNAL
example:
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
DATE_INTERNAL = VLDAT
IMPORTING
DATE_EXTERNAL = DATE
EXCEPTIONS
DATE_INTERNAL_IS_INVALID = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
regards,
keerthi
Message was edited by:
keerthi kiran varanasi
‎2007 Mar 06 3:03 AM
welcome to SDN.
Concatenate sy-datum4(2) '/' sy-datum6(2) '/' sy-datum+0(4) into v_date.
Regards,
Amit
Reward all helpful replies.
‎2007 Mar 06 3:06 AM
Hi,
Welcome to SDN.
You can use offset.
data: wa_date(10).
concatenate sy-datlo+4(2) '/' sy-datlo+6(2) '/' sy-datlo(4) into wa_date.
write: /wa_date.
Regards,
Ferry Lianto
‎2007 Mar 06 5:32 AM
Hi,
you have option called edit-mask go for that statement you will get the date format what ever you want.
hope it will help u.