cancel
Showing results for 
Search instead for 
Did you mean: 

ESS leave requets approvers

Former Member
0 Kudos

Hi,

We are implementing the leave request application in EP 7.0.We are using two workflows for two types of leave, for the first type of the leave the approver is the line manager, for the second one the approver should be a holder of a certain position. We created the two workflows (using the standard WS12300111), made the adjustments in the task Approval process and in the type of leave processing, but in the leave request screen appears only the name of one approver, no matter what the type of leave is selected.

Please advise!

Regards,

Alice Modoran

Accepted Solutions (0)

Answers (3)

Answers (3)

siddharthrajora
Product and Topic Expert
Product and Topic Expert
0 Kudos

Do this

You may need to use BAdi for these changes.

Inside the function module PT_ARQ_SEARCH_NEXT_PROCESSOR we have provided

the BADI where the customer can have their coding. There are methods

provided FILTER_NEXT_PROCESSOR and CHECK_SELECTED_NEXT_PROCESSOR etc.

Please check the BADI PT_GEN_REQ for more information

siddharthrajora
Product and Topic Expert
Product and Topic Expert
0 Kudos

Are you having Different Rule groups for the absence type? Please check this

Under Rule group you determine how the approver should be identified

Also if you want to determine Approver for the different absence type, Your WF is correct method

but apart from this you can use the BADI PT_GEN_REQ, WHich is fairly easy to implement

Former Member
0 Kudos

Hi,

The absence types are in the same rule goup. I have to create a different rule group for the second type of absence?

Thank you!

Former Member
0 Kudos

Hi Alice,

In the leave request screen appears only the name of one approver

It is SAP standart fucntionality ..

if you dont want to display that ....

by configuration U can achive that

Personnel Management -> Personnel Administration -> Personnel Data -> Employee self service -> Service Specific settings -> Working Times -> Leave Request -> Processing Process -> specify processing process of leaves types

In User Interface Elements

you need to unchcek "Display Field for Next Agent"

Former Member
0 Kudos

Hi Vivek,

There are 2 approvers : one person for annual leave, another person for sick leave. Now it is displayed as approver the one for sick leave even though I select annual leave as type of absence.

Former Member
0 Kudos

Hi,

But the approvar will be same right ...

if he want to change his next approvar then there is opion

in SPRO ( in the same path what i mention )

in the User Interface Elements

below "Display Field for Next Agent "

tick on "requester may change NExt Agent "

and try

Former Member
0 Kudos

Hi,

The problem is that the approver must be proposed automaticaly for both absence types. I've created 2 different workflows and assigned them acordingly.

Former Member
0 Kudos

Can you please confirm following.

1. Have you copied ws12300111 and made any changes to the rule of the workflow.

2. The reason that only one approver views the requets is because the actor table (PTREQ_ACTOR) is not getting field with appropriate vaule.

can you please check with se16 the PTREQ_ACTOR table entries and confirm if you find the position that is unable to view the entires.

also I assume that workflow is going to the right user but the issue is the approve unable to view actual leave requests.

Kindly confirm

Former Member
0 Kudos

Hi,

The approver is not proposed correctly from the start when I create the leave request

Former Member
0 Kudos

Hi,

To be precise: we are using 12300111 for annual leave and it works, actually it worked until I've created this second WF for the sick leave, now the proposed approver for both types of leave is the one which is suppose to approve the sick leave. The second WF is a copy of 12300111 which I modified as follows: on the task approval process (a copy of the standard task) I've selected the position that the person who approves the request should have.

Former Member
0 Kudos

ok the issue here is that the workflow would go to the value of field &Agent_0001.Agents&.

this field is determined from the leave application. My suggestion is use the badi that siddharth suggests and determine the alternate approver. Make sure the actor table that I was refering to is filled with the position that is the approver of the sick leave.

There is an issue with the way you have approched the change.

Use badi instead of modifying the workflow. you can use same workflow for both leaves by using badi.

Former Member
0 Kudos

Hi,

Thank you for your answer, if I knew how to use the badi I would use it, unfortunatly my knowledge in this area is quite limited, could you please give me more input on how I should approach this?

Thank you!

Former Member
0 Kudos

