2006 Oct 10 4:54 PM
Hi All,
I am writing a simulation program in ABAP. output of my simulation is interms of time. for example while simulating i am considering 1 day= 1sec, and when simulation begins T=0, after completion of simulation i am holding a value , say 75 sec),
now i need to convert this 75 seconds time into a date. taking intial T= 0 as current date , and finding the final date i.e after 75 seconds, considering 5 day week .
i searched for this in the forum and couldn't find any.
Anysort of help is appreciated.
Thanks in Advance.
Sharatchandra
Hi All,
I am writing a simulation program in ABAP. output of my simulation is interms of time. for example while simulating i am considering 1 day= 1sec, and when simulation begins T=0, after completion of simulation i am holding a value , say 75 sec),
now i need to convert this 75 seconds time into a date. taking intial T= 0 as current date , and finding the final date i.e after 75 seconds, considering 5 day week .
i searched for this in the forum and couldn't find any.
Anysort of help is appreciated.
Thanks in Advance.
Sharatchandra
2006 Oct 10 5:00 PM
If you wanted to count calendar days, you could simpley add the 75 to current date, this would give you the date 75 dates from now.
data: 75_datum type sy-datum.
75_datum = sy-datum + 75.But since you want to skip weekends, you will need to count against a calendar id.
call function 'END_TIME_DETERMINE'
exporting
duration = number_of_days
unit = ' '
factory_calendar = t001w-fabkl
importing
end_date = newdate "(ANSWER)
exceptions
factory_calendar_not_found = 1
date_out_of_calendar_range = 2
date_not_valid = 3
unit_conversion_error = 4
si_unit_missing = 5
parameters_no_valid = 6
others = 7.
Regards,
Rich Heilman
2006 Oct 10 5:02 PM
How about:
DATA: secs TYPE i VALUE '75',
wk_ti TYPE i,
new_date LIKE sy-datum.
wk_ti = FLOOR( secs * 7 / 5 ).
new_date = sy-datum + wk_ti.
Rob
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |