‎2008 Mar 27 7:05 PM
I've used this function successfully in the past for date calculations. However, it only accepts parameters for days to calculate that are of two digits in length. Is there any other function out there with the same functionality, but will accept parameters greater than 2 digits in length?
‎2008 Mar 27 7:17 PM
Hi Heather,
But why do you want 3 digits??
because when it exceeds 31 days , increase the month...
if you want to subtract/add only no of days
then try this
date + no of days
20080327 + 125
‎2008 Mar 27 7:21 PM
That function module requires you to use years, days and months, rather than one unit like days.
But I guess you could always write your own very simple routine.
REPORT zz_temp.
data: g_today type d.
data: g_future type d.
g_today = sy-datum.
g_future = g_today + 333.
write g_future.
‎2008 Mar 27 7:27 PM
data: v_date_store type sy-datum.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = sy-datum
days = 10
months = 00
signum = '+'
years = 00
IMPORTING
calc_date = v_date_store.
write:/ v_date_store.
see the date range is only 1-31 means 2 char field , why u require the 3 char field like..
regards,
venkat
‎2008 Mar 27 7:39 PM
I require a longer field because I'm pulling it from a table with master data (and can't control the users to only enter in a 2 character long field). Just hoping that I wouldn't have to code around this - and that there would be another option.
‎2008 Mar 27 8:00 PM
hi if you pass more than the 2 chars it shows a type conflict in the fm and it will give the dump..so do like this..
if u had a field of length 7 .
data:p_date(2) type c.
data: v_data(7) type c value '1234567'.
if u want to pass the 2 char value use the offset condition..
p_date = v_data+0(2) .
or
p_date = v_date+5(2).
or if it a table field ..
v_test = itab-field.
p_date = v_test+0(2).
regards,
venkat.
‎2008 Jun 12 4:29 PM
Hi Heather,
Were you able to resolve this issue. I have a similar situation where I would need to calculate an end date on the basis of a start date and the number of days between the start and end dates and the number of days could be any length. One solution would be to parse the number of days internally by splitting it into days, months and years and pass it to the afore mentioned Function Module. Did you find a way to do this?
Thanks,
Puja.
‎2008 Jun 12 5:54 PM
I believe what I did was write a loop around the the call - reducing the number of days until I got a number it would work with. Not very elegant but it works....
‎2008 Jun 12 4:34 PM