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,

how to convert date 12/31/9999 to sap date format

Edited by: p bharath on Feb 7, 2008 9:10 AM

7 REPLIES 7

Former Member
0 Kudos

Hi,

This is used to convert the dta ei nto required format;

The CONVERT_DATE_TO_EXTERNAL function will convert an internal date, 20080125 into the user specific format which is set on the user profile. For example, it would convert this value to 01/25/2008 for me.

Also Do like this.

Data: date(10).

write sy-datum to date.

write: date.

Reward Points if found helpfull..

Cheers,

Chandra Sekhar.

Former Member
0 Kudos

Declare three variables like lv_day, lv_month, lv_yead. Split the date and get the values of the day, month and year in the variable.


data: lv_date (10) type c value '12/31/9999'.
        lv_day(2) type c,
        lv_month(2) type c,
        lv_year(4) type c.
lv_day =  lv_date(2).
lv_month = lv_date+4(2).
lv_year= lv_date+7(4).

now get whatever format you like by concatenating lv_day, lv_month & lv_year.

Former Member
0 Kudos

Hi,

do like below........

DATA: d(10) type c value '10/12/2007'.

write d.

concatenate d+6(4) d+3(2) d+0(2) into d.

write : / d.

Cheers,

jose.

Former Member
0 Kudos

HI,

DATA : v_date(10),

v_fstop value '.'

v_date_tmp = '12/31/9999'.

concatenate v_date_tmp+2(2) v_fstop

v_date_tmp+0(2) v_fstop

v_date_tmp+4(4) INTO v_date.

Don't forget to reward if useful...

Former Member
0 Kudos

Hi,

data: d1(10) type c,

d2 like sy-datum.

d1 = '12/31/9999'.

concatenate d16(4) d13(2) d1+0(2) to d2.

Please see if the code is useful.

Thanks and regards,

Atanu

Former Member
0 Kudos

hi

DATE_CONV_EXT_TO_INT Conversion of dates to SAP internal format .

Former Member
0 Kudos

Check out the standard program RSSCA1T0. This test report contains the complete date conversion with external as well as internal presentations.