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 Format

Former Member
0 Likes
1,215

Hi,

Is there any function module to convert date from 5-12-2008 to 2008-12-05?

Please help ..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,188

Hi,

Use these function modules for any date format conversions.

CONVERSION_EXIT_PDATE_INPUT,

CONVERT_DATE_TO_INTERN_FORMAT,

CONVERT_DATE_FORMAT,

CONVERT_DATE_TO_EXTERNAL,

CONVERT_DATE_TO_INTERNAL,

CONVERT_DATE_INPUT.

Regards,

Jagadish

12 REPLIES 12
Read only

Former Member
0 Likes
1,189

Hi,

Use these function modules for any date format conversions.

CONVERSION_EXIT_PDATE_INPUT,

CONVERT_DATE_TO_INTERN_FORMAT,

CONVERT_DATE_FORMAT,

CONVERT_DATE_TO_EXTERNAL,

CONVERT_DATE_TO_INTERNAL,

CONVERT_DATE_INPUT.

Regards,

Jagadish

Read only

0 Likes
1,188

hey which function module to use for yyyymmdd???

Read only

0 Likes
1,188

i dnt understand why you need to use a FM.

U can alwys use SYSTDATLO system variable to change the

date in internal format.

Hope it helps

Read only

Former Member
0 Likes
1,188

is the form 2008-12-05 your internal system date?

then you can use SYSTTIMLO to convert it in internal format.

Also if you can check

RKE_TIMESTAMP_CONVERT_OUTPUT

Hope it helps

Read only

Former Member
0 Likes
1,188

Hi,

Use the Function module CONVERSION_EXIT_PDATE_INPUT which Resolves your

Requirement.

Reward if useful.

Regards

Raj.

Read only

Former Member
0 Likes
1,188

date_old = 2008-05-27

day = date_old+8(2)

month = date_old+5(2)

year = date_old(4)

concatenate day '-' month '-' year into date_new.

Read only

Former Member
0 Likes
1,188

Hello,

you can use edit mask 'yyyymmdd'.

(or)

Check the below code :

data v_mdate(8) type c.

data : v_date(8) type c,

v_day(2) type c,

v_mon(2) type c,

v_year(4) type c.

start-of-selection.

v_mdate = '01012007'." to 20070101

v_year = v_mdate+4(4).

v_mon = v_mdate+2(2).

v_day = v_mdate+0(2).

concatenate v_year v_mon v_day into v_date.

write:/ v_date.

***************Reward points,if found useful

Read only

0 Likes
1,188

thanks fr the helpful answer.

please tell me how to prefix 0 to 5-12-2008?

using concatenate??

please help...

Read only

0 Likes
1,188

Hi,

Define output type as sy-datum.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
1,188

Hi Poonam,

Check this out

CONVERSION_EXIT_PDATE_INPUT

- Conversion Exit for Domain GBDAT: DD/MM/YYYY -> YYYYMMDD

Read only

0 Likes
1,188

its for mm/dd/yyyy.

Read only

Former Member
0 Likes
1,188

date_old(10) type c value '27-05-2008'.

date new(10) type c.

day = date_old+2(2)

month = date_old+3(2)

year = date_old+6(4)

concatenate year '-' month '-' day into date_new.