Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Changing the date format in Scripts

Former Member
0 Likes
1,179

Hi Friends,

I am using SAP scripts to print PO and the PO is printing the delvy date in dd.mm.yyyy format. The delvy date here is 10 char length and needs to be printed in mm/dd/yyyy. How can I write this logic in the text editor?

Thanks,

Raj

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
956

/: SET DATE MASK = ‘MM/DD/YYYY’

  • &V_DATE&

/: SET DATE MASK = ‘ ‘ <--TO switch off the date mask

But i am not very sure will this work for your requirement,as you said its 10 character field,so i dont know exactly whether this works correctly or not.

else,

you can use OFFSET of that 10 char variable, to print the way how you want

<b>* &V_DATE3(2)& / &V_DATE0(2)& / &V_DATE+5(4)&</b>

-


-


-


month date year

but make sure your date format always should be dd.mm.yyyy . here i have taken V_DATE as a date with 10 character length.

Regards,

Srikanth

Message was edited by: Srikanth Kidambi

8 REPLIES 8
Read only

Former Member
0 Likes
957

/: SET DATE MASK = ‘MM/DD/YYYY’

  • &V_DATE&

/: SET DATE MASK = ‘ ‘ <--TO switch off the date mask

But i am not very sure will this work for your requirement,as you said its 10 character field,so i dont know exactly whether this works correctly or not.

else,

you can use OFFSET of that 10 char variable, to print the way how you want

<b>* &V_DATE3(2)& / &V_DATE0(2)& / &V_DATE+5(4)&</b>

-


-


-


month date year

but make sure your date format always should be dd.mm.yyyy . here i have taken V_DATE as a date with 10 character length.

Regards,

Srikanth

Message was edited by: Srikanth Kidambi

Read only

Former Member
0 Likes
956

hi

use command set date mask __/__/____.

in ur script editor.

Regards

Read only

Former Member
0 Likes
956

Hi raj,

<b>Syntax /: SET DATE MASK = 'date_mask'</b>

The following templates may be used in the date mask:

DD day (two digits)

DDD name of day (abbreviated)

DDDD name of day (written out in full)

MM month (two digits)

MMM name of month (abbreviated)

MMMM name of month (written out in full)

YY year (two digits)

YYYY year (four digits)

LD day (formatted as for the L option)

LM month (formatted as for the L option)

LY year (formatted as for the L option)

/: SET DATE MASK = 'MMMM DD, YYYY' &DATE& -> March 01, 1994

Regards

Sudheer

Read only

0 Likes
956

I tried this but did not work. I have the date field next to a different field. I added this syntax in the next line and did not work.

Thanks,

Raj

Read only

0 Likes
956

Hi Raj,

You need to place SET DATE MASK statement before you use date field in your script editor.

<b>/: SET DATE MASK = 'MM/DD/YYYY'

/: &V_DATE&</b>

If you need to switch off this masking, just use

/: SET DATE MASK = ' '

Thanks,

Vinay

Read only

0 Likes
956

Put the SET DATE MASK statement before using the date field in your script.

Regards,

Rich Heilman

Read only

0 Likes
956

Thanks Friends. I got it solved.

I've awarded points to all.

Thanks,

Raj

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
956

Please see the following......



Syntax /: SET DATE MASK = 'date_mask' 

The following templates may be used in the date mask: 

DD day (two digits) 
DDD name of day (abbreviated) 
DDDD name of day (written out in full) 
MM month (two digits) 
MMM name of month (abbreviated) 
MMMM name of month (written out in full) 
YY year (two digits) 
YYYY year (four digits) 

LD day (formatted as for the L option) 
LM month (formatted as for the L option) 
LY year (formatted as for the L option)

<b>/: SET DATE MASK = 'MM/DD/YYYY' &DATE& -> 09/26/2006</b>



Regards,

Rich Heilman