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: 

Need a FM to convert date into another format

Former Member
0 Kudos

Need a Function Module that will convert the date that is in the formate of 10-08-2007 to be converted to 10th August 2007.

Please sugguest.

9 REPLIES 9

Former Member
0 Kudos

Hi,

Check these,

CONVERT_DATE_TO_INTERN_FORMAT

CONVERT_DATE_TO_EXTERNAL

Reward if useful!

Former Member
0 Kudos

Hi Dolly

code like this

day = date + 0(2)

month = date + 3(2)

year date + 6(4).

case month.

when '01'.

mon = 'january'.

when '02'.

mon= 'february'.

etc....

endcase.

concatenate day 'th' ' ' mon ' ' year into output.

write:/ output.

reward points to all helpful answers

kiran.M

former_member194669
Active Contributor
0 Kudos

Hi,

CONVERSION_EXIT_IDATE_OUTPUT

 
data:lcdate(11).
 
call function 'converstion_exit_idate_output'
exporting
input = sy-datum
importing
output = lcdate.
 
concatenate lcdate(2) lcdate+2(3) lcdate+5(4) into lcdate seperated by '-'.

--lcdate is your required format.

sample data ..sy-datum = 20060830

lcdate = 30-AUG-2006

aRs

0 Kudos

Thank you. My query is solved

Former Member
0 Kudos

hi

good

do like this

take a character variable of length as 8 and initialize it with the format as you want and store your current format into this format and display it.

thanks

mrutyun^

Former Member
0 Kudos

hi,

Use this CONVERSION_EXIT_SDATE_OUTPUT....

Former Member
0 Kudos

Hi,

Someother function modules are,

CONVERSION_EXIT_IDATE_INPUT External date INPUT conversion exit (e.g. 01JAN1994)

CONVERSION_EXIT_IDATE_OUTPUT External date OUTPUT conversion exit (e.g. 01JAN1994)

CONVERSION_EXIT_LDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)

CONVERSION_EXIT_SDATE_INPUT External date (e.g. 01.JAN.1994) INPUT conversion exit

CONVERSION_EXIT_SDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)

CONVERT_DATE_TO_EXTERNAL Conversion: Internal to external date (like screen conversion)

CONVERT_DATE_TO_INTERNAL Conversion: External to internal date (like screen conversion)

CONV_EXIT_LDATE_OUTPUT_LANGU

Former Member
0 Kudos

Hi,

Try with this code:

DATA: ZTEMP(9),zdd(2),zmmm(3),zyyyy(4),zfinal(12), v_date like sy-datum.

CLEAR: ZTEMP, ZDD, ZMMM, ZYYYY.

v_date = sy-datum.

CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'

EXPORTING

INPUT = v_date

IMPORTING

OUTPUT = ZTEMP.

write ztemp.

Regards,

Bhaskar

Former Member
0 Kudos

Thank you all my query is answered.