Application Development 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: 

conversion of 20070426 to 04/26/2007

Former Member
0 Kudos

Hi all,

I need to convert 20070426 to 04/26/2007. Is there any func. module.Please help me.

Regards,

Karthick.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

If you want to write/display the date on the report , you can use the following:

data: gv_var1 type sy-datum,

gv_date(10) type c.

gv_var1 = '20070426'.

<b>WRITE: gv_var1 to gv_date MM/DD/YYYY.</b>

But if you just want to store it in some variable and not display it you can use the following:

data: gv_var1 type sy-datum,

gv_date(10) type c.

gv_var1 = '20070426'.

CONCATENATE gv_var14(2) '/' gv_var16(2) '/' gv_var1+0(4)

INTO gv_date.

I hope this helps you!!

7 REPLIES 7

Former Member
0 Kudos

use

write <var name> to <char10 var>

or u can use the fm

<b>CONVERT_DATE_TO_EXTERNAL</b>

former_member181962
Active Contributor
0 Kudos

You can simple use the write statement.

write sy-datum to v_date.

You should have set your own profile with teh date format as __/__/____

using the following menu.

Chose from menu

system->User profile->Own data

Regards,

Ravi

Message was edited by:

Ravi Kanth Talagana

Former Member
0 Kudos

Simplay use WRITE statement is a addtion on it.

like Write date1 to date2 MM/DD/YYYY.

check help on write statement.

Regards,

Amey

Former Member
0 Kudos

Hi,

You can use the WRITE statement.

Check this example..

DATA: V_DATE TYPE SY-DATUM.

DATA: V_CHAR(10).

V_DATE = SY-DATUM.

WRITE: V_DATE TO V_CHAR.

OR

WRITE: V_DATE TO V_CHAR MM/DD/YYYY.

WRITE: / V_CHAR.

Thanks,

Naren

Former Member
0 Kudos

Hi,

Use EDIT MASK command in WRITE statement.

Regards,

Bhaskar

Former Member
0 Kudos

Hi,

If you want to write/display the date on the report , you can use the following:

data: gv_var1 type sy-datum,

gv_date(10) type c.

gv_var1 = '20070426'.

<b>WRITE: gv_var1 to gv_date MM/DD/YYYY.</b>

But if you just want to store it in some variable and not display it you can use the following:

data: gv_var1 type sy-datum,

gv_date(10) type c.

gv_var1 = '20070426'.

CONCATENATE gv_var14(2) '/' gv_var16(2) '/' gv_var1+0(4)

INTO gv_date.

I hope this helps you!!

Former Member
0 Kudos

Hi Karthik,

Also chk the FM CONVERSION_EXIT_PDATE_OUTPUT