|
Blogs
In Volker Drees' recent blog How to set up an easy Material Master creation Workflow for Duet you've seen how to create a custom SAP Business Workflow that exposes its user decisions to Duet or Alloy.
After you've implemented the steps Volker describes in this great blog, your SAP Business Workflow will expose 5 material values (ZMaterialNumber, ZMaterialText, ZMaterialSizeDimensions, ZMaterialEAN, ZMaterialEANCategory) to Alloy. You can see those 5 values (in the Document properties) coming along with your user decision Note, that asks the Lotus Notes user to Approve or Reject the newly created material. Please note, that we'll use slightly different material values in this example than Volker used. We'll use ZMaterialNumber, ZMaterialText, ZMaterialGroup, ZMaterialNetWeight, ZMaterialWeightUnit as example values. First let's try to understand how Lotus Notes and Lotus Domino handle generic workflow Notes coming from SAP. You might have already seen the Alloy workflow configuration on Lotus Domino. Knowing that, let's open Domino Designer and have a look at this ERPApprovalForm. Please note: Changing the Lotus Domino master mail template can cause severe problems on your Lotus Domino and Lotus Notes system.
The default ERPApprovalForm is quiet simple. It contains a header, a comment section and a body. We could now simply add some fields into this form, which would display our custom material values. But with that ERPApprovalForm would loose its generic character, as ERPApprovalForm would always try to display material values, even if you're using ERPApprovalForm in some totally different workflow as well. A better way to handle this is to embed a computed Subform into ERPApprovalForm. Let ERPApprovalForm compute (based on the field BoundItemType) during runtime which concrete Subform it should embed. Check the box Insert Subform based on formula and click OK In the value field of the Subform enter BoundItemType and save the form This will cause Lotus Domino to check the value of a field BoundItemType (which is contained in every Alloy workflow Note) and use the values' name to determine which Subform should be embedded. So if the value of BoundItemType is myForm, Lotus Domino will try to embed a Subform called myForm. Having explained that, we know now what to do next: create a Subform which will display our material values. In the Shared Code part of your mail database you can find a Subform section containing all existing Subforms of the corresponding database. Go there and hit the button New Subform. As explained above ERPApprovalWorkflow form will seek for a Subform that name matches the value of the BoundItemType field. Remember what I said earlier? Keep the BoundItemType value in mind, as we now need it as name for our new Subform. Create a table in that Subform that we can use to display our custom material values. Now look into the SAP Business Workflow Builder (Transaction: swdd) to see the custom material fields again. As seen at the very beginning of this blog, the workflow container elements will arrive in Lotus Notes with a prefix called: WorkflowContainer00. Save the new subform and you're done.
But wait what about this requester field we put in addition to our table? As said above, the intension of that field is to display the workflow initiator name (the name of the person who requested the material approval). To achieve this Lotus Sametime integration make sure the field is of type Names and the fields value is getting Computed. Now go to the second tab and make sure the box Show online status is checked. But what should we enter in the fields' value? Where do we get the requesters' name from? The requester name is also part of the Notes document send by Alloy. The field is called RequesterName but it contains the SAP username of the requester and not the full qualified Lotus Domino username we require for Lotus Sametime integration. The following script will do this mapping for us in a very simple manner. (Note the limitation comments in the script) Place this script in the Queryopen event of your material Subform The script will try to lookup the SAP username in the Lotus Domino Directory and map it to the requesters' Lotus Domino username. The requesters' Lotus Domino username will be added as a new field to the Notes document called RequesterName. Therefore add RequesterName as field value to the tables' Requester field. Lotus Script:
Save the Subform and you're done!
Dirk Lehmann is currently working as a Regional Group Specialist for Alloy (formerly known as project "Atlantic") in the Information Worker Division. He began his SAP career in 2001 as an SAP NetWeaver developer for Java. Prior to this career at SAP, Dirk worked for IBM Germany. |