Requirement: At any given hour of the night, Idoc are coming in ECC and a batch job is supposed to process them. However, it should process only Idocs which came in an hour before the execution of the job. Question is how to deduct one hour from a given timestamp?

Solution: While many approaches can be thought of, a simple FM can do the trick. FM is START_TIME_DETERMINE which imports duration and corresponding unit, and End Date and End Time where current dates can be passed. The response will be exporting parameter with Start Date and Start Time indicating time being deducted from End Date and End Time.

If your requirement strictly concerns days to be subtracted, alternately RP_CALC_DATE_IN_INTERVAL can be easily employed. A likely scenario is where a batch job runs to process documents created in last ‘n’ days.