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&time conversions::

Former Member
0 Likes
594

Hi all,

1)SAP date is 09/08/2008 . Remove slashes , only keep 2 digit year , then numerical day of the year ,1-365. out put value is 08252.?

2) 09/08/2008 to 090808 ?

3) And SAP time is 23:16:59 .Remove colons and add 2 zeros at the beginning out put value is 00231659.?

Regards

Venkat

1 ACCEPTED SOLUTION
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
565

Hi Venkat,

To change the format for date and time as per your requirements in (2) and (3).

You can use this code :-

PARAMETERS : DATE LIKE SY-DATUM.

WRITE 😕 'Date', DATE DDMMYY,

/ 'Time', SY-UZEIT USING EDIT MASK '00______'.

Thanks & Regards.

Tarun.

5 REPLIES 5
Read only

Former Member
0 Likes
564

check the demo program

DEMO_DATA_DATE_TIME

hope this will help you

Read only

0 Likes
564

hi srinu,

Can you send me the code for the above queries .

Regards

Venkat

Read only

Former Member
0 Likes
564

CONVERT_DATE_TO_EXTERNAL u2013 Formats date from internal to display format . . . . . . . .

CONVERT_DATE_TO_INTERNAL u2013 Formats date from display to internal format . . . . . . . . .

after conversion apply string manipulation operations to gets ur desired result

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
566

Hi Venkat,

To change the format for date and time as per your requirements in (2) and (3).

You can use this code :-

PARAMETERS : DATE LIKE SY-DATUM.

WRITE 😕 'Date', DATE DDMMYY,

/ 'Time', SY-UZEIT USING EDIT MASK '00______'.

Thanks & Regards.

Tarun.

Read only

Former Member
0 Likes
564

Thanks for answers

Regards

Venkat