‎2007 Jun 18 6:48 AM
How do i create a function module that imports date in a system format and displays the output in the following format:
Input date : 12/31/9999
Output date: 31st December 9999
‎2007 Jun 18 6:50 AM
Hi,
Try this,
Use FM ISP_GET_MONTH_NAME and the values to it like this and use concatanate to the same
Import parameters Value
DATE 20.02.2007
LANGUAGE EN
MONTH_NUMBER 00
Export parameters Value
LANGU_BACK EN
LONGTEXT February
SHORTTEXT FEB
Thanks.
‎2007 Jun 18 6:52 AM
Hi,
date3 EQ 'X'. "The date format is like 31 apr, 2007
CONDENSE temp_date NO-GAPS.
SPLIT i_date AT ',' INTO daymonth year.
IF STRLEN( year ) NE '4'.
error = 'X'.
WRITE : 'Invalid date format.'.
ELSE.
daymonth1 = daymonth.
CONDENSE daymonth1 NO-GAPS.
SHIFT daymonth1 LEFT BY 2 PLACES.
CONDENSE daymonth1 NO-GAPS.
month = daymonth1.
CONDENSE month NO-GAPS.
TRANSLATE month TO UPPER CASE.
SORT t_month BY monthstx.
MOVE month to mon.
READ TABLE t_month WITH KEY monthstx = mon.
IF sy-subrc <> 0.
error = 'X'.
WRITE : 'Invalid date format.' .
ELSE.
CONDENSE daymonth NO-GAPS.
day = daymonth+0(2).
CONDENSE day NO-GAPS.
CONCATENATE year t_month-monthnumber day INTO o_date.
ENDIF.
<b>Reward points</b>
Regards
‎2007 Jun 18 7:04 AM
Hi,
You may use FM DAY_ATTRIBUTES_GET with input date in dd.mm.yyyy format.
So you first need to convert the date from mm/dd/yyy to format dd.mm.yyyy by using the string operations & then use the above mentioned FM.
I hope this helps,
Regards,
Raju Chitale