Hi Kavali,
It's just simple logic, it is fetching data of Planned working time as 6 from it 0007 & remaining as OT and your tt 0042 is configured as like in table v_t555z and you can find the Pair types which will fetch data from it 2002 / 2001 / 2002 / 2011 accordingly.
And you can use this 0042 as 3 hr OT for further processing as said by Omid.