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.
cancel
Showing results for 
Search instead for 
Did you mean: 

Email ALV Grid output

0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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

0 Kudos

SO_NEW_DOCUMENT_ATT_SEND_API1 seems to be a good option, will try this one.

former_member688911
Discoverer
0 Kudos

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