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

FM needed

Former Member
0 Likes
688

Hi All,

I want a FM which will convert date format from MM/DD/YY to MM/DD/YYYY.please help.

Regards,

Jeetu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
648

HI,

use one of these fms:

CONVERSION_EXIT_INVDT_INPUT Conversion exit routine for inverted date (INPUT)

CONVERSION_EXIT_INVDT_OUTPUT Conversion exit routine for inverted date (OUTPUT)

Sample Usage:

CALL FUNCTION 'CONVERSION_EXIT_INVDT_OUTPUT'

EXPORTING

INPUT = TCURR-GDATU

IMPORTING

OUTPUT = DATE.

Regards

Sudheer

4 REPLIES 4
Read only

Former Member
0 Likes
648

Hi

If you have a variable with that format u can only to rewrite it:

DATE_OUT = DATE_IN(6).

DATE_OUT+6(2) = '20'.

DATE_OUT8(2) = DATE_IN6(2).

Max

Read only

Former Member
0 Likes
648

Hi,

This can be done using the EDIT mask functionality, refer the code below,

data: lv_datum(10).

WRITE sy-datum TO LV_DATUM USING EDIT MASK '__/__/____'.

Hope this helps,

Rgds,

Read only

0 Likes
648
DATA V_MMDD(10).
DATA V_DATE(8) value '12/02/06'.
data: year(4).
year = sy-datum+0(4).
CONCATENATE V_DATE+4(2) V_DATE+6(2)  year INTO V_MMDD SEPARATED BY '/' .

WRITE V_MMDD.
Read only

Former Member
0 Likes
649

HI,

use one of these fms:

CONVERSION_EXIT_INVDT_INPUT Conversion exit routine for inverted date (INPUT)

CONVERSION_EXIT_INVDT_OUTPUT Conversion exit routine for inverted date (OUTPUT)

Sample Usage:

CALL FUNCTION 'CONVERSION_EXIT_INVDT_OUTPUT'

EXPORTING

INPUT = TCURR-GDATU

IMPORTING

OUTPUT = DATE.

Regards

Sudheer