cancel
Showing results for 
Search instead for 
Did you mean: 

RKF in a Query

Former Member
0 Kudos

Hi Friends,

I have 2 date fields "posting date" and "bill date from". In BEx report I need to calculate the arrears where the "posting date" < "bill date from". how to perform this restriction.

Accepted Solutions (1)

Accepted Solutions (1)

KamalMehta
Advisor
Advisor
0 Kudos

Hi Anil ,

You can achieve the same by using Formula Variables .

Follow the steps as mentioned below :

1. Create 1 CKF in your query .

2. Create 2 Formula Variables as FV1 and FV2  . You would get the option at the left bottom of the screen for the same when you double click on the CKF .

2. Under the Processing Tab of the formula variables use Processing by would be Replacement path and reference characteristics would be posting date and bill date for FV1 and FV2 espectively.

4.Under the “Replace Variable with” dropdown menu, select Infoobject.  Under Replace With Tab, select Key .

5. The Details tab gives the details of the variable that is being created. Note that since this variable does not have an input through the user screen, the check box for “Variable is ready for input” is switched off.

6. Under Currency / Unit tab, from the Dimensions drop down menu, select Date.

Once both the FV's are created In the formula editor, that we had created in the beginning, from the formula variables folder we double click on  FV1 so that it appears now in the formula definition window .Next, on the right window partition, under Operators, we open the Boolean folder and double click on “Is Less than to”.Next we double click on the variable FV2 .This completes our definition of the condition.

We put this condition inside braces and then multiply it by the key figure for Arrears.

Regards

Kamal Mehta

Former Member
0 Kudos

Thanks Kamal. I have tried as you suggested. we still have some issue with result of the query. there are some inconsistencies in the result values. For example, when I enter the date as 01/06/12 to 30/06/12, we are getting the data in between these dates. actual data should be arrears which is before 01/06/12. I have a small doubt in your logic. why we need to multiply with key fig arrears.

My colleague have another query regarding RRI. could you have a look at the following link as well. He followed the entire procedure properly but has some issues while filtering records.

http://scn.sap.com/thread/3205165

your help will be much appreciated.

KamalMehta
Advisor
Advisor
0 Kudos

Hi Anil ,

By creating 2 formula variables and later using them in an condition using bollean operators as below 

(fv1 <fv2) * (Key figure for arrears)

See Bollean Operator can have 2 valuses either '1' or '0' . If the posting date" < "bill date then it is going to have value as '1' i.e 1*Key figure for arrears to show arrears for which the posting date is less then bill date .

And again if the Posting date >= Bill date then the condition would not be true and it would be like 0*Key figure for arrears that is 0 only .Hence would not be shown in the report .

Hope it clarifies .

Also the above solution should fulfill your requirement please recheck to see whether everything has been done as suggested in previous  post .

Thanks

Kamal Mehta

Message was edited by: kamal mehta

Answers (0)