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 format

Former Member
0 Kudos

if the given date format is mmddyy.if the required date format is 20yymmdd then what is the code.

ex:----

given date 021208

req date 20080212

what is the code?

6 REPLIES 6

Former Member
0 Kudos

Hi,

The format u require is of the sy-datum format.

USe concatenate statemnt to get the required one.

Reward if useful.

Regards,

Mansi.

Former Member
0 Kudos

TABLES: T247.

DATA: V_DATE TYPE SYDATUM.

DATA: V_STRING(20).

V_DATE = SY-DATUM.

SELECT SINGLE * FROM T247

WHERE SPRAS = SY-LANGU

AND MNR = V_DATE+4(2).

IF SY-SUBRC = 0.

CONCATENATE V_DATE+6(2) '-' T247-KTX '-' V_DATE(4)

INTO V_STRING.

WRITE: / V_STRING.

ENDIF.

or

make use of this FM

CONVERSION_EXIT_IDATE_OUTPUT

and see its documentation.

or

/: SET DATE MASK = 'DD-MMM-YYYY'

&DATE&

check with this.

if it is not working try to give space between DD and MMM and YYYY

all of the three work...choose whichever suits u

or----


FMs

'CONVERSION_EXIT_LDATE_OUTPUT'

CONVERSION_EXIT_SDATE_OUTPUT

Reward if useful

Narendra

Former Member
0 Kudos

Dear Bharath,

Try out with this.

data: d(6) type n value '120208'.

data: i1 type i,

i2 type i,

i3 type i,

i4(8) type n.

write:/ 'date:', d.

i1 = d+0(2).

i2 = d+2(2).

i3 = d+4(2).

concatenate '20' d4(2) d2(2) d+0(2) into i4.

write:/ 'date after formatting', i4.

reward points if u success with this.

Former Member
0 Kudos

Hi,

try this code,

Sy-datum contains 021208. Then use this statement

Concatenate ‘20’ sy-datum4(2) sy-datum0(2) sy-datum+2(2).

Reward points,if it is useful.

Thanks,

chandu.

Former Member
0 Kudos

Hi Bharath

check out this function module ...

it wil be useful for u...

CONVERT_DATE_TO_INTERNAL

this function module will convert the format ddmmyy into yyyymmdd.

Regards,

Sivappriya.

Former Member
0 Kudos

use the function module

CONVERT_DATE_TO_INTERNAL

pass date as 021208

you will get out put as 20080228

check for the system internal date format.