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

date foramt in scripts

Former Member
0 Likes
565

Hi,

My requirement is to get the date(in scripts) like 20th May 2006 instead of 2006/05/20. How to get it? Can any one help me...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
524

use table t247 with elect logic...

parameters: date like sy-datum.

data: begin of itab occurs 0,

SPRAS type SPRAS,

MNR LIKE T247-MNR,

KTX LIKE T247-KTX,

LTX LIKE T247-LTX,

end of itab.

DATA : month LIKE T247-MNR.

DATA: YEAR(4).

DATA: FINAL(10).

MONTH = DATE+4(2).

YEAR = DATE+0(4).

select SINGLE * from t247 into itab where mnr = month

AND SPRAS = 'E'.

APPEND ITAB.

CONCATENATE ITAB-LTX YEAR INTO FINAL SEPARATED BY ''.

WRITE: FINAL.

5 REPLIES 5
Read only

Former Member
0 Likes
524

Hi kishore,

1. U cannot do this directly .

2. in driver program, use

the FM

CONVERSION_EXIT_SDATE_OUTPUT

This will give ouptut in a variable in the format

20.MAY.2006

(u will have to write your own logic for

20th May 2006 )

(this <b>th</b> logic is very cumbersome)

3. This new variable, u can use in layout.

&newvariable&

regards,

amit m.

Read only

Former Member
0 Likes
525

use table t247 with elect logic...

parameters: date like sy-datum.

data: begin of itab occurs 0,

SPRAS type SPRAS,

MNR LIKE T247-MNR,

KTX LIKE T247-KTX,

LTX LIKE T247-LTX,

end of itab.

DATA : month LIKE T247-MNR.

DATA: YEAR(4).

DATA: FINAL(10).

MONTH = DATE+4(2).

YEAR = DATE+0(4).

select SINGLE * from t247 into itab where mnr = month

AND SPRAS = 'E'.

APPEND ITAB.

CONCATENATE ITAB-LTX YEAR INTO FINAL SEPARATED BY ''.

WRITE: FINAL.

Read only

Former Member
0 Likes
524

Hi kishore,

use this command in sapcript in the line before ur date..

/:SET DATE MASK = 'DD MMM YYYY'

Read only

Former Member
0 Likes
524

Hi Kishore,

Welcome to SDN.

You can do that.

Use this link.

http://help.sap.com/saphelp_erp2004/helpdata/en/d1/803411454211d189710000e8322d00/frameset.htm

Use the corresponding mask.

Thanks,

Susmitha.

Dont forget to rewards points for useful answers.

Read only

dani_mn
Active Contributor
0 Likes
524

you can code your own function for this.

like.

CASE date+5(2).

When '01'.

datemonth = jan.

......

year will be copied as same. concatenate 'th' with day.

Regards,

Wasim Ahmed