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 required

Former Member
0 Likes
393

HI,

Is there any function module or way to convert the date in this format "21st day of april 2008".

Thanks.

2 REPLIES 2
Read only

Former Member
0 Likes
367

Try this function module.

CONVERSION_EXIT_SDATE_OUTPUT

or

CONVERSION_EXIT_IDATE_OUTPUT

Use CONVERSION_EXIT_SDATE_OUTPUT to get the month name,

but it will give short form of the month name.

if you want long description of the month,

use this peice of code.

PARAMETERS: V_DATUM(07) TYPE C. "(example input:12-2007)

DATA: V_MON(2) TYPE C,

V_YEAR(4) TYPE C,

V_MONTHNAME(10) TYPE C,

V_FULLDATE(30) type c.

WRITE V_DATUM+0(2) TO V_MON.

SELECT SINGLE LTX FROM T247 INTO V_MONTHNAME

WHERE SPRAS = SY-LANGU

AND MNR = V_MON.

CONCATENATE V_MONTHNAME v_datum+3(4)

INTO V_FULLDATE SEPARATED BY SPACE. "(example output : December 2007)

write: v_fulldate.

Reawrd points if useful

Read only

Former Member
0 Likes
367

Hi,

something like dis

  data date type char30.
  data mn   type T247-KTX.

CALL FUNCTION 'ISP_GET_MONTH_NAME'
  EXPORTING
    DATE               = sy-datum
    language           = sy-langu
  IMPORTING
    SHORTTEXT          = mn.

concatenate sy-datum+6(2) mn sy-datum+0(4) into date.

write date USING edit mask '__st day of ___ ____'.

Cheers,

jose.