Hi Jyothsna,
For 1st part query you can check the OUTWP operation.
For 2nd query check the below thread will get some idea about your payroll pcr design. for payroll you will put DATES function and then in the next line use your pcr.
Check and tell me.
Regards,
Sankarsan