For all the tasks selected in SWPSTEPLOG, there will be tasks were field RETURNTYP is equal to RC or EV.
The return type RC will represent the Start Date/Time for a specific task, while the return type EV represents the action taken by the user for the previous task, so the Completion Date/Time
For each task checks it returns type:
If RETURNTYP = RC
Store fields:
START_DATE = LOG_DATE
START_TIME = LOG_TIME
After getting the start date and time for the RC task, look for the Completion date and time in a subsequent task where:
WF_ID from RC record = WF_ID from EV record
NODE_ID from RC record = NODE_ID from EV record
WI_ID from RC record = WI_ID from EV record
TASK_ID from RC record = TASK_ID from EV record