Hello Everyone,
I'm trying to get something accomplished using Secondary Methods and Conditions of a UD Task, but unable to. Hoping to get some insights here.
I have a WF designed which gets triggered from a BADI using the SAP_WAPI* FM. Once the Work Item appears in the Workflow Inbox of the recipient he takes an Action (Task is Complete) which will complete the workflow. But before the User acts on the work item he has to make a table update in the GRC system and then only complete the Work Item in his Inbox. I have a custom BAPI which checks whether the table has been updated or not. This BAPI is called from my Custom BO Method.
The problem Im facing is that as soon as the user approves the work item (irrespective of whether he completed the task or not), the Work Item disappears from his Inbox. After the UD step I have an activity step which checks whether the table is updated or not. If the table is really updated, then the Workflow gets completed, else it sends a Reminder email to complete the task.
I would ideally want to call the BAPI when the UD is done and depending on whether the table is updated or not, I want to either complete the workflow or thrown an error/exception or re-trigger the same Work Item again (to let the user know that the task is still incomplete). So Im trying to achieve this using the Secondary Methods. For this Im giving the Custom BOR and Method (which calls the BAPI to check the table) in the "Methods After Work Item Execution" panel. And in the Conditions tab I'm giving a condition to check if the BAPI Return is a S (Success if table updated) or E (Error if table is not updated).
But this is not helping, since, as soon as the User takes a decision the work item disappears from his Inbox(and would subsequently get notifications - which could be easily ignored). I would like to know what's the best practice in these cases? If the User action is incorrect, what should happen? Error thrown or WI re-triggered? And what would be the ideal solution? Thanks.
pk
PS: I guess I cannot use Program Exits since I read somewhere that a Program Exit should not make an RFC Call.