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

Re: DATE format change in SCRIPT

abdulgaffarmohd
Participant
0 Likes
1,078

Hi Guru(s),

In check printing i am getting date like 26.11.2008

But required like 26th November 2008.

i am using Perform to send the date,

there is any FM is there to convert the format.

Thanks And Regards,

Mohammed.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,037

Hi Abdul,

Use SET DATE MASK for this.

/: SET DATE MASK = 'date_mask'

In the date mask, you can use the following codes:

u2022 DD: day (two digits)

u2022 DDD: day name - abbreviated

u2022 DDDD: day name - written out in full

u2022 MM: month (two digits)

u2022 MMM: month name - abbreviated

u2022 MMMM: month name - written out in full

u2022 YY: year (two digits)

u2022 YYYY: year (four digits)

u2022 LD: day (formatted as for the L option)

u2022 LM: month (formatted as for the L option)

u2022 LY: year (formatted as for the L option)

All other characters found in a date mask are interpreted as simple text and are copied straight into the output.

Assuming the current system date is March 1st, 1997.

/: SET DATE MASK = 'Foster City, MM/DD/YY'

&DATE& -> Foster City, 03/01/97

/: SET DATE MASK = 'MMMM DD, YYYY'

&DATE& -> March 01, 1997

Hope this will help.

Regards,

Nitin.

7 REPLIES 7
Read only

Former Member
0 Likes
1,037

Hi

Use any of Function Modules ..

CONVERT_DATE_TO_INTERNAL ..

CONVERT_DATE_TO_EXTERNAL..

regards

Nishit

Read only

Former Member
0 Likes
1,037

You can as well use EDITMASK syntax I believe.

Regards,

Narendra.

Read only

Former Member
0 Likes
1,038

Hi Abdul,

Use SET DATE MASK for this.

/: SET DATE MASK = 'date_mask'

In the date mask, you can use the following codes:

u2022 DD: day (two digits)

u2022 DDD: day name - abbreviated

u2022 DDDD: day name - written out in full

u2022 MM: month (two digits)

u2022 MMM: month name - abbreviated

u2022 MMMM: month name - written out in full

u2022 YY: year (two digits)

u2022 YYYY: year (four digits)

u2022 LD: day (formatted as for the L option)

u2022 LM: month (formatted as for the L option)

u2022 LY: year (formatted as for the L option)

All other characters found in a date mask are interpreted as simple text and are copied straight into the output.

Assuming the current system date is March 1st, 1997.

/: SET DATE MASK = 'Foster City, MM/DD/YY'

&DATE& -> Foster City, 03/01/97

/: SET DATE MASK = 'MMMM DD, YYYY'

&DATE& -> March 01, 1997

Hope this will help.

Regards,

Nitin.

Read only

0 Likes
1,037

Exactly what Nitin has mentioned....!!!

Read only

0 Likes
1,037

Thnk..,

cannot we directly get the exactly 26th November 2008.

with out hard coding ..,

Regards,

Mohammed.

Read only

0 Likes
1,037

Hi there,

data : date(10),

text1(26),

num1(10),

test_day(15),

idate type sy-datum.

data : Day(2), month(2), Year(4).

data : ODay(2), Omonth(2), OYear(4).

data : Ltext Type T247-LTX.

date = sy-datum.

day = date+6(2).

month = date+4(2).

year = date+0(4).

concatenate year month day into idate.

CALL FUNCTION 'HR_IN_GET_DATE_COMPONENTS'

EXPORTING

idate = idate

IMPORTING

DAY = oday

MONTH = omonth

YEAR = oyear

LTEXT = ltext.

concatenate oday ltext oyear into o_date separated by space.

Read only

0 Likes
1,037

Hello,

Try this FM: CONVERSION_EXIT_LDATE_OUTPUT and CONVERSION_EXIT_SDATE_OUTPUT.

Thanks,

Jayant