Skip to Content
0

Workflow event fails to get triggered sometimes.

Dec 05, 2016 at 07:27 AM

334

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Best Answer
Jahnavi Priya Dec 15, 2016 at 11:15 AM
1

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

Share
10 |10000 characters needed characters left characters exceeded
Anjan Paul Dec 05, 2016 at 09:37 AM
1

Hi,

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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.

0
Jānis B Dec 06, 2016 at 06:20 AM
1

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.

Share
10 |10000 characters needed characters left characters exceeded
Anjan Paul Dec 06, 2016 at 09:15 AM
0

hi,

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

Share
10 |10000 characters needed characters left characters exceeded
Jahnavi Priya Dec 06, 2016 at 07:36 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Jahnavi Priya Dec 06, 2016 at 07:36 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded