Function to calculate ICMS
Hi, i need a function to retrieve the ICMS value according to the imput values KOMP-TXREG_SF and KOMP-TXREG_ST. Someone knows how to do this? Thx
Hi Rimbecano,
I'm not sure if this will help but check out FM J_1B_CBT. You can also take a look at package J1BA which contains a lot FM's for Brazil localization.
Regards,
Brenda
Similar Messages
-
Need a function to calculate employee attendance data for a given period
need a function to calculate employee attendance data for a given period
as
Working days,
CL ,
SL,
PL,
LWP
regards,
Gaurav Sood.Issue resolved
-
Function Type Calculate Inventory in BPS SEM 6.0
Hi,
Do anybody have idea about function type Calculate Inventory .
We are in SEM 6.0 sp SAPKGS6006. I'm not getting any documentation on this particulat function type.
Please revert if you have any knowledge on this.
Thanks
PratyushHi Marc,
Yes, this looks like a standard function. The number is 31.
PLNTP CALCF SPFIE REFF TIMF FB_METHOD FB_PARAM FB_EXEC TECHF TEXT
31 UPB_Y_TMCHA UPS UPS UPS UPB_YS_TECHF_S Calculate Inventory
Thanks
Pratyush -
Function to calculate Page size in XML RTF template
Hi All,
For one of my requirments, I need to find out the page size of my output.
And from a given point of the output, i should know the size till bottom of the page.
My program has an RTF and will generate output in PDF format.
Please let me know how to do this. This is very important for me.
Thanks in advance.
Edited by: DharV on Nov 17, 2011 12:18 AMNo, the actual requirment is in this thread
Re: Need to drag the table down the end of page
I could not get the solution for this, so just checking if I have a function to calculate the horizantal size of the output page, and i can apply some logic.
Let me know if iam not clear
Thanks
Edited by: DharV on Dec 6, 2011 1:14 AM -
Use Planning Function to calculate new value
Hi All,
I have what seems to be a simple problem, but no success in resolving.
I have 3 planning keyfigures:
-Units
-Price
-Value
The price field is populated from another planning sheet.
The unit field is entered by the user.
The value should be calculated by planning function when button pushed.
I have tried just basic "Value=Units*Price", but always comes back zero.
I have also tried more complex "{Value, CharA, CharB, CharC} = {Units, CharA, CharB...." for each characteristic. Still zero.
It must be multipling by zero, but not sure how to avoid.
If I put "Value=Price", it works. If I put "Value=Units", it works. If I put "Value=Units+Price", it works.
Please help.
Terrence
Here is the details.
In the infoprovider the data is like this:
Country/ Product/ Unit Sales/ Price/ Value
DE/ Shirt/ 50/ 0/ 0
DE/ Shirt/ 0/ 100.00/ 0
The query is display:
Country/ Product/ Unit Sales/ Price/ Value
DE/ Shirt/ 50/ 100.00/ 0
I have tried the following 2 formulas:
Formula 1:
= {Unit Sales} *
Formula 2:
FOREACH Country, Product.
{Value, Country, Product} = {Unit Sales, Country, Product} * {Price, Country, Product}
ENDFOR.
Both return zero for values.
Thanks,
Terrence
Here is the details.
In the infoprovider the data is like this:
Country/ Product/ Unit Sales/ Price/ Value
DE/ Shirt/ 50/ 0/ 0
DE/ Shirt/ 0/ 100.00/ 0
The query is display:
Country/ Product/ Unit Sales/ Price/ Value
DE/ Shirt/ 50/ 100.00/ 0
I have tried the following 2 formulas:
Formula 1:
= {Unit Sales} *
Formula 2:
FOREACH Country, Product.
{Value, Country, Product} = {Unit Sales, Country, Product} * {Price, Country, Product}
ENDFOR.
Both return zero for values.
Thanks,
Terrence
How to use case when function to calculate time ?
Dear All,
May i know how to use case when function to calculate the time ?
for the example , if the First_EP_scan_time is 12.30, then must minus 30 min.
CASE WHEN FIRSTSCAN.EP_SHIFT <> 'R1' AND FIRSTSCAN.EP_SHIFT <> 'R2'
THEN ROUND(CAST((DATEDIFF(MINUTE,CAST(STUFF(STUFF((CASE WHEN SHIFTCAL.EP_SHIFT = 'N1'
THEN CONVERT(VARCHAR(8),DATEADD(DAY,+1,LEFT(FIRSTSCAN.EP_SCAN_DATE ,8)),112) + ' ' + REPLACE(CONVERT(VARCHAR(8),DATEADD(HOUR,+0,SHIFTDESC.EP_SHIFT_TIMETO + ':00'),108),':','')
ELSE LEFT(FIRSTSCAN.EP_SCAN_DATE ,8) + ' ' + REPLACE(CONVERT(VARCHAR(8),DATEADD(HOUR,+0,SHIFTDESC.EP_SHIFT_TIMETO + ':00'),108),':','') END),12,0,':'),15,0,':') AS DATETIME),CAST(STUFF(STUFF(LASTSCAN.EP_SCAN_DATE,12,0,':'),15,0,':') AS DATETIME)) / 60.0 - 0.25) AS FLOAT),2)
ELSE ROUND(CAST((DATEDIFF(MINUTE,CAST(STUFF(STUFF(FIRSTSCAN.EP_SCAN_DATE,12,0,':'),15,0,':') AS DATETIME),CAST(STUFF(STUFF(LASTSCAN.EP_SCAN_DATE,12,0,':'),15,0,':') AS DATETIME)) / 60.0) AS FLOAT),2) END AS OTWORK_HOUR
Do not use computations in a declarative language. This is SQL and not COBOL.
Use a table of time slots set to one more decimal second of precision than your data. You can now use temporal math to add it to a DATE to TIME(1) get a full DATETIME2(0). Here is the basic skeleton.
CREATE TABLE Timeslots
(slot_start_time TIME(1) NOT NULL PRIMARY KEY,
slot_end_time TIME(1) NOT NULL,
CHECK (start_time < end_time));
INSERT INTO Timeslots --15 min intervals
VALUES ('00:00:00.0', '00:14:59.9'),
('00:15:00.0', '00:29:59.9'),
('00:30:00.0', '00:44:59.9'),
('00:45:00.0', '01:00:59.9'),
('23:45:00.0', '23:59:59.9');
Here is the basic query for rounding down to a time slot.
SELECT CAST (@in_timestamp AS DATE), T.start_time
FROM Timeslots AS T
WHERE CAST (@in_timestamp AS TIME)
BETWEEN T.slot_start_time
AND T.slot_end_time;
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL
Any function to calculate actual work hours (deduct the break hours)
Hi expert,
I have defined the daily work schedule & break schedule. Work center is assigned with the daily work schedule. Now I want to calculate each work center actual work hours. I have a table where the start & finish time of working is keep.
for eg.
first break hr 10:00am to 10:15am
second break hr 13:00pm to 14:00pm
The work center might start work from 10:05 and finished at 14:30 or any other case.
I need to deduct the break hrs & get the actual hr worked
Is there any function to calculate the actual work hours base on the daily work schedule & break schedule ?
Thanks
Hello,
Try the below FM's
HR_PERSONAL_WORK_SCHEDULE
WORKING_HOURS = 'X' " you will get the actual work hours
HR_BE_WORKING_SCHEDULE
Try the below class
CL_PT_TIME_EV_WORK_SCHED_UTIL
Regards,
Krishna
Message was edited by:
Krishnakumar
Java function to calculate timezone
HI
I have a specific requirement to create one java function to calculate the timezone based on the date
for mapping.
Like input(date)->Java Func->Timezone(Output).
As i am not very much conversant with java it will be very helpful for me if anybody who has done the code send me.
Thanks
Debraj Roy
Hi Debraj,
Hope these links provide the required information
Re: CurrentDate function?
Date Calculation
http://help.sap.com/saphelp_nw04/helpdata/en/22/e127f28b572243b4324879c6bf05a0/frameset.htm
http://java.sun.com/docs/books/tutorial/i18n/format/simpleDateFormat.html
http://java.sun.com/j2se/1.5.0/docs/api/java/util/TimeZone.html
Regards
Vishnu
Creating function to calculate average value
Hi,
The below query was successfully return an average value. It returned 1 row.
SELECT AVG(Volume)
FROM security
WHERE
Type = 'Future' AND
Rating = 'AAA' AND
Code = 1 AND
(Day = ''14-mar-09' OR
Day = '16-mar-09' OR
Day = '');
I tried to use that function on my created function below.
CREATE OR REPLACE FUNCTION fn_Vol_Average
( v_DayLast_1_Week IN DATE,
v_DayLast_2_Week IN DATE,
v_DayLast_3_Week IN DATE )
RETURN NUMBER IS
v_Vol_Average NUMBER;
BEGIN
SELECT AVG(Volume) INTO v_Vol_Average
FROM security
WHERE
Type = 'Future' AND
Rating = 'AAA' AND
Code = 1 AND
(Day = v_DayLast_1_Week OR
Day = v_DayLast_2_Week OR
Day = v_DayLast_3_Week);
RETURN NVL(v_Vol_Average, NULL);
END;
I called that function by the following query. it was work, however it return the whole rows. It looks like the function perform the average calculation of each rows on the table.
Can anyone help me what is going on with the logic?
select fn_Vol_average('14-mar-09','16-mar-09','')
from security
--
But since your function calculates the average over the whole security table, you wouldn't call this from a select statement which also reads the security table.
You just want to execute it once.
declare
l_vol_average number;
begin
l_vol_average := fn_Vol_average('14-mar-09','16-mar-09','');
dbms_output.put_line(l_vol_average);
end;By the way, be careful with your date parameters. You should use TO_DATE with a proper format mask to prevent conversion errors.
How to restrict prevmember function to calculate for a particular year
Hi,
I have a MDX query that calculates the cumulative sum, using current & previous member. Now when year is January, i want the query to ignore prevmember value. Can somebody please help how this can be achieved?
My query:
CASE WHEN
[Date].[CALENDAR].PrevMember
,[Measures].[TOTAL KM]
) + [Measures].[TOTAL KM] )=0 THEN 0
ELSE
[Date].[CALENDAR].PrevMember
,[Measures].[Number of Events]
) + [Measures].[Number of Events]) * 200000/
[Date].[CALENDAR].PrevMember
,[Measures].[TOTAL KM]
) + [Measures].[TOTAL KM] ) END
Hi Mayank,
According to your description, you need to calculate the cumulative sum, and reset it on January of each year, right?
In this case, you can use YTD function to achieve your requirement. I have tested it on AdventureWorks, the query below is for you refernece.
WITH MEMBER MEASURES.YTDDEMO AS
AGGREGATE(YTD(), [Measures].[Internet Sales Amount])
SELECT {[Measures].[Internet Sales Amount], MEASURES.YTDDEMO} ON 0,
[Date].[Calendar].[Month].MEMBERS ON 1
FROM
[Adventure Works]
Regards,
Charlie Liao
TechNet Community Support
How can I use SUM function to calculate # of employees in the comp.&deptnt?
I've got two tables: employee & department. I am trying to calculate total employees by department and total employees by the entire company. I know I need to use SUM function, but I only can calculate total employees by department & by company separately. I need to get this output:
DEPT_NAME DEPT_TOTAL_SALARY COMPANY_TOTAL_SALARY
RESEARCH 10875 29025
SALES 9400 29025
ACCOUNTING 8750 29025
This is my code:
SELECT department_name, SUM(salary) as total_salary
FROM employee, department
WHERE employee.department_id = department.department_id
GROUP BY department_name;
SELECT SUM(salary)
FROM employee;
Can somebody help please?
Thank you in advance.Edited by: user13675672 on Jan 30, 2011 2:29 PM
Edited by: user13675672 on Jan 30, 2011 2:31 PM
Hi, Peter
Peter Gjelstrup wrote:
... There might be a smarter way, with no re-select.You're right, as usual.
SELECT d.dname
, SUM (e.sal) AS dept_tot_sal
, SUM (SUM (e.sal)) OVER () AS comp_tot_sal
FROM scott.dept d
JOIN scott.emp e ON d.deptno = e.deptno
GROUP BY d.dname
;Analytic functions are computed after aggregate functions, so an aggregate function can be nested inside an analytic function.
Another way (without a sub-query, at least) would be SELECT DISTINCT, with only analytic functions.
SELECT DISTINCT
d.dname
, SUM (e.sal) OVER (PARTITION BY d.dname) AS dept_tot_sal
, SUM (e.sal) OVER () AS comp_tot_sal
FROM scott.dept d
JOIN scott.emp e ON d.deptno = e.deptno
;
Is there a function to calculate the period range?
E.g. the program input the 10.2008 - 01.2009 (MM/YYYY), so how can the program knows there are 4 months: 10/08, 11/08,12/08, 01/09 between them?
Is there function can do so?
P.S. yes it can be done, if calculate it manuly via while(in ABAP) clause
Hi,
Check this code..
DATA: V_FROM(6) TYPE N VALUE '200810'.
DATA: V_TO(6) TYPE N VALUE '200901'.
DATA: V_DATE TYPE D.
* Get the periods.
DO.
CONCATENATE V_TO '01' TO V_DATE.
* Decrease one day.
V_DATE = V_DATE - 1.
WRITE: / V_DATE(6).
* Exit condition.
IF V_DATE(6) = V_FROM.
EXIT.
ENDIF.
ENDDO.
Thanks,
Naren
Function to calculate how many working date there are.
Good morning,
there is a Function/Object to calculate how many working days there are between two dates?
thanks
M
If you have problems finding in the forum the answer to this question, please re-post it and mention how you searched and how the results didn't help.
Thread locked.
Rob
Function to calculate diference between 2 times?
Hi All,
Does anybody knows a functions, that <b>calculates the diference in hours</b> of to times, having in acount also the date?
For example: The diference between <b>23h00 of 17.01.2007</b> and <b>04h00 of 18.01.2007</b>. Result 5 hours.
Thanks in advanced.
Marcelo Moreira
Hi,
Please check this FM.
CCU_TIMESTAMP_DIFFERENCE.
SD_DATETIME_DIFFERENCE
Regards,
Ferry Lianto
Self-corre​lation function to calculate speckle size of an image
I conduct research that involves images that incorporate speckle, and I need a program that is a self correlation function that can help me calculate the speckle size of an image. Is there any way that I can do this with labview or has someone already written a profram for it?
If you can describe the algorithm, particularly if you have code in Matlab or a similar programming language that accomplishes what you need, then almost certainly you can do it in LabVIEW. All you need is someone with some experience with LabVIEW (or someone with reasonable experience in another programming language willing to take the time, typically a few days, to go through the LabVIEW Tutorials and learn how LabVIEW works) and the algorithm.
Bob Schor
Maybe you are looking for
-
IPhone shows up in itunes when try to sync, disappears
iPhone 5s, iOS8.2 Plugged in, on same wifi network Device shows up in itunes. When I added a playlist for my phone to sync and clicked sync, it said "looking for device," then that dialogue box disappeared and nothing happened. Then an error messag
-
We have recently upgraded to Motion 3 and I have been using the Motioin 3 Apple Pro Training Series torial. Lesson 5 discusses Motion's expose feature. Pressing X activates this feature, however, I can not activate expose by pressing X or Shift X. Is
-
(!apple video) with gnome-mplayer & gecko-mediaplayer
I'm trying to watch these video lectures for my trig class. Can't get them to play. installed firefox 3 (branded) along with gecko-mediaplayer and gnome-mplayer. I'm running arch32 and am having the same problem in kde as I had in gnome. Not sure wha
-
I can't finish my phone conversation.
Hey everyone, My problem is that I can't finish my phone conversation in Iphone 6 64GB iOS 8.3. I can't do this in two situation. One of them is that I can't finish despite of clicking on red receiver. I can see that it seems to be 'clicked in' but i
-
Display Links on welcome screen of SC as per the role in PFCG
Hi All, We have created a Z ITS service from a Z transcation and want to give the link of this ITS service on welcome screen of EBP only to some specific users. We created a Z role in PFCG and attached the link of this ITS service using the option 'G