12-03-2007 7:21 AM
Hi,
I am Using System Variable sy-datum.
data xyz type d.
xyz = sy-datum.
sy-datum is in the format YYYYMMDD
but i need to assign xyz as DDMMYYYY.
How to change the format through Programming.
Points will be awarded.
Regards,
jayasimha jangam
12-03-2007 7:24 AM
hi,
U can use,
CONVERT_DATE_TO_EXTERNAL : Converts date from system storage format to users specified display format .
Also,
http://www.sapdevelopment.co.uk/fmodules/fmssap.htm
might help you.
regards,
pavan.
12-03-2007 7:24 AM
12-03-2007 7:25 AM
Hi,
Use FM to convert the format
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
date_internal = lv_newdate
IMPORTING
date_external = lv_newdate1
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,
Prashant
12-03-2007 7:26 AM
Hi,
Try,
xyz0(2) = sy-datum6(2).
xyz2(2) = sy-datum4(2).
xyz4(4) = sy-datum0(4).
Regards,
Vani
12-03-2007 7:49 AM
Hi
jayasimha
how ever u assign the system internalyy takes it as yyyymmdd
it is the only format tht system will treat internally
if in the o/p u want u r format to be printed go to SYSTEM in the menu
in tht user profile in tht own data goto defaults page and change the format u required
plzzzz reward if usefulll
12-03-2007 7:59 AM
Hi,
if in the o/p u want u r format to be printed go to SYSTEM in the menu
in tht user profile in tht own data goto defaults page and change the format u required
Reward points if it is useful plzzzz.
12-03-2007 8:40 AM
Hi Jayasimha,
You can use offset method for this.
xyz4(4) = sy-datum0(4).
xyz2(2) = sy-datum4(2).
xyz0(2) = sy-datum6(2).
12-03-2007 9:06 AM
Try this
Data: abc(10).
Concatenate sy-datum6(2) sy-datum4(2) sy-datum(4) into abc.
Write : / abc.