‎2009 Apr 03 6:06 AM
Hi every body,
I want to change the date format in SAP-SCRIPT.I need to change the code in only Layout why because
the print program is satandard. Iam not able to change the Print program.
Now it is displaying like this MMDDYYYY
Now i need to change like this DDMMYYYY.
Can you please help me out in this:
Thanks,
Raghu.
‎2009 Apr 03 6:18 AM
Hi Jagan,
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:28 AM
hi,
/: SET DATE MASK = 'MMMM DD, YY'
This displays the date as : September 26, 07
The following are the codes that can be used in the date mask:
YY Year (2 digits)
YYYY Year (4 Digits)
MM Month (2 Digits)
MMM Month Name (Abbreviated)
MMMM Month Name (Full)
DD Day as two digits
DDD Day name (Abbreviated)
DDDD Day name
hope it helps you.
regrds,
Lokesh
‎2009 Apr 03 6:31 AM
Hi Jagan,
Try like the above one using Date_Mask.
If you not familiar with that then try to call a subroutine pool in the Script to a new program like this example,,,
Definition in the SAPscript form:
/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/
/ &BARCODE&
Coding of the calling ABAP program:
REPORT QCJPERFO.
FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA: PAGNUM LIKE SY-TABIX, "page number
NEXTPAGE LIKE SY-TABIX. "number of next page
READ TABLE IN_PAR WITH KEY u2018PAGEu2019.
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = u2018|u2019. "First page
ELSE.
OUT_PAR-VALUE = u2018||u2019. "Next page
ENDIF.
IF NEXTPAGE = 0.
OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page
ENDIF.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
Thanks & regards,
Dileep .C
‎2009 Apr 03 6:33 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.