Difference between two amount fields
Hi,
I have got two amount fields and I need to find the difference between those two.
They are in below formats
1.800,00
18,00
Is there any FM to find the difference.
Thanks,
ABAPer.
What if the two values are type c? So the commas etc. are really in the value. He'll have to convert to type P first, then subtract.
Again - it's programming that solves this - not "function module". How do you think function modules get written in the first place - by programming!
Similar Messages
-
Difference between the amount fields
hi
I am trying to find the difference between two amount fieldds and capture them in a column but it results 0 for all the values.
Please help
MondyHi,
Once check the properties of your Calculated Field. Better to use the Funstion Mod while calculating the difference. Also check if you are Grouping these Amount using any Char in the report.
Regards
Karthik -
How to Calculate AGE by getting difference between two Date Fields
HI Gems
I need to calculate AGE from getting difference from two date fields. But when i am trying to wrte fromula as Current date - date1(some date field) then it is showing error.
How can i get values.
Thanks
ManuYou already asked this question:
How to calculate AGE from two different date fields -
FormCalc Formula to tell the difference between two time fields if they are populated - Help please
Hi,
I have a cell (TotalTime1) that references two other time formatted cells (Start1 and Finish 1).
The below formula is intended to tell the difference between the Start and Finish time if they are populated.
I had it working without the HasValue condition but the formula was calculating when there was no value in Start1 and Finish1 (due to time format).
This is the code I do have, it says there is an error near the last line; I am sorry if I post this in the wrong manner, I have not posted on this forum before but here goes:
if (HasValue (Finish1) and HasValue (Start1)) then if (Time2Num(Start1.formattedValue, "HH:MM") < Time2Num (Finish1.formattedValue, "HH:MM")) then Abs (Time2Num(Start1.formattedValue, "HH:MM") - Time2Num(Finish1.formattedValue, "HH:MM")) / (60 * 60 * 1000) else 24 - Abs (Time2Num(Finish1.formattedValue, "HH:MM") - Time2Num(Start1.formattedValue, "HH:MM")) / (60 * 60 * 1000) endif
Any help would be appreciated.
Regards FetachiniThanks whyisthisme,
Your speedy response is greatly appreciated, your support has resolved my issue.
Many thanks.
Regards
Fetachini -
Difference between BSEG amount field and FAGLFLEXA/FAGLFLEXT Amount fields.
Hi experts,
We have a newly SAP instance with the New GL activated. However, when i compared between BSEG and the FAGLFLEXA/FAGLFLEXT tables, I found a difference in the length of the transaction amounts.
BSEG
DMBTR DMBTR CURR 13 2 Amount in Local Currency
WRBTR WRBTR CURR 13 2 Amount in Document Currency
FAGLFLEXA/FAGLFLEXT
TSL VTCUR12 CURR 23 2 Value in Transaction Currency
HSL VLCUR12 CURR 23 2 Value in Local Currency
KSL VGCUR12 CURR 23 2 Value in Group Currency
OSL VOCUR12 CURR 23 2 Value in Another Currency
Is there a reason for this difference? and any config that needs to be perform to synchronise the difference?
Thank you in advance.Hi Jason,
Please run report TFC_COMPARE_VZ in SE38/SA38 and compare the difference. If there is any difference ONLY SAP can correct this. Should you notice any difference, please raise an OSS.
Hope this helps.
Vikas. -
How to find differene between two time fields??
Hi Experts,
I am trying to find difference between two time fields, I have created two formula variables by using replacement path for the two time fields, I have taken dimension key NUMBER, because of this time format is converting to numbers for example if the time is 13:20:10 then it is converting to 1,32,010 then it is calculating, I am getting wrong values.
Is there any options to find out the difference between two time fields.
Thanks in advance,
Venkat.use COPF_DETERMINE_DURATION. Its better you do it in data model itself.
If you have date and time seperately use command
use CONVERT TIMESTAMP command and
then use this function module to get the difference in
timestamp
CCU_TIMESTAMP_DIFFERENCE
us this in conjunction with the below function module
DAYS_BETWEEN_TWO_DATES
Edited by: Ananda Theerthan on Jan 21, 2010 7:18 AM -
How to get the difference between two columns in a column group
Hi All,
My first time here and really new to programming. I would like to get the difference between 2 columns that are inside
a column group.
Here is my sample table below: The Column Group is PeriodNumber and can only choose 2. like 1 and 2.. I would like to have a third row which will simply calculate the difference between the amounts in PeriodNumber 1 and 2.
PeriodNumber
Account 1 2
1) Cash 10,000 15,000
2) Receivables 12,000 11,500
3) Equipment 5,000 5,500
Total Assets 27,000 32,000Hi yabgestopa,
From your description, you want to get the difference between two columns in a column group. After testing it in my environment, we can use custom code to achieve your requirement. For more details, you can refer to the following steps:
Copy the custom code below and paste it to your report. (Right-click report>Report Properties>Code)
Dim Shared Num1 As Integer
Dim shared Num2 As Integer
Public Function GetAmount(Amount as Integer, Type as String)
If Type = "1" Then
Num1=Amount
Else
Num2=Amount
End If
Return Amount
End Function
Public Function GetDif()
Return Num1-Num2
End function
Right-click the second column to insert a third column with Outside Group-Right.
Then use the expressions below in the matrix.
=Code.GetAmount(Fields!Amount.Value,Fields!PeriodNumber.Value)
=code.GetAmount(Sum(Fields!Amount.Value),Fields!PeriodNumber.Value)
=Code.GetDif()
The report looks like below.
If you have any questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
SSRS expression for difference between two currency values
Hi All;
I need to get the difference between two currency values
Below is my report
I need to get differene between Actual Income and Profile Income and this value should be in "£" In this example it should be £0.00
Any help much appreciated
Thanks
Pradnya07=sum(Fields!ProfileIncome.Value - Fields!ActualIncome.Value)
This could have either field first, but depends on which field is expected to be larger. You would then format the textbox to show in pounds.
HTH -
Find the difference between two internal table
how can i see the difference between two interal tables?
The requirement is as follows
1. We have a transparent table, which stores the employee data with EMP ID as key.
2. We load the transp table data into a interal table (B).
3. We get data from legecy system as file and it gets loaded into another internal table (A) (this also has the same EMP ID key and this will have latest addition/update to those emplyees).
Now we need to seperate out these data into three interal table Inserted (I), Deleted (D) and Updated (U).
We want to do followign things
I = A - B
D = B - A
Both A and B will have around 40k records. Hence we are trying to avoid the looping.
Please suggest the best option for us.
Thank you in advance.
Raghavendra>
RAGHAV URAL wrote:
> how can i see the difference between two interal tables?
> The requirement is as follows
>
> 1. We have a transparent table, which stores the employee data with EMP ID as key.
> 2. We load the transp table data into a interal table (B).
> 3. We get data from legecy system as file and it gets loaded into another internal table (A) (this also has the same EMP ID key and this will have latest addition/update to those emplyees).
>
> Now we need to seperate out these data into three interal table Inserted (I), Deleted (D) and Updated (U).
>
> We want to do followign things
> I = A - B
> D = B - A
>
> Both A and B will have around 40k records. Hence we are trying to avoid the looping.
>
> Please suggest the best option for us.
>
> Thank you in advance.
> Raghavendra
Hi Raghavendra,
Currently as of my knowledge, these operations are only possible through LOOPs. But LOOPign can be really fast here if you properly utilize the SORTING, READ with BINARY SEARCH and FIELD-SYMBOLS usage. I would say:-
Steps for Insert:-
SORT: A, B.
LOOP AT A ASSIGNING <WA_A>.
READ TABLE B WITH TABLE KEY key = <WA_A>-key BINARY SEARCH.
IF SY-SUBRC NE 0.
APPEND <WA_A> TO I.
ENDIF.
ENDLOOP.
Steps for Delete:-
SORT: A, B.
LOOP AT B ASSIGNING <WA_B>.
READ TABLE A WITH TABLE KEY key = <WA_B>-key BINARY SEARCH.
IF SY-SUBRC NE 0.
APPEND <WA_B> TO D.
ENDIF.
ENDLOOP.
Regards,
Ravi. -
Find the difference between two columns in an ssrs matrix ? MSCRM
Hi All,
I am working in reporting part of our project (On-line MSCRM 2013) & in reporting services.
I am trying to create report using fetch xml based. Below is the snap what we required the result.
Kindly help me, how to get the difference in both column. (Its a matrix table where year is grouped).
We need difference between both year Like (Plan Revenue of 2013 & Plan Revenue of 2014 difference in Plan Revenue Diff section) and same for Actual
Revenue.
https://social.microsoft.com/Forums/en-US/054d5ca4-0d38-4dc6-84a8-88866cc228fe/find-the-difference-between-two-columns-in-an-ssrs-matrix-mscrm?forum=crmdevelopment
Thanks,
Mohammad ShariqueHi Bro,
I used parametrized option for year and done the report,Currently we are getting values in Difference column now i want to show
that value in percentage. How can we show the percentage based on that value. Means i want to show the Difference in Percentage.
Kindly help me i tried but getting some issue. Below i am mentioning the code and snap with result.
Below expression using to showing Plan Revenue in Percentage for year.
=
Sum(IIF(Fields!new_year.Value =Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))
- Sum(IIF(Fields!new_year.Value =Parameters!EndYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))
/IIF(Sum(IIF(Fields!new_year.Value = Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))>0,
(Sum(IIF(Fields!new_year.Value = Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0))))
,1)
)*100))
Result issue is as below in snap with highlighted in red colour.
Kindly help me on this issue also :) -
Hi
I have two date fields in the ODS..Both are characterists
1. Requested delivery date
2. Actual shipment end date.
I would like to create a calculated KF field for the difference between two dates in a query.
How can I accomplish it?
RegardsYou have to make Expiration data as nav attribute and create a formula variable then only this date can be used in calculations.
refer this How to...for the same
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/72f4a790-0201-0010-5b89-a42a32223ffc
later you can try to calculate difference between dates!
Re: calculating the difference between two dates
Please search in forum with 'difference between two dates'.You will find lots of good posts on this issue!
hope this helps
Regards -
Difference between two dates into server behaviors
Good morning all,
I'm trying to create a recordset using server behaviors and as I'm not an expert using php I'm completely lost...
The problem is the following : I want to find into a table all the records where the difference between today date and their creation date (stored in that table of course) is greater than, let's say 30days. How can I indicate that into the variables field ?
Many thanks in advance for your help !Many thanks !
I was ignoring the DATE_SUB function and it does work in such a simple way… (with a closing parenthesis at the end)
Thanks again !
Best regards
De : osgood_ [email protected]
Envoyé : lundi 16 septembre 2013 15:59
À : Berurier75
Objet : Difference between two dates into server behaviors
Re: Difference between two dates into server behaviors
created by osgood_ <http://forums.adobe.com/people/osgood_> in Dreamweaver support forum - View the full discussion <http://forums.adobe.com/message/5685549#5685549 -
Hi All ,
Please suggest me Function module which will give me difference between two date and time.
I have tried various FMs they all are giving difference in days and hours but I want to know difference in seconds also.
Thanks in advance.
Regards ,
Jigar Thakkar.
Moderator message: please look even further or simply program your own little solution.
Edited by: Thomas Zloch on Mar 11, 2011 10:47 AMMichael,
For VB.net the date difference method is the same as it is for VBA. Depending on whether you want working days or calendar days, the methods are:
Difference in working days:
Application.DateDifference(StartDate, FinishDate, Calendar)
Difference in calendar days:
DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]])
You can also use these same formula in a custom field in Project.
Hope this helps.
John -
Difference between Two Date Should come into Text Item
Dear All,
i want to get difference between two date into text Item :P36_C in On Change java script.
i have two Date Item :P36_A and :P36_B .i have extract these date value from table then difference comes into Text Field :P36_C.
Now i want if i change Date into Item :P36_A or Item :P36_B then Defference between two date Should Come into Item :P36_C .
So i have use Java Script Code to do this
<script>
function diffdat(){
function getVal(item){
if($x(item).value != "")
return parseFloat($x(item).value);
else
return 0;
$x('P36_C').value =
getval((TO_DATE('P36_B', 'DD-MON-YYYY'))-
getval(TO_DATE('P36_A', 'DD-MON-YYYY')))+1;
</script>
i have put this into Item HTML Form Element Attributes
onChange="javascript:diffdat();"it's not woring .
How to work that Code with dates.
ThanksYou can always create your own difference function based on your own criteria. You can modify this to suit your needs.
CREATE OR REPLACE FUNCTION CALC_OFFICE_DAYS(date1 DATE, date2 DATE)
RETURN NUMBER
IS
v_begin_date DATE := date1;
v_end_date DATE := date2;
v_office_start_time VARCHAR2(10) := '09:30 AM';
v_office_end_time VARCHAR2(10) := '06:30 PM';
v_comp_begin_time DATE;
v_comp_end_time DATE;
v_days PLS_INTEGER := 0;
v_hrs NUMBER := 0;
v_ttltm NUMBER;
BEGIN
select trunc(v_end_date) - trunc(v_begin_date)
into v_days
from dual;
select to_date(to_char(sysdate,'DD-MM-YYYY')||' '||to_char(v_begin_date,'HH24:MI'),'DD-MM-YYYY HH24:MI')
into v_comp_begin_time
from dual;
select to_date(to_char(sysdate,'DD-MM-YYYY')||' '||to_char(v_end_date,'HH24:MI'),'DD-MM-YYYY HH24:MI')
into v_comp_end_time
from dual;
select (v_comp_end_time - v_comp_begin_time)/24 into v_hrs from dual;
IF v_hrs > 4 then
v_ttltm := v_days + .5;
ELSE
v_ttltm := v_days;
END IF;
return v_ttltm;
END;
As has been noted, this question is best posted on the PL/SQL forum. -
Difference between two periods
Hi All,
We have two periods ZPERFROM and ZPERTO in the transactional Infocube. While writing FOX, want to calculate the difference between these periods.
I have written the following code in FOX:
DATA diff TYPE I.
diff = ZPERTO - ZPERFROM.
But it is throwing the error as:
Formula error: Formula element ZPERTO could not be recognized
Could you pls guide in getting the difference between the two periods.Hi Mayank,
Here comes the scenario where I need to find out the difference between two periods.
Ex: We have below records in Infocube.
WBS ZPERFROM ZPERTO 0AMOUNT 0CURRENCY 0FISCPER
W1 009.2007 012.2007 4000 USD
W2 001.2008 003.2008 6000 EUR
Need to distribute the amount equally for all the periods which lie between ZPERFROM and ZPERTO for each WBS. After distribution for the above records, we need to get the result as shown below:
WBS ZPERFROM ZPERTO 0AMOUNT 0CURRENCY 0FISCPER
W1 009.2007 012.2007 1000 USD 009.2007
W1 009.2007 012.2007 1000 USD 010.2007
W1 009.2007 012.2007 1000 USD 011.2007
W1 009.2007 012.2007 1000 USD 012.2007
W2 001.2008 003.2008 2000 EUR 001.2008
W2 001.2008 003.2008 2000 EUR 002.2008
W2 001.2008 003.2008 2000 EUR 003.2008
Could you pls guide in achieving the above result.
Regards,
Durga
Message was edited by:
Durga BW
Maybe you are looking for
-
Here is my setup: iPAD 2 (64gb, no 3G) Windows 7 PC Everytime I connect my iPAD via USB to iTunes, iTunes keeps claiming it can't sync with it. Reinstalled iTunes twice, same result. ITunes wants me to restore my iPad everytime. On the times that
-
Run the Apple Hardware Test (AHT) from a external drive possible?
Hi my DVD drive is dead and i need to do a hardware test now but my macbook pro spits the dvds out., does anyone have experience with running AHT from external drive ?
-
Inbound processing of transactional Data(ALE-IDOC)
Hello, Please guide me for Inbound processing of transactional data(ALE-IDOC). Thanks.
-
Is there a way around this?
-
I am traveling to Italy this summer. I have purchased a power converter, should I anticipate any problems charging my iPad or iPhone? Can I use a multiple plug with the converter and charge both devices? Thanks.