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 Formatting Error

Former Member
0 Likes
1,773

Hi,

I am getting data from excel file and updating it to a custom table. I have date fields in it. When uploading it is looking fine, but in the Ztable it is storing differently.

I have a module pool for that table to change and delete the records, When I try to change or delete the record it is giving the error saying invalid date format.

Crdate and Efdate are defined in the Ztable as DATS and length 8.

In the excel it is like this,

crdate Efdate

7/2/2007 7/15/2007

7/2/2007 7/15/2007

ztable it is storing like this,

crdate Efdate

20/07/7/2/ /2/00/7/15

20/07/7/2/ /2/00/7/15

Can you please help me how to fix this.

Thanks,

Veni.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,176

When bringing from excel and then moving into ztable, you must convert the date fields into SAP internal format, which is YYYYMMDD There are a number of ways to achieve this. You can use the function module CONVERT_DATE_TO_INTERNAL , then move this formatted value into your ztable.

Regards,

Rich Heilman

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,177

When bringing from excel and then moving into ztable, you must convert the date fields into SAP internal format, which is YYYYMMDD There are a number of ways to achieve this. You can use the function module CONVERT_DATE_TO_INTERNAL , then move this formatted value into your ztable.

Regards,

Rich Heilman

Read only

0 Likes
1,176

Thank you Rich and Mg.

Regards,

Veni.

Read only

Former Member
0 Likes
1,176

once you get the data from the excel before storing in table, try to change the format of the dates from mm/dd/yyyy to YYYYMMDD and then update it.