cancel
Showing results for 
Search instead for 
Did you mean: 

Approver in Time sheet

Former Member
0 Kudos


Hi Experts,

My question is : An employee has submitted Time sheet now business wants to see by position code or employee number with whom Time sheet is pending. Is there any report available for this? or any other workaround solution for this. please guide.

Thanks,

Accepted Solutions (0)

Answers (4)

Answers (4)

mohit_bansal3
Active Participant
0 Kudos

Hi ,

You can try using the standard SAP Report (RPTARQDBVIEW) , having lot of options with respect to Leave Request is concern.  ( either Tcode as PTARQ , then select DISPLAY Document).

Just select the document status as "SENT"( means which is not approved / Posted Yet).

Regards,

Mohit Bansal

I042439
Employee
Employee
0 Kudos

Hi

Your question can mean the following:

1) Enter Position/ Employee code of the Approvers and get the time sheets pending with them for approval?

2) Enter Time sheet number(s) and get the Agents?

3) Something else? ... then please elaborate

In any case, there is no standard report and you will have to build one.

For Option 1

a) Call FM RH_STRUC_GET with the correct Object Type, Object ID and WEGID = 'WF_ORGUS' (all users of object and get the users assigned to the position/CP

b) Then query table SWWUSERWI to get All the work items assigned to the user.

SWWUSERWI-USER_ID =  the user range from above

SWWUSERWI-TASK_OBJ = TSxxxxxxxx (the task id of your Time Sheet approval task ... there can be other type of workitems assigned to the user...this will filter them out

SWWUSERWI-NO_SEL = space

SWWUSERWI-NO_EXECUTE = space

c) Now you have the Time sheet WI assigned to a user  - next is to reach to the time sheet number

Now with all the mass workitems - query table SWW_WI2OBJ to get the Objects assigned to it

SWW_WI2OBJ-WI_ID =  work item range from the above

SWW_WI2OBJ-WI_RH_TASK = TSxxxxxxxx (the task id of your Time Sheet approval task) -- really not necessary because you have already filtered them in step 1.b

SWW_WI2OBJ-CATID = 'BO' if you are using Business Object or 'CL' if your workflow is class based

SWW_WI2OBJ-TYPEID = Your Business object / Class of the Time sheet workflow

SWW_WI2OBJ-INSTID = this will hold the Instance Number - See what is the key of your BO/Class and INSTID will be a concatenated string of your key (if there are multiple keys).

For Option 2

Just go in reverse order of the above steps:

a) build INSTID and get the Workitems from the table in 1.c

b) Table SWWUSERWI will give all agents of the 2.a work items

c) get Pernr of the users from table PA0105; get Positions of those employees from PA0001 or use what Sandy has mentioned above

Above are based on Table Fetches as for mass processing - alternatively you can use SAP_WAPI* Functions to get the data individually

regards,

Modak

SandySingh
Active Contributor
0 Kudos

Hi

If you have the approver User ID's then you can query HR Tables PA0105 to get the pernr and then query Table HRP1001 to get the position ID A008 linked to PERNR

To get the User ID of approver, you can use FM SAP_WAPI_GET_WORKITEM_DETAIL or SAP_WAPI_WORKITEM_RECIPIENTS or SAP_WAPI_GET_WI_AGENTS

Regards

Sandy

former_member185167
Active Contributor
0 Kudos

Hello,

They can see who it is with in the workflow log (SWI1) but if that isn't suitable then you can write some ABAP to do it. Look at the SAP_WAPI* function modules, they will provide the information you need.

regards

Rick Bakker