2007 Aug 01 5:03 PM
My organization is trying to keep trck of the average time it takes to close out a request ticket. I am able to pull a report that shows me the Creation Timestamp (MM/DD/YY HH:MM:SS) and the Closing Timestamp(MM/DD/YY HH:MM:SS). How ever I can not get the program to calculate the difference in a timestamp format ie: HH:MM:SS
It is not calculating the dates correctly.
Here is what I have so far. I am able to specify a date in which I want to find the totals and then display only the fields i want. Again I am missing something in the calculation portion of the below program.
REPORT ZSLMTIMERNOTIFWL.
DATA wa_dnod_notif TYPE dnod_notif.
PARAMETERS pa_dnod type D.
DATA: begin of wa1_dnod_notif occurs 0.
include structure dnod_notif.
DATA: end of wa1_dnod_notif.
DATA: tstamp type timestamp,
d TYPE D,
t TYPE T,
tz(06) type C.
DATA: tstamp1 type timestamp,
d1 TYPE D,
t1 TYPE T,
result TYPE Timestamp.
SELECT status processor numb crea_tstmp clo_tstmp
FROM dnod_notif
INTO CORRESPONDING FIELDS OF wa_dnod_notif.
NEW-LINE.
move wa_dnod_notif-CREA_TSTMP to tstamp.
CONVERT TIME STAMP tstamp TIME ZONE tz INTO DATE d TIME t.
move wa_dnod_notif-CLO_TSTMP to tstamp1.
CONVERT TIME STAMP tstamp1 TIME ZONE tz INTO DATE d1 TIME t1.
if d = pa_dnod.
COMPUTE Result = ( ( tstamp1 - tstamp ) ) .
WRITE wa_dnod_notif-status.
WRITE wa_dnod_notif-processor.
WRITE wa_dnod_notif-numb.
WRITE wa_dnod_notif-crea_tstmp.
WRITE wa_dnod_notif-clo_tstmp.
WRITE RESULT.
endif.
ENDSELECT.
IF SY-SUBRC NE 0.
WRITE 'Sorry no Data'.
ENDIF.
I have searched the threads and have not found a function specific to SLM or a line of code that will work. Can anyone recommend anything?
2007 Aug 01 5:22 PM
Hi,
Use function module TIMECALC_DIFF
aRs
2007 Aug 01 5:15 PM
Hi,
I have found some info on this.Just check this and see whether the move statement is fine.
CONVERT - Converting Timestamps
CONVERT - Converting Timestamps
Variants:
1. CONVERT TIME STAMP tst TIME ZONE tz INTO DATE d TIME t.
2. CONVERT DATE d TIME t INTO TIME STAMP tst TIME ZONE tz.
Effect Converts the timestamp tst into date d or time t based on the
time zone tz.
tst must have the type P(8) (short form) or P(11) with 7
decimal places (long form). tz must have the type C(6). The
ABAP Dictionary contains the data elements TIMESTAMP,
TIMESTAMPL, and TIMEZONE, which you can use in DATA ... TYPE
... statements to declare tst and tz. There are no strict type
checks for the date d or time t. If you specify a variable
that does not have type T, the system uses the type conversion
rules applied in the MOVE statement.
As mentioned above, the data type of GS_TEST-TIMESTAMP_FROM should be p.
Hope it will be useful.
Thanks,
Sandeep.
2007 Aug 01 5:22 PM
2007 Aug 01 6:03 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |