Hi folks,
we have implemented cats timesheet approval using BOR object CATS. We are using custom rule to determine agent in the workflow template/task. I need to display only relevant data for this approver in the approval screen when he clicks on the timesheet approval workitem in his SAP inbox(business workplace). For this I have implemented BADI CATS_REPORTING and am using the method BEFORE_DISPLAY_APPR to filter the records to be displayed in ALV output table(CH_CATS_DATA) based on conditions like WBS element, Reciever order etc.
I can access this data but i need to find out who the approver is in this badi method so that when he clicks on the workitem in his inbox, i can modify the data in CH_CATS_DATA table and display only relevant records to him(this method will trigger before displaying the alv report for transaction CATSWF(program name: RCATSB01 or RCATS_APPROVE_ACTIVITIES) which gets called when he clicks on the workitem)
I am trying to get the userid of the approver who clicked on the workitem from SWWUSERWI table but for this i need the workitem id. There is a field called workitemid in CH_CATS_DATA parameter of BEFORE_DISPLAY_APPR method but i think the key field of the BOR object CATS will be stored here. Is the key field of CATS object type or workitem id from CH_CATS_DATA the same one which will be stored in SWWUSERWI table or is there any way in which i can find out that workitem id(which is stored in SWWUSERWI for that user) from the CATS BOR object type key field?
If the above logic doesn't work, could you also suggest me any other way in which i can find out the approver user id or read it from the rule container in this method. I see a field called APNAM in CH_CATS_DATA internal table, but i think this field will only be updated after approval. I need to find out the approver in this method which will be triggered just before the approval screen of CATSWF transaction is displayed