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

query regarding date conversion

Former Member
0 Likes
1,105

if i give date 06111981

i need 06nov1981

i need 11 to be converted to nov

is there any function module.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,056

Use FM-CONVERSION_EXIT_LDATE_OUTPUT

Functionality

The function module determines the external language-dependent date format for an internal date.

Example

Defintion of the date format in the user master: DD.MM.YYYY

DATA: INT_DATUM LIKE SY-DATUM VALUE '19940102',

EXT_DATUM(11) TYPE C.

...

CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'

EXPORTING

INPUT = INT_DATUM

IMPORTING

OUTPUT = EXT_DATUM.

Result:

EXT_DATUM = 02.JANUARY.1994

Hope this Helps.

Regards

Vinayak

8 REPLIES 8
Read only

Former Member
0 Likes
1,056

HI,

Below is the pseudocode:


date+6(2) + function module result MONTH_NAMES_GET + date(4)

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
1,057

Use FM-CONVERSION_EXIT_LDATE_OUTPUT

Functionality

The function module determines the external language-dependent date format for an internal date.

Example

Defintion of the date format in the user master: DD.MM.YYYY

DATA: INT_DATUM LIKE SY-DATUM VALUE '19940102',

EXT_DATUM(11) TYPE C.

...

CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'

EXPORTING

INPUT = INT_DATUM

IMPORTING

OUTPUT = EXT_DATUM.

Result:

EXT_DATUM = 02.JANUARY.1994

Hope this Helps.

Regards

Vinayak

Read only

Former Member
0 Likes
1,056

use FM : CONVERSION_EXIT_IDATE_OUTPUT

Read only

rahulkavuri
Active Contributor
0 Likes
1,056

CONVERSION_EXIT_SDATE_OUTPUT

This will do the conversion for the month you wanted to, there was this similar kind of questions sometime back..

Check this thread

dont forget to award points for helpful answers

Read only

Former Member
0 Likes
1,056

hi use this...

DATA ldate(20).

CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'

EXPORTING

input = p_date

IMPORTING

OUTPUT = ldate.

regards,

venkat.

Read only

Former Member
0 Likes
1,056

CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'

EXPORTING

INPUT = INT_DATUM

IMPORTING

OUTPUT = EXT_DATUM.

Read only

Former Member
0 Likes
1,056

hi use this...

DATA ldate(20).

CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'

EXPORTING

input = sy-datum

IMPORTING

OUTPUT = ldate.

write:/ ldate.

regards,

venkat.

Read only

Former Member
0 Likes
1,056

Hi Sai,

Check this syntax ....

DATA : temp2 LIKE date1,

temp3(10),

temp_month(8),

v_budat TYPE sy-datum,

date(15) type c.

DATA : date1 TYPE d.

parameter : s_budat like sy-datum.

date1 = s_budat.

MOVE date1+4(2) TO temp2.

IF temp2 = '01'.

temp3 = 'Jan'.

ELSEIF temp2 = '02'.

temp3 = 'Feb'.

ELSEIF temp2 = '03'.

temp3 = 'Mar'.

ELSEIF temp2 = '04'.

temp3 = 'April'.

ELSEIF temp2 = '05'.

temp3 = 'May'.

ELSEIF temp2 = '06'.

temp3 = 'June'.

ELSEIF temp2 = '07'.

temp3 = 'July'.

ELSEIF temp2 = '08'.

temp3 = 'Aug'.

ELSEIF temp2 = '09'.

temp3 = 'Sept'.

ELSEIF temp2 = '10'.

temp3 = 'Oct'.

ELSEIF temp2 = '11'.

temp3 = 'Nov'.

ELSEIF temp2 = '12'.

temp3 = 'Dec'.

ENDIF.

CLEAR temp2.

MOVE date1+0(4) TO temp2.

concatenate s_budat6(2) temp3 s_budat0(4) into date separated by ' ' .

Write: date.

hope this will help you....

<b>plz reward if useful </b>

Regards,

Sunil kairam.

Edited by: sunil kairam on Mar 25, 2008 4:22 PM