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

Function module to change

Former Member
0 Likes
656

is any function module available to change the date format yyyy/mm/dd to yyyy/mm

Thanks

Kumar

3 REPLIES 3
Read only

Former Member
0 Likes
615

Hi Kumar,

Instead of using a funtion module you can directly convert to the required format.

data : lv_date1(10),

lv_date2(7).

lv_date1 = '2008/04/15'.

move lv_date1+0(7) to lv_date2.

now lv_date2 has the required format.

Regards,

Ravi G

Read only

Former Member
0 Likes
615

hi

i think you have to use offset for this you can try using this

data: v_datum(10) type c.

concatenate sy-datum+4(2) '/' sy-datum +2(2) .

write:/ v_datum.

Or u can try these FM

CONVERSION_EXIT_SDATE_OUTPUT,

CONVERSION_EXIT_LDATE_OUTPUT.

Hope its helpful

Read only

Former Member
0 Likes
615

Hey,

Go through this link,

http://sap.ittoolbox.com/code/archives.asp?d=3095&a=s&i=10

FORM CONVERT-DATE.

>

> SELECT SINGLE * FROM USR01 WHERE BNAME = SY-UNAME.

> CASE USR01-DATFM.

> WHEN '1' OR '2' OR '3'. "JJ.MM.AAAA

> WA_JJ = SY-DATUM(2).

> WA_MM = SY-DATUM+2(2).

> WA_AAAA = SY-DATUM+4(4).

> WHEN '4' OR '5' OR '6'. " AAAA.MM.JJ

> WA_JJ = SY-DATUM+6(2).

> WA_MM = SY-DATUM+4(2).

> WA_AAAA = SY-DATUM(4).

> ENDCASE.

> ENDFORM.