Application Development and Automation 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:Ā 
Read only

ABAP E Mail Issue

Former Member
0 Likes
1,217

I have written a code to trigger E Mail from SAP using Function Module  SO_NEW_DOCUMENT_SEND_API1. Users used to receive emails properly with the email content in E Mail Body as per the requirement. But now I have observed with the same function module the content of the email is going to users as an attachment with .RAW file. Below is the function module I have used.

       CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

         EXPORTING

          document_data                    = w_data

          document_type                    = 'RAW'

*       PUT_IN_OUTBOX                    = ' '

          commit_work                      = 'X'

*     IMPORTING

*       SENT_TO_ALL                      =

*       NEW_OBJECT_ID                    =

         TABLES

*       OBJECT_HEADER                    =

          object_content                   = it_contnt

*       CONTENTS_HEX                     =

*       OBJECT_PARA                      =

*       OBJECT_PARB                      =

           receivers                        = it_rcvrs

        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

                 .

       IF sy-subrc NE 0.

       ENDIF.



Can anyone please help me findout issue why the content is being sent as an attachment?


-Sunil

4 REPLIES 4
Read only

Former Member
0 Likes
1,062

Hi,

check the settings in transaction SCOT - klick on the node INT (Email) there are settings how the different types gets converted.

set it to "no conversion" and you should be fine.

regards

Stefan Seeburger

Read only

0 Likes
1,062

Hi Stefan,

Thanks for your reply.

Here is the setting in SCOT:

SAPscript/Smart Forms - PDF;

ABAP List - HTM;

Business Object/Link - HTM

RAW Text - TXT

Can you please let me know for which of the above I need to set 'No Conversion'? The mail content which I am sending is extracted into an internal table from a standard text using READ_TEXT and then sent to this function module in the table parameter 'object_content'. So this is not SAP Script, not SMARTFORM, not an ABAP List and not a Business object. I am not sure if it is RAW text.

Can you please help?

-Sunil

Read only

0 Likes
1,062

hi,

no panic

you wrote your doc-type is "RAW" as your example with the FM-Call shows. this leads me to this setting here.

so try to set RAW to no conversion and see what happens. unluckily this is a system wide setting. maybe you can test it on development system.

you can also try to change the fuba-call from type RAW to type HTML. so it should also not getattached by the output of scot.

Also check what attachment type your customers recieve (PDF or Text ?). and why do they recive it as attachment now. Did something change? did you transport something to production machine? something caused this. also maybe the mail-provider attaches the raw text...

regards

Stefan Seeburger

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,062

Why not converting the result of Fm READ_TEXT to a clean html with FM CONVERT_ITF_TO_HTML and then send it as an html with a modern tool like CL_BCS ?

CALL FUNCTION 'CONVERT_ITF_TO_HTML'
   EXPORTING
     i_header      = ls_thead
     i_html_header = ' '
   TABLES
     t_itf_text    = lt_lines
     t_html_text   = lt_html
* ...
       lo_document = cl_document_bcs=>create_document( i_type = 'HTM' i_text = lt_html i_subject = lv_subject ).
       lo_bcs->set_document( lo_document ).

Regards,

Raymond