cancel
Showing results for 
Search instead for 
Did you mean: 

Send the 1st attachment of AR Invoice as an email attachment using SDK DI API

rajesh_khater
Active Participant
0 Kudos
102

I have the following scenario:

User creates AR Invoice manually and adds multiple attachments in the AR Invoice manually.

In my addon, I have added a button in AR Invoice screen. On button click, the 1st attachment entry of the current AR Invoice should go as an email to the Business Partner.

How can I email only the 1st attached attachment, while skipping the other attachments? Because all the attachments belong to the same AtcEntry.

I do not want to create yet another attachment using the Attachments2 object with the 1st attachment of the AR Invoice for the purpose of the email, because:

1. I need this attachment only for sending the email

2. User may trigger email multiple times on the same AR Invoice, and I do not want to keep creating Attachments2 objects

3. Each time I want to create Attachments2 object, I have to ensure a unique file name.

I am again emphasizing that the attachment is already attached to the AR Invoice, and hence available in the configured Attachments folder, and so I need not save the file again in the Attachments folder. Also note that I want to send the email using the SBO Mailer, which is already configured and I am able to send mails manually.

Requesting SAP support team and other experts to answer with a specific example. ankit.chauhan1

I will really appreciate a useful code example. Is this even possible using the SDK? Are there good workarounds available?

Thanks in advance.

Accepted Solutions (0)

Answers (0)