Show TOC

Adding and Deleting Attachments using the Task Gateway ServiceLocate this document in the navigation structure

To add an attachment to the Workflow item using the service:

  1. On the SAP Gateway system, go to transaction SPRO and choose SAP Reference IMG.

  2. Navigate to Start of the navigation path SAP NetWeaver  Next navigation step SAP Gateway Next navigation step OData Channel Development with IW_BEP Next navigation step Registration End of the navigation path.

    Note

    If your system is based on SAP NetWeaver 7.40 or higher, you do not need to install the component IW_BEP since the SAP Gateway Foundation component SAP_GWFND is installed as standard. If this applies to your system landscape, navigate to Start of the navigation path SAP NetWeaver Next navigation step SAP Gateway Next navigation step OData Channel Next navigation step Administration Next navigation step General Settings Next navigation step Activate and Maintain Services End of the navigation path.

  3. Open the Activate And Maintain Services activity.

  4. Select the service with the description Task Gateway Service. Two Task Gateway Service versions are available. For more information about the Task Gateway Service versions, see Task Gateway Service.

  5. Choose Call Browser. The service’s base URL is displayed in your browser.

  6. If the SAP GUI Security window is displayed, allow the action to proceed.

  7. To add the multiple origin option, add ;mo to the service name in the URL:

    Sample Code
    TaskCollection(‘SAP__Origin = ‘<system_alias>’, InstanceID=’<workitem id>’)/Attachments
  8. Execute a POST request on the obtained URL with the attachment content as the request body and the following request header parameters:

    • slug – file name without extension

    • Content-Type – MIME type of the attachment

To delete an attachment from the Workflow item using the service:

  1. On the SAP Gateway system, go to transaction SPRO and choose SAP Reference IMG.

  2. Navigate to Start of the navigation path SAP NetWeaver  Next navigation step SAP Gateway Next navigation step OData Channel Development with IW_BEP Next navigation step Registration End of the navigation path.

    Note

    If your system is based on SAP NetWeaver 7.40 or higher, you do not need to install the component IW_BEP since the SAP Gateway Foundation component SAP_GWFND is installed as standard. If this applies to your system landscape, navigate to Start of the navigation path SAP NetWeaver Next navigation step SAP Gateway Next navigation step OData Channel Next navigation step Administration Next navigation step General Settings Next navigation step Activate and Maintain Services End of the navigation path.

  3. Open the Activate And Maintain Services activity.

  4. Select the service with the description Task Gateway Service. Two Task Gateway Service versions are available. For more information about the Task Gateway Service versions, see Task Gateway Service.

  5. Choose Call Browser. The service’s base URL is displayed in your browser.

  6. If the SAP GUI Security window is displayed, allow the action to proceed.

  7. Navigate to the attachment’s content by adding the following to the service’s base URL:

    Sample Code
    AttachmentCollection(SAP__Origin = ‘<system_alias>’, InstanceID='<workitem_id>',id='<Attachment_id>')/$value
  8. Execute a DELETE request on the obtained URL.

Note

If you experience any difficulties in uploading files with extensions such as .docx, .xlsx you might need to adjust the standard mime types that are recognized by your browser. For information about how to solve this issue, see SAP Note 1613138 Information published on SAP site.

If you experience any difficulties retrieving file size information when you create attachments for the SAP Business Workflow provider, see SAP Note 2009857 Information published on SAP site.