‎2006 Jun 15 2:34 PM
Hi ,
can any one tell me how to declare field for date . i have an excel sheet in which the date is like this
06/15/2006
when i declared internal table like
erdat like sy-datum its taking 6/15/200
can any body tell how to get the enite thing please let me know.
Thanks in advance.
‎2006 Jun 15 2:37 PM
swathi,
Declare
data erdat(10) type c.it will take 06/15/2006.
rgds,
TM.
‎2006 Jun 15 2:37 PM
Hai Swathi
declare like this
sy-datum '20060615'.
Thanks & regards
Sreeni
‎2006 Jun 15 2:37 PM
swathi,
Declare
data erdat(10) type c.it will take 06/15/2006.
rgds,
TM.
‎2006 Jun 15 2:38 PM
Then Swathi, you have to convert the date in the excel sheet to yyyymmdd format and then pass it to the sy-datum like variable.
‎2006 Jun 15 2:38 PM
‎2006 Jun 15 2:40 PM
Hi
Yes, thats because sy-datum is of type DATS having length 8. You need to declare a character field of length 10, upload your data and then move it to a date field.
Internally the date field will store the date as yyyymmdd so you can do something like this:
concatenate c16(4) c10(2) c1+3(2) into date. (where c1 is the char field)
Regards
Shounak
‎2006 Jun 15 2:53 PM
Hi Swathi,
Date declaration should be done as:
Ex:
date TYPE d VALUE '19980601'.
Regards.
Laxmi
‎2006 Jun 15 2:54 PM
Thanks guys.
I got the problem solved by declaring like
data : erdat(10) type c.
Thanks each and everyone for your valuable inputs.
‎2006 Jun 15 2:56 PM
Hi,
in your flat file change your date format <b>20060615</b>
or
in your internal table try to declare the erdate as
like this
data : begin of itab occurs 0,
....
<b> erdat(10),</b>
end of itab.Regards
vijay