12-05-2016 7:27 AM - edited 01-21-2024 10:16 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
You can try pusing WAIT upto 10 SECONDS and check the results.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can try this way. Add a step for Wait for 3 sec before the update of table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.