cancel
Showing results for 
Search instead for 
Did you mean: 

leave encashment workflow not working

Former Member
0 Kudos

Hi,

We are using ESS portal version.

I have configured Leave encashment. I have implemented the BADI - HRPBSIN_GET_LE_APPRV to determine the approver of the leave encashment.

Now when an employee creates a leave encashment request, it is getting created. Values can be found in T7INLEAVE_EN_TR table. The approver is getting populated from the BADI. But still the workflow is not getting triggered. In IMG they have mentioned that the workflow will begin automatically if we maintain the approver using the BADI - HRPBSIN_GET_LE_APPRV.

Am I missing any setting related to this workflow?

regards,

suresh

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi Suresh,

If you have followed all the steps mentioned above by our friends, then have a look at the below code in the include

LHRPBSINLEAVE_ENCASH_RFCF01.

*Get the next first level approver.

If the ev_is_self_appr is set then do not trigger workflow. dirctly approves the request.

CALL FUNCTION 'HR_IN_LEAVE_ENCASH_GET_APPR'

EXPORTING

is_p0001 = gs_p0001

iv_appr_lvl = '1'

iv_reference = ps_leave_en_overview-reference

iv_reimb_typ = ps_leave_en_overview-reimb_typ

iv_req_begda = ps_leave_en_overview-request_begda

IMPORTING

ev_appr_id = p_approver_id

ev_is_self_appr = lv_is_self_appr.

IF lv_is_self_appr IS NOT INITIAL.

*TODO: write code for self approval case.

ELSE.

IF p_approver_id IS NOT INITIAL.

refresh lt_agents.

ls_agent-objid = p_approver_id.

ls_agent-otype = 'US'.

APPEND ls_agent TO lt_agents.

ls_input_cont-element = 'USER'.

ls_input_cont-value = p_approver_id.

APPEND ls_input_cont TO lt_input_cont.

ls_input_cont-element = 'Agent'.

CONCATENATE 'US' p_approver_id into lv_agent.

ls_input_cont-value = lv_agent.

APPEND ls_input_cont TO lt_input_cont.

CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'

EXPORTING

task = 'WS18900044'

language = sy-langu

do_commit = 'X'

USER = SY-UNAME

IMPORTING

return_code = lv_return_code

workitem_id = l_workitemid

new_status = l_status

TABLES

input_container = lt_input_cont

agents = lt_agents.

-


Save workitem id of workflow template.

workit_id = l_workitemid.

The above code triggers the workflow for leave encashment , as you are saying you have implemented the approver BADI

then p_approver_id will not be initial and the workflow should get triggered. But even if it is not triggereing then there might be an issue like the workflow task is not made as general task clicking on the header data of workflow template 'WS18900044'.

In any case you can keep a break point at this code in the include and exactly check where you are going wrong. Let me know what you get once in debug mode.

Regards,

Santosh.

Former Member
0 Kudos

Hi Suresh,

If you have followed all the steps mentioned above by our friends, then have a look at the below code in the include

LHRPBSINLEAVE_ENCASH_RFCF01.

CALL FUNCTION 'HR_IN_LEAVE_ENCASH_GET_APPR'

EXPORTING

is_p0001 = gs_p0001

iv_appr_lvl = '1'

iv_reference = ps_leave_en_overview-reference

iv_reimb_typ = ps_leave_en_overview-reimb_typ

iv_req_begda = ps_leave_en_overview-request_begda

IMPORTING

ev_appr_id = p_approver_id

ev_is_self_appr = lv_is_self_appr.

IF lv_is_self_appr IS NOT INITIAL.

*TODO: write code for self approval case.

ELSE.

IF p_approver_id IS NOT INITIAL.

refresh lt_agents.

ls_agent-objid = p_approver_id.

ls_agent-otype = 'US'.

APPEND ls_agent TO lt_agents.

ls_input_cont-element = 'USER'.

ls_input_cont-value = p_approver_id.

APPEND ls_input_cont TO lt_input_cont.

ls_input_cont-element = 'Agent'.

CONCATENATE 'US' p_approver_id into lv_agent.

ls_input_cont-value = lv_agent.

APPEND ls_input_cont TO lt_input_cont.

CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'

EXPORTING

task = 'WS18900044'

language = sy-langu

do_commit = 'X'

USER = SY-UNAME

IMPORTING

return_code = lv_return_code

workitem_id = l_workitemid

new_status = l_status

TABLES

input_container = lt_input_cont

agents = lt_agents.

*-----Save workitem id of workflow template.

workit_id = l_workitemid.

The above code triggers the workflow for leave encashment , as you are saying you have implemented the approver BADI

then p_approver_id will not be initial and the workflow should get triggered. But even if it is not triggereing then there might be an issue like the workflow task is not made as general task clicking on the header data of workflow template 'WS18900044'.

In any case you can keep a break point at this code in the include and exactly check where you are going wrong. Let me know what you get once in debug mode.

Regards,

Santosh.

Edited by: santosh naidu on Jun 29, 2009 3:29 PM

Edited by: santosh naidu on Jun 29, 2009 3:45 PM

Edited by: santosh naidu on Jun 29, 2009 3:45 PM

Former Member
0 Kudos

guys,

its working for me.. let me know if u want any additional information..

regards,

suresh

Former Member
0 Kudos

Hi Suresh,

Have you applied the support package?

In my system i am not able to find the component EA-HRCIN.

How should i find this. we have other components like EA-HR SAP-HR etc.

but no component called EA-HRCIN.

Regards,

Umesh Chaudhari

