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: 

date conversion

Former Member
0 Kudos

hi friends..

i want to convert the date

from 20070901 to 01.09.2007

is there any functional module for this conversion..

can you plz..

9 REPLIES 9

Former Member
0 Kudos

Hello,

Try this.

REPORT ZTEST.

DATA : V_DATE LIKE SY-DATUM,

V_DATE1(10).

V_DATE = '20070101'.

CONCATENATE V_DATE6(2) V_DATE4(2) V_DATE+0(4) INTO V_DATE1.

WRITE : V_DATE1.

Some of the FM are used are:

<b>HR_HK_CONV_DATE_TO_INTN_FORMA

PT_IAC_GET_DATE_FORMAT

CONVERT_DATE_TO_INTERN_FORMAT

VALIDATE_BILLING_FORMAT

HRGPBS_HESA_DATE_FORMAT

HRGPBS_TPS_DATE_FORMAT

CONVERT_DATE_FORMAT

SLS_MISC_GET_USER_DATE_FORMAT

SPP02_SET_DATEFORMAT</b>

Regards,

LIJO

Former Member
0 Kudos

Hi Deva,

You can do it in the following way.

data: lv_date_temp(10),

lv_date type sy-datum.

lv_date = sy-datum.

concatenate lv_date6(2) lv_date4(2) lv_date+0(4) into lv_date_temp separated by '.'.

Reward points if this helps.

Regards,

Ravi G

Former Member
0 Kudos

Hi deva

if you would like to display in basic list , you can use

WRITE sy-datum DD/MM/YYYY .

Regards

Wiboon

Former Member
0 Kudos

hi deva

i dont no about FM but you can use this code.

data : da(8) value '20070809',

da1 type sy-datum.

da1 = da.

write 😕 da1.

hope it will help you.

regards

prajwal

Former Member
0 Kudos

Hi,

try fm

CONVERSION_EXIT_PDATE_OUTPUT

Regards,

Former Member
0 Kudos

Hi Deva,

If you need this format for a BDC program then use the below code

data: v_date type sy-datum value '20070901'.

CONCATENATE v_date6(2) v_date4(2) v_date+0(4) INTO v_date.

Now v_date contains '01092007'.

Former Member
0 Kudos

Hi Deva,

If you are going to convert the date in a sapscript, then you can use SET DATE MASK = 'MM.DD.YYYY'.

If you want to convert the format in a report, then you can use the Concatenate statement stated in other replies. This could be the simplest way.

Hope this helps.

Thanks.

Former Member
0 Kudos

Hi,

data l_date(12) type c.

write sy-datum to l_date using edit mask 'DD.MM.YYYY'

    • reward if helpful**

0 Kudos

hi friends..

tnakx for ur effort.

i solved my problem