Question:
We are on release 4.6C.
My workflow is set up with two triggering events, CHANGED and CREATED. I am using object type ADDRESSEMP. The objective is to send e-mail notifications to the appropriate users in HR, Benefits and FI for subsequent tasks to be completed.
The problem is that a single change (via trans. PA30) to the employee's address infotype can result in both of the events being triggered, depending on what validity date parameters the user has entered. In the case of the CREATE event, an e-mail will be sent with the data from the original record, along with a second e-mail with the current data. The users want only the second e-mail. There could be potentially hundreds of changes/creates performed, and they don't want to have to wade through all of their e-mail to find the correct one.
If I have missed something obvious, I humbly apologize in advance.
Thanks!
Rum River
Answer:
hi,
in event-->WI triggering you can put conditions on it with SWB_COND, or you can do it in swetypv by using check function modules.
Kind regards, Rob Dielemans
Answer:
Thanks for the quick response.
I tried SWB_COND (Start conditions) and SWETYPV.
On our release I need the function module HRPAD00_WF_CHECK_OBJTYPE in the "Check Function" field for an OSS fix to prevent double executions of the workflow.
I created a start condition, but it will automatically replace the OSS function module, my OSS fix is replaced, and then I have double executions of the workflow.
Is it possible to have more than one check function module? Is it possible to name a check function module in the "Receiver Type FM" field?
Answer:
Hi,
In your case, don't do it with SWB_COND but only put logic in the check funstion module.
The way these work, is that only if no RAISE occurs, the event gets delivered to the WF.
Kind regards, Rob Dielemans
Answer:
Thanks, I'll give it a try.
Answer:
OK, I'm still battling this one.
I have created a custom check function module, within which I need to check an infotype table (PA0006) for a specific record. If that record is found, I raise an exception and the event containing the "as-is" data is blocked. If a record is not found, the event is allowed to continue with the "new" data.
The trouble with this is that the select statement reading PA0006 is getting records from the buffer, so it always finds a record and always raises an exception, blocking both events.
I have tried the 'bypassing buffer' statement, I have tried the HR_READ_INFOTYPES function module using the 'bypassing buffer' parameter, and I have tried one of the HR macros as well. I am still getting records from the buffer.
I am now trying trans. SWU_EWCD to work this from a 'change document' angle. but receive a message saying there is no change document object for ADDRESSEMP for a 'create' event.
SAP says to contact them for resolution, but first I'd like to know if anyone else has had this problem, and what they did in their case.
Answer:
Hi,
One way is an explicit commit work, this will make the changes in the database.
However this is not recommended. What you can also do is, change the WF template. In the first step of the WF create a step which reads the db for the record and if its found, it kills the WF.
Kind regards ROb Dielemans
Answer:
I'm more than willing to try changing the template.
But, if I'm having trouble reading from the buffer rather than the db table while in my check function module, won't the logic have the same problem wherever it's used?
Rum River
Answer:
By the way, I agree with you regarding the commit work.
Besides, that would put the records in the database, and my logic relies on them NOT being found.
Rum River
Answer:
Hi,
I think it's faster to accomplish and easier to test if you just change the WF template, to have this check.
Regards, Rob Dielemans
Answer:
I appreciate your input, I'll let you know what happens.
_________________
Rum River