cancel
Showing results for 
Search instead for 
Did you mean: 

Custom HR Workflow not detecting changes during termination action

former_member189690
Participant
0 Kudos

Hello gurus,

We have set long time ago a custom workflow to send some emails when an employee is terminated in the company. We have used a custom function module that is triggered when infotype 0001 is created. This function module is a copy from standard one HR_EVENT_RULES_0001. The issue we are facing is during the termination action this function module is called but for some reason it is not detecting the change of employee group (terminated) and does not recognize the condition to trigger the proper event COMPANYLEFT to start the workflow.

There are two import parameters in this FM, beforeimage and afterimage. This afterimage is supposed to have the new info of the new record (with employee group terminated) but is not the case.

The "funny" thing is that I have detected the pattern of the issue, and is only happening when termination action create vacancy on the position which is being terminated. If I terminate an external employee, who doesn't have any position (no OM integration, no popup to create vacancy) is working fine, the FM gets proper parameters and workflow triggers well. I have tried to deactivate the popup to delimit the position but still not working...

I have checked the customizing transactions related with Event linkages and all seems to be fine.

I can give you as much additional info if you needed. I'm really really frustrated with this matter 🙂

Any idea?

I will get crazy!!

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

pokrakam
Active Contributor

This sounds a bit more like an OM issue than workflow. Can you compare the afterimage of the two scenarios and see if there is another field you could use to determine whether it's a termination? I think the most sensible explanation of what might be happening is that, because the position is not being terminated, instead the employee gets 'moved out'. But an HR expert can give you a more definitive answer on that part.

Alfonso1
Discoverer
0 Kudos

Thanks for the answer Mike, but unfortunately I do not have any other field to do the check.

In fact my issue is that the workflow is triggered when I try to delimit the position and I want to trigger the workflow when action is changing IT0001. I have reviewed my customizing and I have set the function module call on P0001...Don't understand why is being triggered when saving IT0000.

Any HR expert please?

siddharthrajora
Product and Topic Expert
Product and Topic Expert
0 Kudos
0000 is actions, you can start an action ie termination there and its updated and also corresponding infotypes like 0001 etc.

former_member186746
Active Contributor
0 Kudos

Hi,

Infotype 0000 is actions. Check SWEHR2 if the function module to determine the proper event on the business object (BUS0165 probably) is working as it should. If in your case the system behaves differently then I suggest to add a custom entry in SWEHR3 and a custom function module to determine the correct event.

Kind regards, Rob Dielemans

Alfonso1
Discoverer
0 Kudos

Hello Rob,

Thanks for your help.

Please, find attached two screenshots of what we have in system customized.

In the first one SWEHR2, as you can see, there is no entry with my custom function module Z_HR_EVENT_RULES_0001.

In the second one SWEHR3 I have an entry set for IT0001 but is not being triggered whe IT0001 is saved...

I forgot to mention that we have a custom business object (ZHIRINGNOT) to send a broadcasting to user when some employee is terminated.

Do you see any wrong entry on there that could provoke the issue? Maybe should I delete the one related with BUS1065? Are these BUS1065 really needed?swehr2.jpgswehr3.jpg

Regards,


former_member186746
Active Contributor
0 Kudos

Hi,

are you sure that the function module is not executed? Just add a message type X to force a short dump to quickly check if your code is even reached at all.

For your requirement, I would've gone with dynamic actions to send an email or whatever in the case of termination.

Kind regards, Rob Dielemans

Alfonso1
Discoverer
0 Kudos

Hello,

The Z function module is executed twice. First time when saving IT0000 and second time when system is prompting popup to create the vacancy on the position and click on 'Yes'. No execution when IT0001 is saved... very strange.

Regards,

Answers (0)