Application Development and Automation 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: 
Read only

date format

Former Member
0 Likes
754

Hi experts,

Is there any FM existing to convert

25-APR-06 this date format to <b>25.04.2006</b>.

Reward guaranteed

thanks

kaki

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
701

Use these function module

25-APR-06.. separator here should be in ur own system format

CONVERSION_EXIT_SDATE_INPUT

to convert to sy-datum format..

now pass the this date to

CONVERSION_EXIT_PDATE_OUTPUT

to get 25.04.2006 format

Regards,

Viven

5 REPLIES 5
Read only

Former Member
0 Likes
701

Hi kaki,

1. There is no direct FM for it.

2. But using some logic, we have to

convert it by ourselves.

3. The main tricky part

is getting the MONTH NAME

4. This code will help u a little,

for getting atleast, the month name.

5.

MONTH_NAMES_GET

This is the FM

try this code ( just copy paste)

REPORT abc.

DATA : mname(10) TYPE c.

PARAMETER : d TYPE sy-datum.

PERFORM getmonth USING d mname.

WRITE 😕 mname.

&----


*& Form getmonth

&----


  • text

----


  • -->M text

  • -->MNAME text

----


FORM getmonth USING d mname.

DATA : month_names LIKE t247 OCCURS 0 WITH HEADER LINE.

DATA : m(2) TYPE c.

m = d+4(2).

CALL FUNCTION 'MONTH_NAMES_GET'

  • EXPORTING

  • LANGUAGE = SY-LANGU

  • IMPORTING

  • RETURN_CODE =

TABLES

month_names = month_names

EXCEPTIONS

month_names_not_found = 1

OTHERS = 2

.

READ TABLE month_names INDEX m.

IF sy-subrc = 0.

mname = month_names-ltx.

ENDIF.

ENDFORM. "getmonth

regards,

amit m.

Read only

0 Likes
701

CHECK...

<b>CONVERSION_EXIT_SDATE_INPUT</b>

EX-

give input as 20nov2006

output-20112006

Read only

0 Likes
701

Thanks for all the replies...

Thank you viven chandar

fullpoints alloted

cheers

kaki

Read only

Former Member
0 Likes
701

Hi,

There is no FM...

Sreedhar

Read only

Former Member
0 Likes
702

Use these function module

25-APR-06.. separator here should be in ur own system format

CONVERSION_EXIT_SDATE_INPUT

to convert to sy-datum format..

now pass the this date to

CONVERSION_EXIT_PDATE_OUTPUT

to get 25.04.2006 format

Regards,

Viven