05-17-2011 1:50 PM
Hi,
I have a report with a ALV Grid output which is developed using class CL_GUI_ALV_GRID. I know that there is a functionality for emailing the alv grid output ( SEND ), but i would like to know if there is a way to define a custom function to email the ALV grid output as a XL or PDF directly from the screen. The reason i want to have the custom function for email is to add a email message (mail contents ) with some more details in addition to the attachment. I did come across ideas like creating a spool and converting it to PDF, but is there any other solution which can be used to email the alv grid with a custom email message and without creating spool.
Thanks
Subha
05-17-2011 2:49 PM
Hi,
I have a report with a ALV Grid output which is developed using class CL_GUI_ALV_GRID. I know that there is a functionality for emailing the alv grid output ( SEND ), but i would like to know if there is a way to define a custom function to email the ALV grid output as a XL or PDF directly from the screen. The reason i want to have the custom function for email is to add a email message (mail contents ) with some more details in addition to the attachment. I did come across ideas like creating a spool and converting it to PDF, but is there any other solution which can be used to email the alv grid with a custom email message and without creating spool.
Thanks
Subha
Hi Subha,
There are ways of doing this. You can create a button in application tool bar and on user command you can call function module
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = document_data
put_in_outbox =
importing
sent_to_all =
new_object_id =
TABLES
contents_txt = contents_txt
contents_hex =
object_para =
object_parb =
receivers = t_receivers
EXCEPTIONS
This sends mail of the content as an attachment.
Having said that It is not clear for me why you want to go for this custom development when SEND functionality gives you option to add contents in addition to sending your attachment.
Regards
Ram
05-17-2011 2:49 PM
Hi,
I have a report with a ALV Grid output which is developed using class CL_GUI_ALV_GRID. I know that there is a functionality for emailing the alv grid output ( SEND ), but i would like to know if there is a way to define a custom function to email the ALV grid output as a XL or PDF directly from the screen. The reason i want to have the custom function for email is to add a email message (mail contents ) with some more details in addition to the attachment. I did come across ideas like creating a spool and converting it to PDF, but is there any other solution which can be used to email the alv grid with a custom email message and without creating spool.
Thanks
Subha
Hi Subha,
There are ways of doing this. You can create a button in application tool bar and on user command you can call function module
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = document_data
put_in_outbox =
importing
sent_to_all =
new_object_id =
TABLES
contents_txt = contents_txt
contents_hex =
object_para =
object_parb =
receivers = t_receivers
EXCEPTIONS
This sends mail of the content as an attachment.
Having said that It is not clear for me why you want to go for this custom development when SEND functionality gives you option to add contents in addition to sending your attachment.
Regards
Ram
05-25-2011 10:37 PM
SO_NEW_DOCUMENT_ATT_SEND_API1 seems to be a good option, will try this one.
05-26-2011 5:56 AM
the best way to reach the solution is using SEND button, that will automatically trigger the mail, hence no need to reinvent the wheel.
still you can go ahead with spool creation.
<points begging removed by moderator>
Edited by: Thomas Zloch on May 26, 2011 3:46 PM