03-05-2008 10:01 PM
Hi All!
How can I convert currDate -> SYSTDATLO or DATS
e.g.
data currDate(10) type c value '01.09.2007'.
Bye
sas
03-05-2008 10:11 PM
I am not sure whether there is a FM which converts date from dd.mm.yyyy to yyyymmdd. Otherwise you have to manually convert dd.mm.yyyy to yyyymmdd format to do the comparison.
Split date1(which has dd.mm.yyyy) into date month year at '.'.
Then
Concatenate year month date into date2.
Now date2 has the format yyyymmdd. It can be compared witht he other date.
Hope this helps.
Thanks,
Naren
03-05-2008 10:11 PM
I am not sure whether there is a FM which converts date from dd.mm.yyyy to yyyymmdd. Otherwise you have to manually convert dd.mm.yyyy to yyyymmdd format to do the comparison.
Split date1(which has dd.mm.yyyy) into date month year at '.'.
Then
Concatenate year month date into date2.
Now date2 has the format yyyymmdd. It can be compared witht he other date.
Hope this helps.
Thanks,
Naren
03-05-2008 10:17 PM
Hi there,,
Try the following code,, this will resolve your issue.
data currDate(10) type c value '01.09.2007'. " mm.dd.yyyy
data : v_date like sy-datum.
concatenate currDate6(4) currdate3(2) currdate+0(2) into v_date.
write:/ v_date.
03-05-2008 10:22 PM
hi,
you can use this FM as follows:
data currDate(10) type c value '01.09.2007'.
data v TYPE DATS.
START-OF-SELECTION.
WRITE CURRDATE TO V.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
DATE_EXTERNAL = currdate
ACCEPT_INITIAL_DATE =
IMPORTING
DATE_INTERNAL = v
EXCEPTIONS
DATE_EXTERNAL_IS_INVALID = 1
OTHERS = 2
.
it will give what you want .
03-05-2008 10:31 PM
Rahul thanks but this is not working. It is dumping
thx
sas
data tmstmp type TZNTSTMPS.
data currDate(10) type c value '01.09.2007'.
data : v_date type dats.
concatenate currDate6(4) currdate3(2) currdate+0(2) into v_date.
CALL FUNCTION 'ABI_TIMESTAMP_CONVERT_INTO'
EXPORTING
iv_date = v_date
iv_time = '00:00:00'
IMPORTING
EV_TIMESTAMP = tmstmp .