Additional Blogs by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Can one have decision buttons within an interactive form that is used within a Guided Procedure step? Well recently I came across such a requirement and with a simple workaround things worked very smoothly. To get an understanding of the requirement, let’s take the example of the well known leave request process. Let’s assume that once manager gets the interactive form in his mailbox, with the details of the leave request, he wants to have the buttons “approve” and “reject” in the interactive form itself. Is this possible to achieve? We know that there are no result states to the interactive form callable object. I am going to describe a simple two step process to meet this requirement. I have taken the offline form as an example, but it is also applicable for online submissions. Though technically possible, the online submission may not make sense from a requirement perspective, since if the approver is online we might as well give him access to an online UI instead of a form.

Step1. Create your interactive form: Open your interactive form using the form designer and add the two buttons “Approve” and “Reject”. Make sure that both the buttons are “submit” buttons and meant for offline submission with the URL being %com.sap.caf.gp.if.PostProcessorUrl.mailto.prefix% .(you could also do online submission). But now both the buttons are exactly the same how do we differentiate? Well, I added a new check box in the form, named it “Approved” and made it invisible. Now click on the buttons we added earlier and in the “enter” event add the following formcalc code. In the “Approve” button – check box Approved is set to 1 and for the “Reject” button set Approved to 0. By doing so when the appropriate button is clicked the checkbox will be either set or not while submission. With this, we are done with the form design.

Step 2: Designing and branching within Guided Procedure process. In your Guided Procedure process immediately after your offline form action step, add a new step which will help to resolve the result states. I have used a business logic callable object for doing so. Here are the steps to create such a callable object. Create a Business Logic type Callable object. Add a Boolean type input parameter “Approved”. Add two result states that will have the logic as shown. This will make this callable object resolve to either of the result states based on the value of the parameter “Approved”. Now we can add it to the process and this how it will look like. So immediately after the “Offline Leave Approval” step you should have the “Decision” step which will help resolve the result states. You will have to do parameter consolidation of the #147;Approved” output parameter (of the “Offline Leave Approval” step) with the “Approved” input parameter (of the “Decision” step). Based on the result states of the “Decision” step you can navigate as shown to send an approval or a rejection mail notification. After understanding the two steps described here you would have got an idea how to implement an approval or any decision capability into an interactive form which is used within a guided procedure step. Applies to: Netweaver 04s SP08 Related Content See the section CAF Functions in detail-> UI Layer ->Interactive forms in SAP CAF Tutorial Center Especially the how to guide on creating a form based process in Guided Procedures: Creating a Form-Based Process Using Adobe (GP)

10 Comments