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 conversion

Former Member
0 Likes
1,054

Hi all,

My requirment is to convert 20060917 to 17.09.2006.HOw is it possible pls help me on this.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,018

use fm.

CONVERSION_EXIT_PDATE_OUTPUT

8 REPLIES 8
Read only

Former Member
0 Likes
1,019

use fm.

CONVERSION_EXIT_PDATE_OUTPUT

Read only

Former Member
0 Likes
1,018

data v_date(10) type c.

<b>write sy-datum to v_date.</b>

v_date will have date in your required format.

its based on user profile settings.

example:

if the user has mm/dd/yyyy format,

you will get the output also like that.

Regards

Srikanth

Read only

Former Member
0 Likes
1,018

d1 = 20060917

d20(2) = d16(2).

d22(2) = d14(2).

d24(4) = d10(4).

try this out

Read only

0 Likes
1,018
data: datum(10) type c.

call function 'CONVERT_DATE_TO_EXTERNAL'
exporting
date_internal = sy-datum
importing
date_external = datum.

write:/ datum.
Read only

former_member184495
Active Contributor
0 Likes
1,018

hi,

try this FM CONVERT_DATE_TO_INTERN_FORMAT

or as one of our friends suggested, use offset for dd mm yyyy and then concatenate it with '.'

cheers,

Aditya.

Read only

anversha_s
Active Contributor
0 Likes
1,018

hi,

alex

use this.

CONVERSION_EXIT_SDATE_OUTPUT

DATA: INT_DATUM LIKE SY-DATUM VALUE '19940102',

EXT_DATUM(11) TYPE C.

...

CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'

EXPORTING

INPUT = INT_DATUM

IMPORTING

OUTPUT = EXT_DATUM.

Result:

EXT_DATUM = 02.JAN.1994

rgds

anver

Message was edited by: Anversha s

Read only

Former Member
0 Likes
1,018

WRITE sy-datum to ldate DD/MM/YYYY.

The above should do the trick !!

Read only

Former Member
0 Likes
1,018

Hello,

Use the conversion exit CONVERSION_EXIT_PDATE_OUTPUT.

Regs,

Venkat Ramanan N