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: 

How to get the print preview of email

Former Member
0 Kudos

Hi Experts.

I have crated one report program which will send an email to the person whose id is mentioned. Now Before sending the email the sender wants to see the preview of email.

I am using the below FM to send Email.

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

     
EXPORTING

        DOCUMENT_DATA             
= lwa_mail_header

        DOCUMENT_TYPE             
= 'HTM'

        PUT_IN_OUTBOX             
= 'X'

        COMMIT_WORK               
= 'X'

     
TABLES

        OBJECT_CONTENT            
= lt_mail_content

        RECEIVERS                 
= lt_mail_receivers

     
EXCEPTIONS

        TOO_MANY_RECEIVERS        
= 1

        DOCUMENT_NOT_SENT         
= 2

        DOCUMENT_TYPE_NOT_EXIST   
= 3

        OPERATION_NO_AUTHORIZATION
= 4

        PARAMETER_ERROR           
= 5

        X_ERROR                   
= 6

        ENQUEUE_ERROR             
= 7

       
OTHERS                     = 8.


Is there any way to see the preview of email before sending email?

Thanks,

Pradeep.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

As your mail body is an html, you could create a small preview with class cl_gui_html_viewer

(Many threads and SAP demo program like SAPHTML_EVENTS_DEMO, etc.)

NB: Also this is an old FM, did you try class CL_BCS to manage your mails...

Regards,

Raymond

4 REPLIES 4

Former Member
0 Kudos

Dear

if you see print preview before sending mail

follow this link  :

Regards

Former Member
0 Kudos

I know these are not what you are looking for, but here are some other options:

  • You could send it to their SAP Inbox.  They could see it conveniently there.
  • You could send it to their external email.  They could conveniently see it there.

Then you could popup a window with a link to the appropriate place with a Continue Yes or No buttons.

Neal

raymond_giuseppi
Active Contributor
0 Kudos

As your mail body is an html, you could create a small preview with class cl_gui_html_viewer

(Many threads and SAP demo program like SAPHTML_EVENTS_DEMO, etc.)

NB: Also this is an old FM, did you try class CL_BCS to manage your mails...

Regards,

Raymond

0 Kudos

That could be a real cool choice to implement...