Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Add File Attachment to Existing CRM Opportunity

Former Member
0 Kudos

Hi folks,

I have a requirement to add excel attachments to opportunities in CRM in batch. Our process is to create an opportunity based on data sent to CRM from R/3, which is working fine. For each opportunity created, we wish to attach an excel file.

I am creating an excel file in directory on the CRM application server. I am the populating the ATTACHMENT_LINK table in the CRMXIF_ORDER_SAVE BAPI with the following details:

move: '/tmp/test1.xls' to wa_attachment-file_name,
             'Opportunity Attach' to wa_attachment-title
             'application/' to wa_attachment-MIME_TYPE,
             'EN' to wa_attachment-language.

I am passing in the GUID of the opportunity and the transaction type into the ORDERADM_H structure, and setting the Object Task as 'Update'. Can anyone see if there is something I'm missing, as the function is finishing in a success status, but once the BAPI Commit is complete, the file does not exist against the opportunity.

Any help would be greatfully appreciate - points awarded for helpful/resolution suggestions.




Former Member
0 Kudos

gave up and used class CL_CRM_DOCUMENTS