How to calculate period between date/time?
All,
I have not been able to find any function module that does this.
I have a create date/time from a table (VBAK).
I need to calculate the difference in days/hours/minutes (seconds not needed) between the date in this table and the current date/time.
Then based on the result - e.g. difference is say 2 days 3 hours and 50 minutes - I will compare to a comfigured period users input to determine record selection.
I can get date difference - SAP handles that - but the hours and minutes are a different story.
Thanks.
Scott
No Matters if problem solved by own. Surely Posting a solution would help others needed person in future .
Similar Messages
-
How to calculate difference between date in hours?
Hi All.
I need calculate difference between first and last date. I'm using the code below:
int differenceDate = CalendarRule.elapsedDays(fromDate : myFirstDate, toDate : myLastDate);
This code return an result in days. But I need that result was in hours.
Has anybody help me?Interval dif;
dif = myLastDate - myfirstDate;
display((dif.hours));
Hope it helps -
How to calculate days between two DATES
How to calculate days between two DATES ?
which is the functional module for that ?
help meHi,
use function module : it works,
HR_HK_DIFF_BT_2_DATES
give output format = 03 and get the value in days.
code is as below :
data : DATE1 type P0001-BEGDA,
DATE2 type P0001-BEGDA,
YEARS type P0347-SCRYY,
MONTHS type P0347-SCRMM,
DAYS type P0347-SCRDD.
date1 = '20070331'.
date2 = '20070101'.
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
DATE1 = date1
DATE2 = date2
OUTPUT_FORMAT = '03'
IMPORTING
YEARS = years
MONTHS = months
DAYS = days
EXCEPTIONS
INVALID_DATES_SPECIFIED = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write : days.
Reward points, if helpful,
Regards,
Sandeep Kaushik -
How can I get the Date & Time to appear on my final project in iMovie11?
I am using iMovie 11 and have imported video from a Canon Vixia-HF21 camera. The EXIF data is imported along with the video but when I produce the final product, the date and time do not appear. How can I get the Date & Time data to appear on the final product?
There is a date and time Title you can use. If I recall correctly, it displays date plus hours and minutes, but not seconds.
-
How do I change the date/time of a dll created in LabVIEW without killing it
I use the LabVIEW (6.0.2 of course) Application builder to create a dll, and I cannot enter creation information, nor can I modify the date time property, which labVIEW does not properly set. I have tried to modify this information in Visual C++, but that destroys the dll because it wasn't compiled in VC++, and therefore isn't compatible.
If anyone knows how to correctly modify the date/time (and the checksum) without destroying the dll, I would be gratefull to know.
Thank youDear Sir,
I was browsing through MSDN in trying to find the info you are looking for and I step into this next file:
"Peering Inside the PE: A Tour of the Win32 Portable Executable File Format"
Which you can locate in the msdn.microsoft.com page by going to the search box and typing that title. The first result is that document. Also you may want to check the "imagehlp" file of the msdn library. This documents provides information on the DLL standard and functions.
Good luck!...
Nestor Sanchez
Applications Engineer
National Instruments
Nestor
National Instruments -
How can i set the date time year to my i pod
how can i set the date time year to my i pod touch
Hello Theodora,
You can do this via your iPod's Settings application.
B-rock -
How to calculate any two date with diffence calculation by using obiee11g?
Hi,
i have a requirement like,
location wise current month and previous month with movement calculation,can to tell me how to calculate any two date with diffence calculation
by using obiee11g
Note,
I tried to implemented ago function as well as dynamic two dates calculation using $2-$1 methods..but i am getting the o/p it's self i am getiing some null value also that' why it's not tallying with our actual report.
i tired to used ifnull(mesaurecolumn,0) also case condition on the mesaure colution still it's not tallying.
THanks and Rds,
Devarasu.RHi,
for Date Difference........
TimestampDiff(interval, timestamp1, timestamp2)
ex:TimestampDiff(SQL_TSI_DAY, cast('1-apr-2011' as date), current_date)
Where:
interval
The specified interval. Valid values are: SQL_TSI_SECOND, SQL_TSI_MINUTE, SQL_TSI_HOUR, SQL_TSI_DAY,
SQL_TSI_WEEK, SQL_TSI_MONTH, SQL_TSI_QUARTER, SQL_TSI_YEAR.
Cheers,
Aravind -
How to calculate days between 2 dates excluding public holidays over SAP ?
Hi
Have a universe over SAP data. Trying to calculate days between 2 dates. SAP holds Public Holiday data in various tables e.g Thol and data is updated via scal. Using my univeres as a source I want to run reports for different countries so need to have various bank holidays not just UK. In SAP function modules handle this. Has anyone designed a solution to cater for this situation in a universe ?
Thanks in advance
MHi,
I assume you mean SAP R/3 (ECC) when you write SAP and SAP BW.
Are you using BW? If so, I would load the data into SAP BW, create a query using customer exit variables and build your universe on top of that...
-J -
How to calculate the total running time for process from sysssislog entries
Hi All,
I have the below query which gets me the log entries form the logs table when the process started/completed.
Select row_number() over (order by starttime) row_num,Substring( Substring(message, CharIndex('''',message) +1 ,Len(message)) ,0, CharIndex('''',Substring(message, CharIndex('''',message) +1 ,Len(message)))) as Description,
starttime,endtime,message
from dbo.sysssislog
where (message like 'start%' or message like 'finish%' ) and
LEFT(Substring( Substring(message, CharIndex('''',message) +1 ,Len(message)) ,0, CharIndex('''',Substring(message, CharIndex('''',message) +1 ,Len(message)))),1) between 'A' and 'Z'
order by starttime
However,I have to build a report on the top of it showing how much time that attribute/dimension/heirarchy took to execute(Ex-How much time did YearlyReview dimension take to complete).I dont have much knowledge of T-SQL and unable to figure out how to calculate
that on SQL or report level.
Could someone please assist me in getting the exact query for that?
Thanks a lot.I get the below output(sample 20 rows) on executing this query.Also,a start process does not necessarily follow up a finished message for the same dimension as it may have been stopped or it failed.So we need to leave it as NA in case it started but dint
finish
Row_Num Description starttime endtime Message
1 PAC SC Super Type 12/13/12 16:38 12/13/12 16:38 Started processing the 'PAC SC Super Type' dimension.
2 PAC SC Super Type 12/13/12 16:38 12/13/12 16:38 Started processing the 'PAC SC Super Type' dimension.
3 Team Member Indicator 12/13/12 16:38 12/13/12 16:38 Started processing the 'Team Member Indicator' dimension.
4 Team Member Indicator 12/13/12 16:38 12/13/12 16:38 Started processing the 'Team Member Indicator' dimension.
5 PAC SC Super Type 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'PAC SC Super Type' attribute.
6 PAC SC Super Type 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'PAC SC Super Type' attribute.
7 Specialist Merger Indicator 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'Specialist Merger Indicator' attribute.
8 Specialist Merger Indicator 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'Specialist Merger Indicator' attribute.
9 YearlyReview 12/13/12 16:38 12/13/12 16:38 Started processing the 'YearlyReview' dimension.
10 YearlyReview 12/13/12 16:38 12/13/12 16:38 Started processing the 'YearlyReview' dimension.
11 PAC SC Repeat Caller 12/13/12 16:38 12/13/12 16:38 Started processing the 'PAC SC Repeat Caller' dimension.
12 PAC SC Repeat Caller 12/13/12 16:38 12/13/12 16:38 Started processing the 'PAC SC Repeat Caller' dimension.
13 Year 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'Year' attribute.
14 Year 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'Year' attribute.
15 Staffing Function 12/13/12 16:38 12/13/12 16:38 Started processing the 'Staffing Function' dimension.
16 Staffing Function 12/13/12 16:38 12/13/12 16:38 Started processing the 'Staffing Function' dimension.
17 PAC SC Repeat Caller 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'PAC SC Repeat Caller' attribute.
18 PAC SC Repeat Caller 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'PAC SC Repeat Caller' attribute.
19 PAC HV Cust 12/13/12 16:38 12/13/12 16:38 Started processing the 'PAC HV Cust' dimension.
20 PAC HV Cust 12/13/12 16:38 12/13/12 16:38 Started processing the 'PAC HV Cust' dimension. -
Doubt in how to calculate net due date
Hi..
Experts i have doubt in my salesmen ageing report i have to display
netamout day wise in the range of 0-30 days , 30-60 days and > 60 days
how to calculate the date difference between to date one is invoice creation date and another one is system date.
Give me any function module available to count the date difference
and how i filter the amount date wise.
Thanks Regds
Prabir Kumar DandpatHi,
check fm;
SD_DATETIME_DIFFERENCE
regards,
Navneeth K.
Message was edited by:
Navneeth Bothra -
How should calculate variance between dynamic input?
HI Experts,
how should calculate Actual cost varience between two month.Hi
From the screen shot it says only u r using 2 months here.
But if you are running for year,then this can be the steps.
1.sort month ..go to values and the arrange .
2.The data should display properly monthly wise
3.Then If you have direct month object then create Previous([Month]).we have previous function
4.write Diff=[Actual Cost]-Previous Actual Cost -
How to calculate the 'real data of arrival' in PO item
Hi,
Confirmation control keys with control type u201CDAu201D are MRP relevant
1. = New field time of transportation in calendar days
2. = Confirmation control type u201CABu201D (order confirmation)
3. = Confirmation control type u201CLAu201D (shipping notification)
4. = Confirmation control type u201CDAu201D (Date of arrival)
When data 1-3 has been changed = 4 will be calculated again.
Program requirements to calculate the u201Creal data of arrivalu201D:
1. When 1 >0 days then create 4 directly after placement of 2 (2 can be placed manually or automatically)
2. 4 must be calculated: AB delivery date 2 + calendar date amount 1 = arrival date 4 (MRP gets a confirmed delivery date by vendor plus transportation time)
3. When changes in 1 then change 4 (add calendar days to arrival date DA)
4. When changes in 2 then change 4 = u201Cnewu201D delivery date 2 plus calendar days 1 = new arrival date 4
5. When 3 u201CLAu201D is entered (manually/automatically) then calculate: shipping date LA 3 plus calendar days 1 = new arrival date in 4
6. When 1 has been changed then calculate 4 new (Check is 2 existing then use 2, check is 2 + 3 existing then use 3)
7. When 2 or 3 has been changed quantity then also update quantity in 4
8. When 2 has been canceled then cancel 4, too
9. When 3 has an inbound delivery document no. in place then copy the same no. in the inbound delivery field 4 and in the new column in MRP (MD04, see MRP view below)
i have a lot of confuseging in this lines of code,even where u write i don't know in BADI . we are implement in BADI only.
if possiable give me code for this requriment. . this line of code in which method we write,please guide me.............SDN is not your code factory, please research yourself before posting, maybe ask whoever handed you this requirement?
Thread locked.
Thomas -
How to cell register the date/time when you put a value in another cell
Hello guys!
How do I get a cell (eg A2) tell the date and time when I put a value in another cell (eg A1) in Numbers?
For example, I want to register a cell to read my electricity meter.
I write in cell A1: 45809. When placing this value in A1, I want to appear (on A2) the date and time when I did that record automatically. Is it possible?
I hope you understood the question!
Thank you in advance to those who try to help.There is not automatic time stamping of on entry of a time. One suggestion I've seen has a cell that has the current date and time. Everytime you cahnge any cell that cell will update. You can then copy that cell and paste the value into your date/time cell adjacent to the meter reading:
Create a new, plain table:
Now in cell A1 enter the formula "=now()" short hand for this is:
A1=now()
now resize the table so it is a table that is 1 cell by 1 cell by selecting any cell, then dragging the table size control in the bottom right corrner towards cell A1:
It should look like this when you have completed this task:
Now create another new, plain table and enter "Date" for cell A1, and "Meter Reading" for B1:
Now you can enter a meter reading (I entered "45671"). Now select the CELL that has current date and time from the first table at the very top, and copy:
Now select the cell in the date column where you want to put the current date and paste values by using the menu item "Edit > Paste Value": -
How do you vary the Date/Time stamp format in File Adapters
In the receiver channel of the File Adapter where you specify the 'File Name Scheme', you do have the option of specifying a 'File Construction Mode' of 'Add Time Stamp'. How can you specify a different Date/Time stamp format ( eg MM/DD/YY vs YYYYMMDD vs MMDDYY, etc. ) without changing the Date/Time stamp for the entire SAP system? Also, can you control where the Date/Time stamp appears in the filename?
Hi,
There are many threads discussing the same issue. Go thro the following:
Dynamic file name (Date) in Receiver File Adapter
Receiver File Adapter - TimeStamp
Bhavesh's reply in above thread:
You can use Adapter Specific Identifiers and then change the file name in the mapping. Append the tiem stamp in the format that you want and so on.
Just use this code in an UDF,
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String SourceFileName = conf.get(key);
java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
dateformat.format( new java.util.Date() );
String newfilename=SourceFileName+dateformat;
// change to new file name
conf.put(key, newfilename);
return "";
Regards,
P.Venkat -
How not to insert a Date/Time field on INSERT
hi all, i have a MSAccess table which has a lot of fields one of which is a date/time field......
when i run the SQL code to insert values into this table i want the date/time field to be left blank.....
i have tried to insert a blank space using '' but it shows the error
SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
does anyone know how i can overcome this problem.....?that worked thanks a lot,
the values are inserted into the database now but i still get an error
SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
but the values are inserted....a bit confused about that any reason why that would happen?
Maybe you are looking for
-
Accessing MS Sql Server with Java classes - problem connecting to socket
I found an example at this location which uses java classes to connected to MS Sql Server. http://search400.techtarget.com/tip/1,289483,sid3_gci1065992,00.html --bummer - it is a login location - so I will include the article Anyway, the example is u
-
InDesign not exporting booklet to PDF properly - bleed issues.
I have created a 32-page booklet that I am trying to send to the printer. It has bleed on each page that I am including in the PDF export. No matter what I do, the bleed is showing up on the wrong page. So, if I am looking at page 18, it will show th
-
JTable display colmun name vertical
Hi, i have to display a JTable, but the column width is small and the colmun heading has lot of text and so cannot fit , is there a way i can increase the height of the column header and display the text vertically, just like we can do in Exceel shee
-
DW8 search box result page asp
Hi all, I build with success a search box (text box) that search in my db. Now when I dont write a sting in the text box and push the submit buttom, the result page schow me all the results from my db. I set my default value parameters to %, this giv
-
I have several people in our office backing up to a Time Capsule. We're near capacity on the hard disk which is fine, but the process of deleting old files ends up causing backups to take a long time for everyone. Is there a way to schedule this type