07-05-2006 6:08 AM
Hello experts,
I am using read_text in a loop and the long text that I will get has a value of like
06/05/1981-06/09/1983. Now I used split command to split the 2 dates at '-'. Suppose I
created 2 fields in a structure to hold those 2 dates, what will be its type? is datum?
Because when I run my report, the date shows like this:
06//05/19 or
06/05/198
Thanks again guys and take care!
07-05-2006 6:10 AM
type? is datum
no <b>declare it like char.</b>
data: date1<b>(10).</b>
now it work ine...
07-05-2006 6:10 AM
type? is datum
no <b>declare it like char.</b>
data: date1<b>(10).</b>
now it work ine...
07-05-2006 6:10 AM
07-05-2006 6:11 AM
If you want to move the dates as is (with the slashes separating the numbers), you will have to declare a char10 field. datum is a char 8 field and that is why the last 2 digits get truncated.
DATA: date1(10) type char.
Hope this helps.
Sudha
07-05-2006 6:11 AM
datum is 8 Char field , try to use 10 char field.
like date(10) type c.
regards
prabhu
07-05-2006 6:12 AM
Hi,
data : date like sy-datum.
data : date1(10).
CONCATENATE date6(2) '.' date4(2) '.' date+0(4) INTO date1.
hope it helps,
cheers,
Simha.
07-05-2006 6:14 AM
Hi,
In the internal table declare it as a character,
DATA: lv_date1(10),
lv_date2(10).
Regs,
Venkat Ramanan
07-05-2006 6:18 AM
Hi Viray,
Take two character fields of lengths 10 each and convert these two character fields into date by considering type SYDATUM.
DATA:
V_CHAR1(10),
V_CAHR2(10),
V_DATE1 TYPE SYDATUM,
V_DATE2 TYPE SYDATUM.
V_DATE = '06/05/1981-06/09/1983'.
SPILT V_DATE AT '-' INTO V_CHAR1 V_CHAR2.
CONCATENATE V_CHAR16(4) V_CHAR13(2) V_CHAR1+0(2) INTO V_DATE1.
CONCATENATE V_CHAR26(4) V_CHAR23(2) V_CHAR2+0(2) INTO V_DATE2.
Thanks,
Vinay
07-05-2006 6:18 AM
Hi,
Date fields are type d with the fixed length 8 and the internal representation YYYYMMDD (year, month, and day).
If u declare it as type datum or d, it will take only 8 chars in it. so declare a char variable of lenght 10.
DATA : ldate1(10) type c.
Rgds,
Prakash
07-05-2006 6:22 AM