Uploading attached documents through Web forms

Sales order and material processes in SAP often include the capability to attach and upload supporting documents along with the data upload. To address this, you can upload attached documents through web forms.

On this page

Sample scenarios for attaching and uploading documents

Back to top

Some examples of using attached documents for different transactions are described below:

  • 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

Supported T-Codes for use with attached and uploaded documents

Back to top

T-code

Required metadata

AS02/AS03

Company Code, Main Asset Number, Asset Subnumber

MM02/MM03

Material Number

FB02/FB03

Company Code, Document Number, Fiscal Year

VA02/VA03

 Order Number

ME52N/ME53N

Requisition Number

ME22N/ME23N

 Order Number

XD02/XD03

FD02/FD03

Customer Number

 

 

 

XK02/XK03

MK02/MK03

FK02/FK03

 Vendor Number

PA30

 Personnel Number

Step 1: Create a TRANSACTION script with document attachment upload

Back to top

Document attachment is available only for supported t-codes. Because "create" t-codes are not supported, you may need to use linked scripts to create the record with one script and then attach the document in another script. See the table below for a list of support T-codes.

  1. In Winshuttle Transaction, record your transaction, or open a script that was made from an appropriate transaction. See Transaction Help if you need assistance.
  2. Open the script in the Mapper.
  3. On the Edit tab, click Add File Attachment Rows Attach doc.

    The new row is added below the Log Column row

    file attach row.

  4. For ease of mapping, click Basic. Drag the Preview column that you want to map to the Attachment Location row. Save the Excel preview file.
  5. Open the Excel template in Excel. In the Attachment Location column, add the local path to the document.
  6. Click Run. The document is uploaded to SAP.

Step 2: Create a web form with attached document upload

Back to top

  1. In Designer, click the Tools menu, and then click Manage Field Mappings.
  2. Add your Web service.
  3. Under Input Values, map both DocumentUploadListAttachment_Location and DocumentUploadListFILE_BYTES to FILE_BYTES.
  4. In the Manage Field Mappings dialog box, click Generate Form.
  5. In the form, open properties for the Attachment control.
  6. Change the binding of the DocumentUpload field to FILE_BYTES. Ensure that the binding is changed on all views of the form.
  7. Click the AttachProp tab. Ensure that Allow Upload is selected.
  8. Only one file should be uploaded per t-code. Therefore, on the AttachProp tab, set Maximum to 1. Click OK.
  9. Ensure that both the SAP Web Service button and the ShareVis.Attachment control are displayed on the same form view.

Tips and best practices

Back to top

  • In a forms-based scenario, you can upload multiple documents by adding multiple attachment controls to the form.
  • Each attachment control needs to be bound to a separate script.
  • Scripts run independently each other. The attachment controls are mapped to the fields of the respective scripts.
  • Multiple attachment controls must be added individually.
  • Repeated attachment controls are not supported.

Attachment upload limitations

Back to top

  • Only one document can be uploaded.
  • The file attachment feature cannot be at the Start node. The user has to start the process in order to be able to upload the file and run the web service
  • Max file size limit is 5MB.
  • Supported file types: XLS, XLSX, TXT, DOC, DOCX, PDF, TIFF, TIF, JPEG, JPG, PNG, BMP, GIF
  • Fields related to Attachment control are case sensitive. For example, if you are using an MM02 transaction with an attachment, the material number value ‘qa100' is different from ‘QA100’
  • Posting data and attaching documents are independent transactions. If one operation fails, it will not affect the other.
  • Uploading is not supported for Create Transactions. For this you will need to use two web services: one to create, and another to attach the document.
  • Uploading is not supported for Autopost or Run Later (Server) in a Winshuttle Central environment.