‎2008 May 21 5:20 PM
hi guruz,
i need to convert one date format into another.
example like followings.
Date format required: Month DD, YYYY (i.e. April 30, 2008).
30/4/2008 or sydatum --> April 30, 2008.
is there any Function modlue for that,or please tell me another way.
warm regrds.
‎2008 May 21 8:23 PM
DATA: V_INPUT(8) VALUE '20112006'.
DATA: V_CHAR(25).
data: date type sydatum.
DATA: MONTH_NAMES LIKE T247.
SELECT SINGLE * FROM T247
INTO MONTH_NAMES
WHERE SPRAS = SY-LANGU
AND MNR = V_INPUT+2(2).
CONCATENATE V_INPUT(2) MONTH_NAMES-KTX V_INPUT+4(4)
INTO V_CHAR SEPARATED BY SPACE.
write: / V_CHAR.
‎2008 May 21 5:26 PM
‎2008 May 21 5:27 PM
‎2008 May 21 5:38 PM
Date format required: Month DD, YYYY (i.e. April 30, 2008).
30/4/2008 or sydatum --> April 30, 2008.
U can try this..
case date+4(02).
when '01'.
v_month = 'January'.
when '02'.
v_month = 'February'.
*write the other 10.
.
.
endcase.
Concatenate v_month
date+4(2)
','
date(04)
into new_date
separated by space.
‎2008 May 21 6:07 PM
Hello,
To get the month names you can use th fm MONTH_NAMES_GET.
DATA: lv_date TYPE d,
lv_month TYPE n LENGTH 2,
lv_desc TYPE string,
lt_months TYPE TABLE OF t247.
FIELD-SYMBOLS:
<fs_months> LIKE LINE OF lt_months.
lv_date = sy-datum.
CALL FUNCTION 'MONTH_NAMES_GET'
TABLES
month_names = lt_months
EXCEPTIONS
month_names_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
RETURN.
ENDIF.
lv_month = lv_date+4(2).
READ TABLE lt_months WITH KEY mnr = lv_month ASSIGNING <fs_months>.
IF <fs_months> IS ASSIGNED.
CONCATENATE <fs_months>-ltx lv_date+6(2) ', ' lv_date(4) INTO lv_desc SEPARATED BY SPACE.
ENDIF.
Regards,
‎2008 May 21 8:23 PM
DATA: V_INPUT(8) VALUE '20112006'.
DATA: V_CHAR(25).
data: date type sydatum.
DATA: MONTH_NAMES LIKE T247.
SELECT SINGLE * FROM T247
INTO MONTH_NAMES
WHERE SPRAS = SY-LANGU
AND MNR = V_INPUT+2(2).
CONCATENATE V_INPUT(2) MONTH_NAMES-KTX V_INPUT+4(4)
INTO V_CHAR SEPARATED BY SPACE.
write: / V_CHAR.