2008 Feb 14 12:54 PM
Hi Experts,
I am using following Fm to calculate date difference.....
call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
exporting
i_date_from = wa_draw-zdm_vld_to_dat
i_date_to = sy-datum
importing
e_days = v_days.
if sy-subrc = 0 .
if v_days > 0.
-
-
But value of field zdm_vld_to_dat (data type DATS , YYYYMMDD) in database tables itself is wrong ...like ct/-0/29-o
I want to avoid passing these wrong data entry, in the FM...as also i give info message for this in spool.
So can anybody tel me How can I detect or know this fields zdm_vld_to_dat conatins wrong date other than YYYYMMDD...e.g.
ct/-0/29-o means any charecter or hyphen
Thank you.
2008 Feb 14 1:04 PM
Just use this FM CONVERT_DATE_TO_INTERNAL if the date what you have given is correct then it will convert to your format. other wise skip that record or pass error msg.
Hi Experts,
I am using following Fm to calculate date difference.....
call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
exporting
i_date_from = wa_draw-zdm_vld_to_dat
i_date_to = sy-datum
importing
e_days = v_days.
if sy-subrc = 0 .
if v_days > 0.
-
-
But value of field zdm_vld_to_dat (data type DATS , YYYYMMDD) in database tables itself is wrong ...like ct/-0/29-o
I want to avoid passing these wrong data entry, in the FM...as also i give info message for this in spool.
So can anybody tel me How can I detect or know this fields zdm_vld_to_dat conatins wrong date other than YYYYMMDD...e.g.
ct/-0/29-o means any charecter or hyphen
Thank you.
2008 Feb 14 1:04 PM
Just use this FM CONVERT_DATE_TO_INTERNAL if the date what you have given is correct then it will convert to your format. other wise skip that record or pass error msg.
2008 Feb 14 1:04 PM
Hi Nilesh Hiwale,
1. First thing is there is no need for any function module for difference between two dates
See this.
Data:
days type i
date1 type wa_draw-zdm_vld_to_dat
date2 type sy-datum.
days = date2 - date1.
Write / days.
> (OR)
2. write this condition in PAI module of your screen.
At selection-screen.
if date1 cn '1234567890'. or date2 cn '123456789'.
write e000(Sabapdocu) with 'Enter YYYYMMDD Formate'.
endif.
Reward if it is useful,
Mahi.