Enabling Approval within Interactive forms
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)