Uploading documents
Sales order and material processes in SAP often include the capability to attach and upload supporting documents along with the data upload. You can upload attached documents through web forms.
For the following types of transactions, you might want to attach these 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
Step 1: Create a TRANSACTION script with document attachment upload
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.
Supported t-codes
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
|
- In TRANSACTION, record a transaction or open a script that was made from an appropriate transaction.
- Open the script in the Mapper.
- On the Edit tab, click Add File Attachment Rows
.The new row is added below the Log Column row
.
- 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.
- Open the Excel template in Excel. Under the Attachment Location column, add the local path to the document.
- Click Run. The document is uploaded to SAP.
Step 2: Create a web form with attached document upload
- In Designer, click the Tools menu, and then click Manage Field Mappings.
- Add your .
- Under Input Values, map both DocumentUploadListAttachment_Location and DocumentUploadListFILE_BYTES to FILE_BYTES.
- In the Manage Field Mappings dialog box, click Generate Form.
- In the form, open properties for the ShareVis.Attachment control.
- Change the binding of the DocumentUpload field to FILE_BYTES. Ensure that the binding is changed on all views of the form.
- Click the AttachProp tab. Ensure that Allow Upload is selected.
- Only one file should be uploaded per t-code. Therefore, on the AttachProp tab, set Maximum to 1. Click OK.
- Ensure that both the SAP Web Service button and the ShareVis.Attachment control are displayed on the same form view.