Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

converting date format from 14/07/08 to 14-jul-08

tanuja_wa
Explorer
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Check this.

[https://forums.sdn.sap.com/click.jspa?searchID=16851075&messageID=6116343]

Rhea.

bpawanchand
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Siya

Check the function group SCA1.

Thanks

Shivika

tanuja_wa
Explorer
0 Kudos

Thank you all for replaying.

My problem is solved .