Skip to Content
author's profile photo Former Member
Former Member

PR Workflow wf pur rejo WS65400029 - Rejecting Agent in Container

We launched Workflow wf_req_rel_c and wf_pur_rejo WS65400029 successfully. But we have one additional request: to inform the Agent of WS65400029 about who has rejected the PR. This means the actual Agent of wf_req_rel_c is requested to be displayed in workitem text of wf_pur_rejo. The Problems starts with the fact that this are two different Workflows with no shared Container. We had different ideas to solve the issue, but None of them did really work: a) to propagate the Container element 'actual_agent' via Parameter of Event BUS2105 - Rejection_Start - but there are no visible Parameters in this Event - We could think about creating a ZBUS2105, add a Parameter to the Event and delegate to this Bus Class. b1) to write a "Bypass" table ZCA_SW_ACT_AGENT in program Exit of workflow wf_req_rel_c - we suceeded so far b2) to read this table in a data flow using a Business class in workflow wf_pur_rejo %ZCL_WF_USER.GET_REJ_AGENT(OBJID=&REQUISITONHEA DER.NUMBER&)% - we did not succeed with this issue since this is running in tRFC I have no idea how to debug this data flow method call We find the Agent for wf_pur_rejo by reading the last but one entry in this Bypass table - this works fine. This is the last Person who released the highest release Level before being rejected. c) to read the Container of the "Father workitem" using the data field 'WorkitemFather' in the Container of wf_pur_rejo. Is there a class (e.g. CL_SWF_CNT_* ) to read the external Container: Please help to find an idea to solve this Problem with Minimum effort. Best thanks in advance Dieter

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jan 12, 2016 at 09:11 PM

    @Ronen - I don't know so much about paragraphs, maybe they are overrated and Dieter is ahead of his time, so I'm going to give it a go. @Dieter, my approach would be to read the last rejection, which can be done with function module SAP_WAPI_WORKITEMS_TO_OBJECT. This will get you all the tasks that have worked on the PR. From here it's a simple matter of applying a bit of logic to the results: Filter them by the task ID to get the approval work items, get the latest by date to make sure you have the right one, and if you wanted to take it one step further you could even read the outcome to ensure the last decision was indeed a rejection. One of the result fields should be the actual agent who completed the work item. Hope that helps, Mike

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Mike Pokraka

      @Mike:

      Regarding your question about _WF_INITIATOR: As far as I could see in container in protocol this field contains not the rejection agent but the first agent - the person who created the PR initially.

      But anyway - the solution is working fine by using a data flow method call.

      Thanks a lot indeed

      Dieter

  • Posted on Jan 12, 2016 at 08:31 PM

    How about creating a an attribute for BUS2105 (by delegation) to display the agent who rejected the task? you can find the workitems related to the PR in table sww_wi2obj and then reading the actual agent from table swwwihead or by using FM 'sap_wapi_workitems_to_object'.

    P.S

    kindly use paragraphs.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.