cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to send attachments to ERP from CPQ?

sbslmhmt
Participant
947

Hello,

Does anyone knows how to send attachments to ERP from CPQ?

Please kindly respond.

Best regards.

Accepted Solutions (0)

Answers (2)

Answers (2)

sabelok
Discoverer

Hi,

This can be achieved via a custom development.

1. Create ABAP web service in SAP ERP that will accept attachment input.

2. Create a custom iFlow in CPI that will receive data from CPQ and pass the attachment data to the ERP Web service.

3. In SAP CPQ, create a global script or custom action to read the quote attachment data and pass data to CPI

Quote.GetAttachedDocumentList()

Regards

Sergey_L
Participant

Mehmet,

We do not do this automatically, but we DO generate links to these attachments, which call a script via API and return the content. We use them in reports/notifications/proposals but they could get passed to ERP. Based on your process of transferring data CPQ→ERP, you may be able to utilize these concepts to pull the actual attachment file.

  1. First, note that files can be attached to the cart and to an attribute (there is an "attachment" type of attribute).
  2. The database tables containing these files are: CartAttachments and AttributeFileAttachment.
  3. You could write scripts (to be used in URLs) to refers to the above tables where the file id is the input and the file content is the output.Let's call them CartAttachments and AttributeFileAttachment.
  4. You then need to create a CPQ account purely for this purpose. Let's give it the username: reportbuilder.
  5. You can then build these URLs to call those scripts like so:
    http://XXX/customapi/executescript?scriptname=CartAttachments&username=YYY&password=ZZZ&domain=AAA&PPP={docID:'III'}
    where:
    XXX = YourCpqPlatformURL
    YYY = reportbuilder
    ZZZ = password of user "reportbuiler"
    AAA = your domain
    PPP = "param" (without the quotes). I couldn't write this in the text above because for some reason combining "&" and "param" in this window replaces it with "¶m".
    III = the ID of your attachment file.


NOTES:
• The username and password in step 5 may present a security concern. Be very careful how you define that user's permissions.
• The URLs can be created using RDLC code in predefined reports, or in Document Generation templates, or in a script that populates a Quote Table, for example. Perhaps in your case, you would simply pass a string of Cart and Attribute Attachment IDs to ERP, and it will then use these API calls to pull the Files. ¯\_(ツ)_/¯

Good luck!
I hope you'll be willing to share what solution you came up with.