Personnel Management -> Personnel Administration -> Personnel Data -> Employee self service -> Service Specific settings -> Working Times -> Leave Request -> Business Add-Ins (BAdIs) -> click up on BAdI: Control Processing Processes for Time Management Web Applications .

and then you need to implement BADI PT_GEN_REQ .

Former Member
0 Kudos

Hi,

I have implemented BADI PT_GEN_REQ, but now there is no approver proposed in the portal.

The two types of leave are now in the same rule goup and I have attached a custom workflow to each type of absence. I can see both types of leave in the portal, but I don't have an approver for neither of them.

Sugestions?

Regards,

Alice Modoran

Former Member
0 Kudos

Boss,

I have some query on the question that u been raised.

I havenu2019t understand the concept and logic that for two different leave u have two different approval .

Boss its 1st time I come across

How you can configure tow approver for one employee ...

Former Member
0 Kudos

Hi Vivek,

Maybe this will sound a little bit more logical....our client wants that the annual leave to be approved by the line manager, whereas the sick leave to be approved by the person holding the position of medical coordinator...it has some sort of logic, the problem is that I dont know if this can be implemented in SAP without doing some ABAP coding (I don't write ABAP code). If you have any ideas I will be very glad to hear them because at the moment I am stuck.

Best regards,

Alice Modoran

Former Member
0 Kudos

Hey you requirement is big shot to head .

I will give you process logic to you ,,,, while implementing this take you ABAP help .

See once you implemented PT_GEN_REQ BADI in that..

You need give following logic for coding.

You need to select the data from PA0105 to get the pernr of userid

Select PERNR from PA0105 into P_PERNR

where SUBTY = u20180001u2019

and USRID = sy-userid.

You need to select the data from PTREQ_ATTABSDATA .

Select * from PTREQ_ATTABSDATA into table ( itab )

where PERNR = P_PERNR

And INFOTYPE = u20182001u2019 .

Once you get the data in the i_ PTREQ_ATTABSDATA .

Loop at I_PTREQ_ATTABSDATA .

If SUBTY = u201Cannual leaveu201D

****Then for finding the line manager code****

Select * form pa0001 into table i_pa0001

Where PERNR = P_PERNR

Loop at I_PA0001 .

Select * from HRP1001 into i_HRP1001

Where OBJID = I_PA0001-ORGEH ( Org unit )

For line manager.

Loop at i_HRP1001 where RSIGN = u20182u2019

And RELAT = u2018002u2019.

Select * from PTREQ_ACTOR into table I_ PTREQ_ACTOR

Where ACTOR_ID = PTREQ_ATTABSDATA- ITEM_ID

Loop at I_ PTREQ_ACTOR .

Move ( line manager penr[ which you will get from i_HRP1001 ] ) to

PTREQ_ACTOR-OBJID .

Modify table i_PTREQ_ACTOR

Endloop.

Update PTREQ_ACTOR from i_ PTREQ_ACTOR.

End loop.

End loop.

End loop.

****Then for Chief code code****

Select * form pa0001 into table i_pa0001

Where PERNR = P_PERNR

Loop at I_PA0001 .

Select * from HRP1001 into i_HRP1001

Where OBJID = I_PA0001-ORGEH ( Org unit )

For Chief code.

Loop at i_HRP1001 where RSIGN = u2018Au2019

And RELAT = u2018003u2019.

Select * from PTREQ_ACTOR into table I_ PTREQ_ACTOR

Where ACTOR_ID = PTREQ_ATTABSDATA- ITEM_ID

Loop at I_ PTREQ_ACTOR .

Move ( line manager penr[ which you will get from i_HRP1001 ] ) to

PTREQ_ACTOR-OBJID .

Modify table i_PTREQ_ACTOR

Endloop.

Update PTREQ_ACTOR from I_ PTREQ_ACTOR.

End loop.

End loop.

End loop.

Endloop.

Former Member
0 Kudos

vivek sorry for jumping in

the code needs a lot of change however the logic is fine.

i suggest please use rfcs/bapis strictly as i see some select between loop and endloop.

hr_getemployeedata_fromuser

hr_read_infotype

rh_struc_get

avoid all the selects.

apologies if above is out of reference..

Former Member
0 Kudos

Hey Dude,

Good to see you back on SDN ..

Y sorry man ......you suggested is correct only ....

I was in hurry that Y I gave that .

Keep replying on u2018SDN" .