cancel
Showing results for 
Search instead for 
Did you mean: 

Steps for Sending Attachment through Service Layer API

SachinBG
Explorer
0 Kudos
202

Hi

We are looking at steps involved to send the attachment from an external application through Service layer,

The business case is as below

The Sales Quotation API is pushed from a SFA tool where the SQ in SAP B1 is created and the attachment captured in the SFA tool has to be pushed to the Attachment folder and map the same to the SQ Created.

Note that the Environment is on SAP B1 CCC and the attachment folders are in windows machine

We tried the b1/v1/Attachment2 but we are not getting clear logic steps involved to send the attachment from external app to our attachment folder and then map that to the SQ

if any one can help out on the steps it would be of great help

 

View Entire Topic
ManishPant
Participant
0 Kudos

Hi @SachinBG ,

First create the sales document.

Now upload the attachments in Attachment2.

Upon successful upload, you will receive the Absolute Entry.

ManishPant_0-1731389947732.png

Update the sales document with the Absolute Entry.

ManishPant_1-1731389957475.png

The sales document is updated in SAP B1 with attachments.

ManishPant_0-1731390329305.png

 

This is I have done through Postman, you can do with your program also.

Thanks.

Manish

 

SachinBG
Explorer
0 Kudos
Hi Manish , Thanks, but my only doubt is how to send the attachment from the external SFA tool which is hosted on a different cloud to the attachment folder, as the Attachment2 will not upload the attachment to the folder
ManishPant
Participant
0 Kudos
Hi Sachin, I’m not familiar with the SFA tool or how you've integrated the Service Layer API within it. However, once you post the SQ via the API, you will need to upload the generated attachment to the SAP Business One attachment folder. This can be done using SFTP/FTP upload through a script or via a RESTful API. After the file is successfully transferred, you can then use the Attachments2 API to upload the file path and details.
SachinBG
Explorer
0 Kudos
Manish, So that means the attachment attached in the tool has to be sent through a different mode as you mentioned. So the /Attachment2 is only to create a Attachment entry for the attached file? is there any SAP B1 API only to send the attachment in encrypted manner
ManishPant
Participant
0 Kudos
Hi Sachin, Yes, the Attachments2 API will only create the entry in SAP. Currently, there doesn’t seem to be an API in the HANA Service Layer for uploading files directly to the SAP Business One attachment folder. You'll need to develop a separate script to handle the file upload to the attachment folder, and then pass the file path to the Attachments2 API.