09-29-2008 11:50 AM
hi all ,
i want to convert date format from 14/07/08 to 14-jul-08 . is there any function module for this ?.
kindly reply.
regards,
siya
09-29-2008 11:52 AM
Hi Siva,
Check the code below.
For getting date format in the form like 10.Dec.2008*
WHEN '01'.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
input = date2
IMPORTING
output = date_format.
IF sy-subrc EQ 0.
date_format1 = date_format.
ENDIF.
For getting date in the format like 10.December.2008*
WHEN '02'.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
input = date2
IMPORTING
output = date_format.
IF sy-subrc EQ 0.
Get Month Long text
SELECT SINGLE ltx
FROM t247 INTO ws_month
WHERE ktx EQ date_format+3(3)
AND spras EQ 'E'.
IF sy-subrc EQ 0.
CONCATENATE date_format0(2) ws_month date_format7(4) INTO date_format1 SEPARATED BY space.
ENDIF.
ENDIF.
Hope this helps,
Manish
09-29-2008 11:52 AM
Hi Siva,
Check the code below.
For getting date format in the form like 10.Dec.2008*
WHEN '01'.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
input = date2
IMPORTING
output = date_format.
IF sy-subrc EQ 0.
date_format1 = date_format.
ENDIF.
For getting date in the format like 10.December.2008*
WHEN '02'.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
input = date2
IMPORTING
output = date_format.
IF sy-subrc EQ 0.
Get Month Long text
SELECT SINGLE ltx
FROM t247 INTO ws_month
WHERE ktx EQ date_format+3(3)
AND spras EQ 'E'.
IF sy-subrc EQ 0.
CONCATENATE date_format0(2) ws_month date_format7(4) INTO date_format1 SEPARATED BY space.
ENDIF.
ENDIF.
Hope this helps,
Manish
09-29-2008 11:54 AM
Hi,
Check this.
[https://forums.sdn.sap.com/click.jspa?searchID=16851075&messageID=6116343]
Rhea.
09-29-2008 11:55 AM
Hi
DATA :
w_d1 TYPE d,
w_d2 TYPE string.
w_d1 = sy-datum.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
input = w_d1
IMPORTING
output = w_d2.
write :
/ w_d2.
regards
pavan
09-29-2008 11:56 AM
09-29-2008 11:57 AM