on 11-18-2014 7:34 AM
Hi Experts ,
I hope that you can assist / guide me with the below issue .
I’m busy setting up a scenario via BRF+ , whereby I’m using the Formula expression
to do an simple calculation .
The formula does the following as per screen shot below : It takes into
consideration the difference between two dates . If the difference between the
two dates is less than five days , it returns an Boolean value of false ,
whereas of the difference between the two dates is greater than five it
returns an Boolean value of true .
The
formula is working perfect when inputting specific dates (An from date & a
to date) . My issue that I am experiencing is when the end date is set to
31.12.9999 , then it doesn’t return an true value for the formula calculation
(which is incorrect) .
It seems that if the difference between to dates is too large , then the formula
bombs out and returns an default value of false (for the Boolean)
I hope that you can advise on why this is happening or what I can do to fix this
issue .
Regards,
AJ
Hi All ,
Just for info .
I logged a call with SAP & they eventually got back to me toady with SAP note 1645922 (BRFplus: Result of DT_DIFFERENCE_INTERGER wrong) .
I applied it our DEV system & seems to have resolved the issue .
Note details :
Symptom
Within BRFplus you are using the 'Formula' expression. In the formula
you use the functionals DT_DURATION_DIFF_INT_MONTHS, DT_DURATION
_DIFF_INT_QUARTERS or DT_DURATION_DIFF_INT_YEARS.
The results are not correct.
Reason and Prerequisites
Differences were calculated in seconds and then converted into months,
quarters or years by standard conversion factor 1 month = 30 da
ys. Variable length of the months and leap days were not considered.
With this correction the months are calculated by analyzing the dates.
For examle: DT_DURATION_DIFF_INT_MONTHS( 1st Feb 2010, 1st Mar 2010) now
results to 1 although the difference is 'only' 28 days.
Before it resulted to 0,933 month due to standard conversion factor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As Carsten says....also if it bugs out it should really be returning something like a maths exception so let us know if it is an overflow & then we (and by we I mean Carsten's extended team ) can do something about if.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Set a break-point in CL_FDT_DATE_TIME method DIFFERENCE_DAY and debug a level deeper into it. That should make the issue clear.
Alternatively, create a message for SAP support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adenaan,
the documentation of the formula function states that the difference between the two dates is calculated on the basis of seconds:
Returns the difference between <Timepoint1> and <Timepoint2> in days. The difference is calculated in seconds and then converted to days with standard conversion factors (1 DAY = 86400 SEC).
I would guess that using highdate (31.12.9999) leads to an overflow and, hence, the processing fails.
From my point of view you can either open an OSS to SAP in order to fix this issue or deal with the special case of a high value within your rule processing using a separate rule
BR
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi AJ,
Is it a problem only with 31.12.9999 or with any end date which would make gap between the start and end dates large?
Akshat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.