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

Convert date

former_member125931
Active Participant
0 Likes
957

Hi All,

I am getiing the date in the formate 16-05-2008,now I have to change it into 20080516,can any one help me how to conert it.

Thanks&regds,

Sree.

11 REPLIES 11
Read only

Former Member
0 Likes
917

data : date1(10) type c value '16-05-2008',

date2(8).

concatenate date16(4) date13(2) date1+0(2) into date2.

Read only

Former Member
0 Likes
917

Hi

Use CONVERSION_EXIT_PDATE_INPUT

Regards

Raj.

Read only

gopi_narendra
Active Contributor
0 Likes
917

Use the FM CONVERT_DATE_TO_INTERNAL

Regards

Gopi

Read only

0 Likes
917

Hi,

I used this FM ,but it is not converting the my date formate can u check it once.

thanks&regds,

Sree.

Read only

0 Likes
917

HAve u tried this either CONVERSION_EXIT_PDATE_INPUT

I give 16.05.2008 and get 20080516 as output.

If not you can use the offsets

Date+4(4)

date+2(2)

date+0(2)

Regards

Gopi

Read only

Former Member
0 Likes
917

Hi,

CONVERSION_EXIT_PDATE_OUTPUT

DATE_CONVERT_TO_FACTORYDATE

DATE_GET_WEEK

DATE_COMPUTE_DAY

CONVERT_DATE_TO_ALPHA_NUMERIC

PERIOD_AND_DATE_CONVERT_INPUT

DATE_IN_FUTURE

SLS_MISC_GET_USER_DATE_FORMATDATE_CHECK_PLAUSIBILITY

CONVERT_DATE_TO_INTERN_FORMAT

Regards,

Shiva Kumar

Read only

Former Member
0 Likes
917

Hi,

Use concatenate statement.

data: date1 type sy-datum,

date2 type d.

date1 = '16-05-2008'.

concatenate date16 date13(2) date1+0(2) into date2.

write:/ date2.

Reward,if useful.

Thanks,

Chandu

Read only

Former Member
0 Likes
917

Hi,

just copy paste and run this code.

DATA:V_DATE1(10),

V_DATE(10).

V_DATE = '03032008'. "-----> format of mmddyyyy

concatenate V_DATE4(4) '.' V_DATE2(2)'.' V_DATE+0(2) into V_DATE1.

Write:V_DATE1. "-------> will be of the format yyyy.mm.dd

Or also try this:

parameters:p_date type d.

data: v_date1 type d.

.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = p_date

IMPORTING

DATE_INTERNAL = v_date1.

write:/ v_date1.

Hope this helps.

Reward Points if found helpfull..

Cheers,

Chandra Sekhar.

Read only

Former Member
0 Likes
917

Hi,

Declare that date in one varaible

gv_date = 10052008

gv_year = gv_date+4(4)

gv_mth = gv_date+2(2)

gv_dt = gv_date(2)

CONCATENATE gv_year gv_mth gv_dt into gv_newdate.

condense gv_newdate.

Variable gv_newdate this variable will now have the date in yyyymmdd format

Try this.............

Read only

Former Member
0 Likes
917

hi SnickyUcan,

 data : w_date type d.

W_DATe = sy-datum.

write:/  w_date.

if found helpfull do reward.

Regards.

Eshwar.

Read only

Former Member
0 Likes
917

Hi,

Please use FM CONVERT_DATE_TO_INTERNAL.

Thanks,

Sriram Ponna.