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: 

Changing system Date format

Former Member
0 Kudos

Hi all,

My SAP system is generating date format as 15.05.2005.., in my table I have to update fields with Sy-datum... in this case field format should be DDMMYY...... do you have any solution for this.

Thanks & Regards

R Nittala.

4 REPLIES 4

former_member214131
Active Contributor
0 Kudos

Hello,

Have a look at FM CONVERT_DATE_TO_INTERNAL before table update.

Regds, Murugesh AS

Former Member
0 Kudos

Easiest would be as below


concatenate sy-datum+6(2)
            sy-datum+4(2)
            sy-datum+2(2)
       into v_myfield.

Regards,

Srinivas

former_member183804
Active Contributor
0 Kudos

Hello Rajesh,

the display format e.g. 15.05.2005 is a user setting. You may change this via the menu 'user data/own data/fixed values/date format'.

The ABAP runtime internally uses the format 'YYYYMMDD'. When using standard screen io (list, dynpros, ALV, BSP, Web Dynpro ..) the runtime system converts the internal representation to the display one. So normally you do not need to do a explicit conversion. One exception maybe the import of legacy data.

Best Regards

Klaus

Former Member
0 Kudos

Hi,

Try this out.

  • Using the WRITE statement

***************************

data: gd_date(10). "field to store output date

  • Converts date from 20020901 to 01.09.2002

write sy-datum to gd_date dd/mm/yyyy.

  • Converts date from 20020901 to 01.09.02

write sy-datum to gd_date dd/mm/yy.

  • Using data manipulation techniques

************************************

data: gd_date(8). "field to store output date

  • Converts date from 20010901 to 01092001

gd_date(2) = sy-datum+6(2).

gd_date2(2) = sy-datum4(2).

gd_date+4(4) = sy-datum(4).

Thanks & Regards,

Judith.