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: 

Date Conversion Required

Former Member
0 Kudos

Dear All,

I want to convert my date 01.01.2007 into 01-Jan-2007.

The exact reverse process of FM 'CONVERSION_EXIT_SDATE_INPUT'.

Please Help!

Thanks!

12 REPLIES 12

Former Member
0 Kudos

Hi Dev,

Check this Sample code,

DATA V_MONTH(11).

CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'

EXPORTING

INPUT = SY-DATUM

IMPORTING

OUTPUT = V_MONTH.

WRITE:/ 'CURRENT MONTH IN WORDS:', V_MONTH+3(8).

Thanks,

Reward If Helpful.

Former Member
0 Kudos

Hi,

Refer to the following code:

FORM set_text_date.

DATA: month(9),

year(4),

date(2).

CASE p_frd+4(2).

WHEN '01'.

month = 'January'.

WHEN '02'.

month = 'February'.

WHEN '03'.

month = 'March'.

WHEN '04'.

month = 'April'.

WHEN '05'.

month = 'May'.

WHEN '06'.

month = 'June'.

WHEN '07'.

month = 'July'.

WHEN '08'.

month = 'August'.

WHEN '09'.

month = 'September'.

WHEN '10'.

month = 'October'.

WHEN '11'.

month = 'November'.

WHEN '12'.

month = 'December'.

WHEN OTHERS.

ENDCASE.

WRITE p_frd+0(4) TO year.

WRITE p_frd+6(2) TO date.

CONCATENATE month date ',' year INTO return_date SEPARATED BY space.

CONDENSE return_date.

ENDFORM.

Hope this helps.

Reward if helpful.

Regards,

Sipra

Former Member
0 Kudos

why dont you try

'CONVERSION_EXIT_SDATE_OUTPUT'

regards

shiba dutta

rainer_hbenthal
Active Contributor
0 Kudos

case date+3(02).

when '01'. month = '-JAN'.

when....

endcase.

concatenate date0(02) month date6(04) into date in character mode.

Former Member
0 Kudos

Check this "CONVERSION_EXIT_SDATE_OUTPUT"

Former Member
0 Kudos

Former Member
0 Kudos

check this link.may be help ful.

reward if useful.

Former Member
0 Kudos

Look at the Function modules CONVERT_DATE_TO_INTERNAL or CONVERT_DATE_TO_EXTERNAL.

If the aboe are not useful, then you need to do it manually. just take date, Month and year in 3 fields and concatenate the same into another date field with the correct format.

Eg2:

data: v_date(8) type c.

call function 'CONVERT_DATE_TO_INTERNAL'

exporting

date_external = '12.12.2006'

importing

date_internal = v_date.

write:/ v_date.

Reward points..

0 Kudos

To Murali Poli .

Read the question first.

harimanjesh_an
Active Participant
0 Kudos

hi dev,

use this conversion exit......

<b>CONVERSION_EXIT_IDATE_OUTPUT</b>

Example

DATA: INT_DATUM LIKE SY-DATUM VALUE '19940102',

EXT_DATUM(11) TYPE C.

...

<b>CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'

EXPORTING

INPUT = INT_DATUM

IMPORTING

OUTPUT = EXT_DATUM.</b>

Result:

<b>

EXT_DATUM = 02JAN1994</b>

i hope this is what u required........

reward me if useful....

Harimanjesh AN

Former Member
0 Kudos

please see the function modules

CONVERSION_EXIT_IDATE_INPUT

CONVERSION_EXIT_IDATE_OUTPUT

Former Member
0 Kudos

hi,

Use the fun module

DATE_TO_DAY to get the description of the DAY for that date

Use the fun Module

IDWT_READ_MONTH_TEXT to get the MONTH Text

regards

siva