Former Member
0 Kudos

I have applied the support pack. That fixed the error in workflow...

I hope you will be having a basis consultant to assist you.. Probably he will be in a better position to apply this support pack or install the missing component..

regards,

suresh

Former Member
0 Kudos

Hi Suresh,

We have also applied patch 42 over here.

After implementing the Badi , the workflow is getting triggered but in the approvers inbox after clicking on Launch Webdynpro, no items are shown.

Can you please guide me on the same.

Thanks and Regards,

Nupur Gupta.

Former Member
0 Kudos

HIi Suresh.

Need your help!!!

I am working on leave encashment which is similar as u did.

so please can you guide me on this.

Thanks & regards.

Arsgh5007.

Former Member
0 Kudos

Hi All,

Try searching something related to this issue in SAP service market place.

Refer to SAP note no: 1313761 for this issue. Let me know if it works.

regards,

suresh

Former Member
0 Kudos

Hi Suresh & All,

We are implementing the same leave compensation workflow here. Fortunately, when I was searching the SDN, I saw this SDN posting from Suresh.

I don't know whether your problem got resolved. However, I thought of sharing my issues, I might be able to get some input from you or other possible solutions.

As all they say, I have also implemented the BADI for retreiving the approver.

However, when I create a leave compensation request from ESS, the table T7INLEAVE_EN_TR does not have any entry.

I have maintained the number range as well after seeing the previous posts.

In the case of CLAIMS, there is a program which we have to run to in R/3 to push the request to the approver from the backend. I don't know whether there is any such program to push the request to the approver.

Please do write to me, any possible ideas that might work and hence it can be shared to others as well.

Thanks

Bala

Former Member
0 Kudos

Hi Balasubramanian P,

Maintain the Number Range with the ID as 10.

Read the number range documentation for this.

Regards,

Umesh Chaudhari.

Former Member
0 Kudos

Hi Bala,

Please maintain the number ranges as mentioned by Umesh.

In my case, after maintaining the number ranges, I am able to see the entries in the Leave Encashment table but the workflow is not getting initiated.

I am working on it. I will let you know once its fixed.

regards,

suresh

Former Member
0 Kudos

Hi All,

Use the report HINULEAVE_ENCASH_UPDATE_REQ. to change the status from NEW to tobe Approved.

Select the exact Effective date.

Regards,

Umesh Chaudhari.

Former Member
0 Kudos

Hi Umesh,

The report HINULEAVE_ENCASH_UPDATE_REQ is used to change the status of a request in R/3. But in portal side, a workflow will be initiated as soon as the request is raised. A workitem will get created in the manager's inbox for approval.

regards,

suresh

Former Member
0 Kudos

Hi Suresh,

Here the process is different.

workflow will not be initiated immediately. First of all you will have to change the status of the request to To Be approved then only the workflow will be triggered.

The condition of status to be approved is hard coded before triggering the workflow.

so we will have to find the mechanism to change the status from New to To BE Approved

Regards,

Umesh Chaudhari

Former Member
0 Kudos

Hi Umesh,

In my case, as soon as I raise a request in portal-ess, the status of the request is always 'To Be Approved'. I am not sure why its coming as 'New' in your case.

regards,

suresh

Former Member
0 Kudos

Hi Suresh,

Then this must be because you have implemented the badi for selecting the approvers.

May be i will have to also implement that.

Regards,

Umesh Chaudhari.

Former Member
0 Kudos

Ya, you have to implement that. By default it will not pick up any approver. Just check whether the workflow is getting triggered after Implementing the BADI.

regards,

suresh

siddharthrajora
Product and Topic Expert
Product and Topic Expert
0 Kudos

Try to use standard method and see which gets called! you ll see it

Former Member
0 Kudos

actually by default, the system will not retrieve any approver. Before implementing this BADI, just the leave encashment request gets raised without any approver. The system gets to know the approver only after the BADI implementation. I have tested this. Now I need to know why the workflow is not getting triggered even after getting to know who the approver is? I have searched in all the places but I am not able to find which workflow is associated with this leave encashment process.

regards,

suresh

Former Member
0 Kudos

Hi Suresh,

I am also trying to implement the Leave Encashment.

I am able to see the template in the ESS but when I apply for Leave Encashment from the ESS i do not get any entry in the R/3.

I am Trying to see the leave encashement using the standard reports but nothing is coming there.

also in table T7INLEAVE_EN_TR there is no entry into that.

Pls tell me is there any other settings I will have do for teh flow to happen.

-


Maintained the Number range and the above Problem is solved -


Regards,

Umesh Chaudhari.

Edited by: Umesh Chaudhari on May 26, 2009 5:57 PM

Former Member
0 Kudos

Standard workflow for the Leave Encashment is WS18900044

Note For request with status 'New' the workflow will be triggered when the request will be sent to approver

Regards,

Umesh Chaudhari.

Edited by: Umesh Chaudhari on May 26, 2009 6:04 PM

siddharthrajora
Product and Topic Expert
Product and Topic Expert
0 Kudos

When you implemented the BADi, have you also copied the standard WF methods in it?

Also make the WF and task as general

Former Member
0 Kudos

Hi Siddharth,

While implementing the BADI - HRPBSIN_GET_LE_APPRV, I have just done some coding in the GET_LE_APPROVER method and exported the parameter - APPRVR.

Do I need to include some more in this? Also there is one more export parameter - IS_SELF_APPR. But I didnt pass any value to this.

Also, I am not able to find which workflow is associated with this. Can you let me know the WF template for this process?

Thanks & Regards,

Suresh