07-26-2007 4:53 PM
Hi all,
I have two field values that originate from data elements sstad and sstau. The actual values displayed are 11/20/07 and 14:10. I need to subtract a queue time originating from data element dzwnor given in hours, say 12:00, from the previous values and then convert the final value into a factory day. What would be the most concise manner in which to perform this calculation?
Thanks,
Mat
07-26-2007 4:59 PM
Use function module after substracting hours from the time
<b>FACTORYDATE_CONVERT_TO_DATE</b> Calendar function: Returns date for a factory calendar date
Regards,
Santosh
07-26-2007 4:59 PM
Use function module after substracting hours from the time
<b>FACTORYDATE_CONVERT_TO_DATE</b> Calendar function: Returns date for a factory calendar date
Regards,
Santosh
07-26-2007 4:59 PM
07-26-2007 5:02 PM
hi,
concatenate sstad sstau into lv_var. "provided both sstad & sstau are converted to character type
Regards,
Santosh
07-26-2007 5:07 PM
hi , there are same function to do date and time calculation, (ADD, SUBTRACT hour or minutes or day or month from Hour or date.) you can find it in sm37.
or if you mange inside your code filds type datum od uzeit you can add or subtract directli from the code ex:
data: date1 like sy-datum,
data2 like sy-datum,
data3 like sy-datum,
data4 like sy-datum.
put data inside data1 and data2
data3 = data1 - data2.
data4 = data1 - 3.
results is right.
07-26-2007 7:50 PM
The 2 data elements are presumably date and time format. Move to char variables (do not use write) so you get the unformated version. Concatenate the 2 together. You should end up with YYYYMMDDHHMMSS
Write the amount you want to subtract in the same format and subtract (or use standard FM,
Look at the f1 help for command timestamp - it may help.