cancel
Showing results for 
Search instead for 
Did you mean: 

BRF Formula expression issue

Former Member
0 Kudos

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


Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Answers (4)

Answers (4)

Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

carsten_ziegler
Active Contributor
0 Kudos

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.


Former Member
0 Kudos

Hi Carsten ,

Thank you kindly for the feedback. I will do this & revert back .

Regards,
AJ

christianlechne
Active Contributor
0 Kudos

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

kakshat
Advisor
Advisor
0 Kudos

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