Creating Attachments To Work Items or To User Decisions in Workflows
Creating Attachments To Work Items or To User Decisions in Workflows
Creating Attachments To Work Items or To User Decisions in Workflows
Applies to:
Product release ECC 6.0. For more information, visit the Business Process Modeling homepage.
Summary
This document gives a brief idea about attaching a document to the work item or to the user decision step.
Author Bio
Ramakanth Reddy is an engineering graduate with a rich experience of 4 years in SAP. He has
extensively worked in ABAP, ABAP HR, XI, and WORKFLOW. He is currently working for IBM
India Pvt. Ltd.
Table of Contents
Business Requirement........................................................................................................................................3
Creating Adobe Form Output as an Attachment to Work Item .......................................................................3
Related Content................................................................................................................................................19
Disclaimer and Liability Notice..........................................................................................................................20
Business Requirement
Now a days, sending documents like WORD, PDF or any document from the system as an attachment has
become a typical requirement in workflow, technically speaking sending an attachment to work item or to
User decision. This document explains how to create documents like WORD, PDF as an attachment to the
workitem or to user decision step.
• Creating an attachment of online documents like output of the adobe forms or sap scripts or smart
forms.
• Creating an attachment of offline documents like PC files.
When the program ‘YTESTWF’ is executed we would able to view the Adobe form output, for reference find
the below screen.
Now, based on the requirement this adobe form needs to be sent as an attachment to workitem or to user
decision step in workflow.
2) The above all options are in XSTRING format, Now take the option FPFORMOUTPUT-PDF and
convert the XSTRING to BINARY format and find the size the document by using the below
Function Module, please find the below screen shot-
4) Source code of Program YTESTWF which will pass the required information to workflow, Please find
the below screen shot-
5) Create a Business object ‘ZHOMORG’ with method ‘ATTCHDOC’ and it should be in background
mode, Please check the below screen shots it will help you to create the business object
In the above method, we have called the Function Module ‘SAP_WAPI_ATTACHMENT_ADD’ to create an
attachment to workitem. We need to pass the XSTRING data to the above function module. Before doing this
use the function module SCMS_BINARY_TO_XSTRING to convert from BINARY format to XSTRING
format. Now pass the WORKITEM ID, Header and XSTRING variables to the Function Module it will give the
Attachment ID as an output. Now create an instance to SOFM.
Design workflow: --
Container Elements – Need to create container elements which we are getting from program YTESTWF.
Now activate the program, workflow & Business Object and execute the Program YTESTWF.
Go to Transaction SWI1 - > execute, Please find the below screen shot -
Once you execute, you will find the below screen shot –
Double click on the workitem 425127, you will get the below screen: -
In the above Screen shot, you will find the Button Attach with document icon. Please observe it.
If you click on that button, you will get the popup screen and form document as shown below.
If you want to send this to user decision, please add user decision step after the create attachment task,
please find the screen shot-
After adding the user decision to the workflow, activate and execute the program YTESTWF. You will find the
user decision step at in your box as shown below.
Click on the office Document: Form, you will get the document as shown below.
Related Content
Forums
Workflow http://www.sap-img.com/workflow/sap-workflow.htm
Download
Business Workflow
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMSTART/BCBMTWFMSTART.pdf
For more information, visit the Business Process Modeling homepage.