2007 Jan 10 7:51 AM
Hello
Does anybody know a function module to convert the date format from 10.01.2007 to January 10th of 2007?
Is it possible?
10nks!!
Gabriel P.
2007 Jan 10 7:53 AM
hi,
chk this.
DATA: DATE_CHAR(20).
DATA: DATE TYPE SY-DATUM.
DATA: MONTH_NAME LIKE T247-LTX.
DATE = SY-DATUM.
SELECT SINGLE LTX FROM T247
INTO MONTH_NAME
WHERE SPRAS = SY-LANGU
AND MNR = SY-DATUM+4(2).
CONCATENATE SY-DATUM+6(2) MONTH_NAME SY-DATUM(4)
INTO DATE_CHAR SEPARATED BY SPACE.
WRITE: / DATE_CHAR.
Regards
Anver
2007 Jan 10 7:59 AM
2007 Jan 10 8:15 AM
hi Gabriel,
Try this way ..
* Using Function modules
************************
data: gd_date(8). "field to store output date
* Converts date from 20010901 to 01SEP2001
gd_date = sy-datum.
CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'
EXPORTING
input = gd_date
IMPORTING
OUTPUT = gd_date.
2007 Jan 10 9:16 AM
Hi,
Check this code,
Suppose a date is given in the format 20050428 how to get the output in the format 28th Apr 2005.
FORM set_text_date.
DATA: month(9),
year(4),
date(2).
CASE p_frd+4(2).
WHEN '01'.
month = 'January'.
WHEN '02'.
month = 'February'.
WHEN '03'.
month = 'March'.
WHEN '04'.
month = 'April'.
WHEN '05'.
month = 'May'.
WHEN '06'.
month = 'June'.
WHEN '07'.
month = 'July'.
WHEN '08'.
month = 'August'.
WHEN '09'.
month = 'September'.
WHEN '10'.
month = 'October'.
WHEN '11'.
month = 'November'.
WHEN '12'.
month = 'December'.
WHEN OTHERS.
ENDCASE.
WRITE p_frd+0(4) TO year.
WRITE p_frd+6(2) TO date.
CONCATENATE month date ',' year INTO return_date SEPARATED BY space.
CONDENSE return_date.
ENDFORM.
http://www.sap-img.com/abap/abap-program-output-of-date-format.htm