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
949

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
Read only

Former Member
0 Likes
908

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.

Read only

Former Member
0 Likes
908

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.

Read only

Former Member
0 Likes
908

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.

Read only

Former Member
0 Likes
908

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...

Read only

Former Member
0 Likes
908

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

Read only

Former Member
0 Likes
908

hi

DATE_CONV_EXT_TO_INT Conversion of dates to SAP internal format .

Read only

Former Member
0 Likes
908

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