‎2009 Apr 03 6:07 AM
Dear All,
I want to change date format in script text elements. Now the date format is MMDDYYYY. Now I want change it into DDMMYYYY. How I can change that.
Thanks and regards,
Krish....
‎2009 Apr 03 6:38 AM
HI,
Use the SAP script control command
/: SET DATE MASK = 'MMMM DD, YYYY'
this will solve your requirement
Regards,
Jaya ramakumar
‎2009 Apr 03 6:17 AM
Hi Krish,
Try using date mask with the following syntax.
Syntax
/: SET DATE MASK = 'date_mask'
Assuming a current system date of March 1st, 1997.
/: SET DATE MASK = 'Foster City, MM.DD.YY'
&DATE& -> Foster City, 03.01.97
&DATE(Z)& -> Foster City, 3.1.97
/: SET DATE MASK = 'MMMM DD, YYYY'
&DATE& -> March 01, 1997
Ref. From Library.
Much Regards,
Amuktha.
‎2009 Apr 03 6:38 AM
WRITE ONE Z PROGRAM .
EX. ZTEST
write the code below.
PROGRAM ZTEST.
form GET_NEWDATE tables in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
DATA : LV_NEWDATE TYPE D.
DATA : LV_OLDDATE LIKE OLDDATE,
data : gv_dd(2) type c,
gv_mm(2) type c,
gv_yy(4) type c.
data : date(8) type c.
gv_dd = LV_OLDDATE(+22).
gv_mm = LV_OLDDATE(2).
gv_yy = LV_DOC_DATE+4(4).
CONCATENATE gv_dd gv_mm gv_yy INTO date.
LV_NEWDATE = DATE.
read table OUT_tab index 1.
MOVE LV_NEWDATE TO OUT_TAB-VALUE.
CONDENSE OUT_TAB-VALUE.
MODIFY OUT_TAB INDEX 1.
ENDFORM.
write the code below in ur sapscript,
}
/:DEFINE &LV_NEWDATE&.
/:PERFORM GET_NEWDATE IN PROGRAM TEST
/:USING &LV_OLD_DATE&
/:CHANGING &LV_NEWDATE&.
PRINT &LV_NEWDATE&
ENDPERFORM.
‎2009 Apr 03 6:38 AM
HI,
Use the SAP script control command
/: SET DATE MASK = 'MMMM DD, YYYY'
this will solve your requirement
Regards,
Jaya ramakumar
‎2009 Apr 03 6:52 AM
‎2009 Apr 03 12:50 PM