If the Winshuttle Function Module (WFM) is installed on the SAP system, you can attach documents to transactions for some t-codes that are recorded in Batch Input mode, Non-Batch with Controls mode, or Non-Batch without Controls mode. See below for a list of supported t-codes and the recording modes to use for them, as well as a list of the supported attachment file types.
If the WFM is not installed on the SAP system, documents can be attached only to Transaction scripts that are recorded in GUI Scripting mode, and only the BDS attachment type is available.
Attach a document
- Click Add File Attachment Rows on the Map tab.
- Choose the method that you want to use. Studio 20.0 supports three ways to attach a document:
- GOS: Store the business document in an archival table, so that main tables are not affected by large attachments.
- DMS: Create an external document (URL). The attachment is stored on an external server.
- BDS: Create an attachment. This attachment option was offered in previous versions of Transaction.
Notes: If the WFM is not installed on the SAP system, only the BDS method is available.
For Create External Document (URL), use WFM “/WINSHTLQ/DOC_GOS_ATTACH_URL“ via Direct in Studio.
- Map the field to the data file.
- Open File Explorer and locate the document that you want to attach.
- Copy the file path and file name.
- In Studio, click the Run tab.
- Paste the file path and name in the Location field.
Important: The upload speed depends on the network and on the SAP system.
Note: You can use Attach current file for a document attachment, when the attachment location is defined inside the If condition for the script. A Runner can also attach the current file as an attachment by defining the <Use Current File> tag in the Attachment Location column of a Data File.
For information regarding adding and removing attached documents when an incorrect document has been attached to a data file, see Manage Supporting Documents.
Note: To request an enhancement to incorporate new t-codes into Winshuttle Function Module, contact Support.
Add other document types
You can customize which document types you can attach.
- Open the ShuttleRule.xml file (in C:\Program Files\Winshuttle\STUDIO or in C:\Program Files (x86)\Winshuttle\STUDIO).
- Enter the MIME type for the document type that you want to add.
For example, to add .mht files, enter the following:
Note: You can check Use Current File for a document attachment, when the attachment location is defined inside the If condition for the script.
The default maximum file size is set at 30 MB.
The tested maximum file size for attachments for web services is 20 MB.
You can change the maximum file size in the Studio Options box.
- Click File, and then click Options.
- Click the SAP Settings tab.
- Under Advanced, in the Document attachment limit (MB) box, type the maximum size for attached documents.
Document attachment scenarios
Sales order and material processes in SAP often include the capability to attach and upload supporting documents along with the data upload. Depending on the transaction, you might want to attach and upload the following types of documents:
- Personnel (PA30): Social Security/national insurance paperwork, proof of residency or citizenship, work permits, passport scans, personnel photos, training certificates
- Sales Order: Faxed orders, PDF files, invoices, POs, purchase requisitions
- Material Master: Drawings
- BOMs: Drawings
- Customer: Credit reference, registration certificates
- Vendor: Credit reference, registration certificates
You can also attach the current document to use for the next script in a chain. For example, you can run an FB50 script to return document numbers and then link it to an FB03 script, with the data file as an attachment so that FB03 can use the document numbers and return the attachment and run logs to that data file.
Note: This is not available for scripts that use the data file type XML Form.
- Record and map the first script.
- Record the second script and map it to the data file that you used for the first script.
- Click Add File Attachment Rows, and click Use Current File.
- Save and close the second script.
- In the first script, click the Run tab, and then click Chain Scripts.
- Add the second script to the chain.
- Run the first script. Studio will automatically run the second script.
Note: The run logs from the second script will not be available in the Excel file that is attached to the SAP document.
Attach supporting documents to be uploaded to SAP
To upload supporting documents to SAP, Solution Developers and Runners can also define a Supporting Document tag in Data file and then run the solution.
- Open a Transaction script.
- Click Add file attachment.
- Select any file attachment mode and click OK.
- Map columns to the Excel data set.
- Add a Supporting File tag for your selected row or rows, in the Attachment location field column.
Note: Use the following tag for the supporting file: <Supporting Doc>.
If you try to upload the same attachment by mentioning it twice in the tag (for example: <A.xlsx,A.xlsx>), only one copy of it will be uploaded to SAP in a single Transaction run.
- Submit the solution and follow the script approval process.
- Open the Data template from the Add-in.
Note: Runners can also define a supporting document tag for a selected row(s) in the Attachment location field column.
- Submit the Data file (this will include the supporting file tag).
- On the Supporting Documents tab, add the supporting documents. Note that these documents can be zipped
- Click Next and submit the Data file.
- Approve the Data Review task.
- Run the task. All supporting documents attached to this Data file will be uploaded to SAP.
Notes: A Runner can also attach the current file as an attachment with the data file by defining a <Use Current File> tag in the Attachment Location column of a Data file.
Both <Use Current File> and <Supporting Doc> tags work with Manual and AutoRun. Each record must contain only one tag, and this tag must either be <Use Current File> or <Supporting Doc>.