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

Unicode-Problem with SO_NEW_DOCUMENT_ATT_SEND_API1?

Former Member
0 Likes
1,336

Hi,

i use the FM <b>SO_NEW_DOCUMENT_ATT_SEND_API</b>1 to send a mail with an attachements. For this, I put the data for ahe Attachmend to the Export-Parameter <b>contents_bin</b> of this FM.

In a 6.20 system without enabled Unicode - everything work fine.

In a 7.00 system with enabled Unicode - there is always a blank character after every character

Does anybody know this problems an can give me a usefull hint?

Regards,

Stefan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,137

Try using the new CL_BCS object for sending emails - this is unicode compliant.

There are several examples in the ABAP forums for this.

Andrew

8 REPLIES 8
Read only

Former Member
0 Likes
1,137

In the program, start-of-selection event.. please use

SET LOCALE LANGUAGE 'EN'. or if its Japanese then 'JA' etc

Read only

0 Likes
1,137

thanks, but after this I get a dump "TEXTENV_KEY_TOO_LONG"

Read only

Former Member
0 Likes
1,137

Please refer following threads:

http://www.s001.org/ABAP-Hlp/abapset_locale.htm

The parameter value is exceeding the defined limit

Read only

Former Member
0 Likes
1,138

Try using the new CL_BCS object for sending emails - this is unicode compliant.

There are several examples in the ABAP forums for this.

Andrew

Read only

0 Likes
1,137

Hi,

thank you. Do you have an example report to send a mail with an excel attachment by using the CL_BCS.

Regards,

Stefan

Read only

0 Likes
1,137

Take a look at my response to

There is a test program there for sending email with document text.

Adding attachments can be done by including the following code. I believe the input tables are the same or similar format to those used with the existing FM.



   data: ATT_BIN_TYPE TYPE  SOODK-OBJTP. 
   data: ATT_BIN TYPE  SOLIX_TAB.
   data: ATT_BIN_DESC TYPE  SOOD-OBJDES.
   data: ATT_TEXT_TYPE TYPE  SOODK-OBJTP.
   data: ATT_TEXT TYPE  SOLI_TAB.
   data: ATT_TEXT_DESC TYPE  SOOD-OBJDES.

   * Add Text Attachment if present
       IF zatt_text[] IS SUPPLIED.
         TRY.
             CALL METHOD document->add_attachment
               EXPORTING
                 i_attachment_type     = att_text_type
                 i_attachment_subject = att_text_desc
                 i_att_content_text   = att_text.
           CATCH cx_document_bcs .
             "    'Error creating text attachment'.
             RAISE send_error.
         ENDTRY.
       ENDIF.
   
   * Add BIN Attachment if present
       IF zatt_bin[] IS SUPPLIED.
         TRY.
             CALL METHOD document->add_attachment
               EXPORTING
                 i_attachment_type     = att_bin_type
                 i_attachment_subject = att_bin_desc
                 i_att_content_hex    = att_bin.
           CATCH cx_document_bcs .
      "    'Error creating BIN attachment'.
             RAISE send_error.
         ENDTRY.
       ENDIF.
   
   * Add document & attachment(s) to email object
       TRY.
           CALL METHOD l_obj->set_document
             EXPORTING
               i_document = document.
         CATCH cx_send_req_bcs.
      "     'Error linking document to email'.
         RAISE send_error.
     ENDTRY.

Hope this helps

Andrew

Read only

0 Likes
1,137

Hi Andrew,

<b>CL_BCS</b> works great!

Thank you very much for your help!

Regards,

Stefan

Read only

former_member194669
Active Contributor
0 Likes
1,137

Hi,

Please check whether your program is unicode enabled? if not use UCCHECK and make it unicode enabled.

The fm SO_NEW_DOCUMENT_ATT_SEND_API1 will work with Unicode.

a®