cancel
Showing results for 
Search instead for 
Did you mean: 

How to send email the list report output as attachment in SAP RAP

SachinArtani
Participant
0 Kudos

Hi,

I am wondering a cleaner and better way of sending the list report output as attachment in email in SAP RAP. The problem is that user can filter out the result of list report from the filters in selection screen. So, suppose the BO returns 1000 material records without filter. If I filter with material, I get 20. So, I need a button - 'Send Email' upon clicking which, those 20 records must be sent in attachment of the email.

Below are the approaches I have in my mind, but none of them feel clean to me -

  1. Instance based action: We must select records to send as attachment. No customer would want that.
  2. Static action: We cannot get any filters in importing parameter of the action, so we would need to store filters or the filtered records in a staging table and write code in action to send the filtered records accordingly.
  3. Button adding with UI5: UI5 developer can fetch the filters and make use of them. Even if we add a button in UI5, it will need an OData service to pass the filters to the OData and the OData must be able to handle the importing parameters like passing selected materials as comma separated string and in the static parametric action, write logic to separate materials and process create the final record. Too much trouble for both front-end and back-end developer.

What else can we do? Why there is no way to get filters in a custom action the way we get in custom query provider class through IO_REQUEST?

Accepted Solutions (0)

Answers (1)

Answers (1)

DiegoValdivia
Participant
0 Kudos

Hi @SachinArtani 

There's an option named #CHANGE_SET. When you activate it, you can select multiple lines at a time and process them all together in one single execution. I'm thinking that maybe, in the action method, you can get the information from all lines selected, and add them all together to the e-mail.

Please check following post created by Abishek Sharma:

https://community.sap.com/t5/technology-blogs-by-members/abap-restful-application-programming-model-... 

Regards.

SachinArtani
Participant
0 Kudos

Hi @DiegoValdivia, I think you misunderstood my need. With the first approach I mentioned i.e., Instance based action, I will have to use CHANGE_SET, but I also would have to select records and click on Send Email button.

No customer would want to select n number of records everytime they send a report. So, I am looking for a way to send list report output in email without selecting any row.

rammel_sapdev
Participant
0 Kudos
Hi, have you resolved this issue? The only solution that I can also think of is for the users to select all records and perform the action via CHANGE_SET
SachinArtani
Participant
0 Kudos

Hi @rammel_sapdev, no, I haven't found any better solution.