cancel
Showing results for 
Search instead for 
Did you mean: 

How to get status from Decision step?

Former Member
0 Kudos

Hello Experts,

I need to get the status of Approve or Reject from user decision step. How can i do it??

Thanks,

Mohammed.

Accepted Solutions (0)

Answers (2)

Answers (2)

I042439
Employee
Employee
0 Kudos

Hi Mohammed

It's always good to explain fully!

Where do you need to know the decision? In the WF ? Outside the WF? Some later step of the WF?

If in the WF, Gautham has already explained it.

If outside the WF in an independent ABAP code, you can call FM SAP_WAPI_DECISION_READ. You would however need a work item ID of the decision step.

If the question pops up "How do I get the Workitem ID outside the wf" then please do explain what exactly are you trying to achieve, what is the base object (PO or a PR or a Leave Request), what is the BO and so on.

Regards,

Modak

Former Member
0 Kudos

Hello Modak,

I am writing ABAP code to fetch status. The full scenario is given below:

I got a button on screen, clicking that button will pop-up 3 fields and a submit button (Webdynpro screen). Now i need to enter the 3 fields and upon clicking the submit button workflow triggers with custom business object. Basically business object will pass data from webdynpro screen to workflow. workflow has an activity step, email step and decision step.

Retrieved the container elements(i.e. 3 input fields given from webdynpro screen) from email step and need to get the status from user decision. I dont know how to link between email step and decision step as both got different TASK id and Workitem id. 

Thanks,

Mohammed.

I042439
Employee
Employee
0 Kudos

Hi Mohammed

If I understand you correctly, you need to send an email AFTER the decision and inform on the 3 fields + the decision (Approved or Rejected) ..... then please follow what Gautham advised ... set a workflow container element , say APP_RSULT to 'Approved' in the Approval Branch and to 'Rejected' in the rejection branch. Use that in the email step.

or create two separate email steps, in each approval branch of the workflow - each can have entirely different text based on the decision.

Regards,

Modak

GauthamV
Active Contributor
0 Kudos

You will have different branches after user decision step.

In these branches you can create containers or activity step to capture this data.

Other way of doing it is, find an  implicit enhancement which triggers after this user decision step and  write your logic there.

Regards,

Gautham.

Former Member
0 Kudos

Hello Gautham,

I am using Container Element to capture the data. Can you please explain in detailed steps, how to capture the status??

Thanks,

Mohammed.

former_member185167
Active Contributor
0 Kudos

"how to capture the status??"

Have a look at the container of the Decision step after it has been executed.

One of the elements will contain the result. Pass that back to the workflow container.

Or, you can add an extra step in the Yes branch to set result_value = Yes. You have to create the container element result_value in the workflow container.