Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Convert date!

I´ve a date like this: 08.05.2006

I wanna show it like 08 de Mayo de 2006 (it´s spanish)

Thanks !

Tags:
replied

Hi julio,

1. 08 de Mayo de 2006.

2. I have made in INDEPENDENT FORM Subroutine,

where we pass the date, and it returns in spanish,

eg. 08 de Mayo de 2006.

3. just copy paste in new program.

REPORT abc.

DATA : mname(25) TYPE c.

PARAMETER : d TYPE sy-datum default sy-datum.

PERFORM getmonth USING d mname.

WRITE :/ mname.

*----


*

*----


FORM getmonth USING d mname.

DATA : month_names LIKE t247 OCCURS 0 WITH HEADER LINE.

DATA : m(2) TYPE c.

m = d+4(2).

CALL FUNCTION 'MONTH_NAMES_GET'

EXPORTING

  • LANGUAGE = SY-LANGU

LANGUAGE = 'S'

  • IMPORTING

  • RETURN_CODE =

TABLES

month_names = month_names

EXCEPTIONS

month_names_not_found = 1

OTHERS = 2

.

READ TABLE month_names INDEX m.

IF sy-subrc = 0.

mname = month_names-ltx.

ENDIF.

concatenate d+6(2) 'de' mname 'de' d(4) into mname separated by space.

ENDFORM. "getmonth

regards,

amit m.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question