cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow event fails to get triggered sometimes.

Former Member
0 Kudos

Hello All

I am supporting already implemented Workflow. My requirement is to update the custom table with the Workitem ID after the workflow has been triggered. I am calling SAP_WAPI_CREATE_EVENT to create an event.The logic is written as follows :

1. In Program before creating event : Insert all relevant data into Custom table except for the Workitem ID.

2. Create event using SAP_WAPI_CREATE_EVENT.

3. In workflow, the first step is to update the Custom table with the Workitem ID for the entry added before.

This workflow has been working propely for years now.

Now the issue is sometimes(5% error case) the workitem ID fails to get updated in the custom table.It could be due to one of the following reason.

1. In workflow step , update table fails as the data inserted is not saved yet . I explicitly added COMMIT WORK after insert (before event create) to make sure this happens. Although this did not solve the Issue.

2. Second and most probable cause is "Event fails to get triggered at times". Hence I have entry without work item id in the table.

Please suggest how to handle this issue.

Client would prefer if i make changes only in the program and not touch the already implemented workflow.

I am new to workflow and any help would be helpful.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hello

I solved the issue with the use of Function Module 'SAP_WAPI_WORKITEMS_TO_OBJECT' to check if any workitem was generated from the event. I checked custom table to see if Work item has been created for the event , if no entry found I gave error message to User.

Thanks

Answers (5)

Answers (5)

anjan_paul
Active Contributor

hi,

You can try pusing WAIT upto 10 SECONDS and check the results.

Private_Member_7726
Active Contributor

Just for understanding - the event triggers (starts) the workflow?

If yes, aren't you able to determine, whether the workflow was started for the entry in question?

To see whether events are triggered and delivered, i'd try to switch on the event trace.

anjan_paul
Active Contributor

Hi,

You can try this way. Add a step for Wait for 3 sec before the update of table.

Former Member
0 Kudos

You mean in the calling program ? As i mentioned customer does not want me to touch the existing workflow. Is it possible to add some code in the program itself?

Thanks for your reply.

Former Member
0 Kudos

Event trace is not switched on in our production system. Is it advisable to switch it on?

Yes, the event would eventually trigger the workflow but I am unable to find out if any workflow was triggered from the event created through SAP_WAPI_CREATE_EVENT . There are more than 100 entries per day and only 1-2 fail to generate workflow. We monitor these reports through the custom table itself. If the Workitem ID is not getting updated in the table then there is no way for us to trace the issue/ event/workflow.

Are there ways to fine tune the event workflow job SWWCOND ?

I thought of checking the custom table after the FM call for Workitem ID ( Workitem ID gets updated in Workflow) and then update the table with fail remark after "WAIT upto 10 seconds" but I am not sure if it would be enough time to execute the workflow.

Former Member
0 Kudos

Event trace is not switched on in our production system. Is it advisable to switch it on?

Yes, the event would eventually trigger the workflow but I am unable to find out if any workflow was triggered from the event created through SAP_WAPI_CREATE_EVENT . There are more than 100 entries per day and only 1-2 fail to generate workflow. We monitor these reports through the custom table itself. If the Workitem ID is not getting updated in the table then there is no way for us to trace the issue/ event/workflow.

Are there ways to fine tune the event workflow job SWWCOND ?

I thought of checking the custom table after the FM call for Workitem ID ( Workitem ID gets updated in Workflow) and then update the table with fail remark after "WAIT upto 10 seconds" but I am not sure if it would be enough time to execute the workflow.