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: 

Use of 'SO_NEW_DOCUMENT_ATT_SEND_API1'

Former Member
0 Kudos
3,930

Hi All,

I am using the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' to send an email of my output to different users with their respective records.It is succesfully sending the mail.In that mail it is displaying the data and along with that it contains an attachment(.txt file) with the same data again.That means the mail contains the data and an attachment with the same content.

I just want to know that, the above FM will work(sending both the content and an attachment with the same content) like that , or we can remove either one of that content (or) attachment with any option in the FM?

Thanks in Advance .....

Regards,

Rakesh.

8 REPLIES 8

premal_mistry2
Active Participant
0 Kudos
1,456

Hi Rakesh,

Make sure when you are calling the fm 'SO_DOCUMENT_SEND_API1', the CONTENTS_BIN parameter in disabled.

Regards,

Premal

Former Member
0 Kudos
1,456

try to Use CL_BCS Class.Using this class you can send the email with attachment.

rakesh.

sreeramkumar_madisetty
Active Contributor
0 Kudos
1,456

Hi

Using this Function module ,there is no rule that mail contains the data and an attachment with the same content.

when calling the function module,check the parameters you are passing.

Regards,

Sreeram

venkat_o
Active Contributor
0 Kudos
1,456

Hi Rakesh,

Comment the Contents_bin parameter in the function module like below

  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      document_data              = w_document_data
      put_in_outbox              = 'X'
      commit_work                = 'X'
    IMPORTING
      sent_to_all                = g_sent_to_all
    TABLES
      packing_list               = i_packing_list
*     contents_bin               = i_attachment "Comment this one. It makes attachment
      contents_txt               = i_body_msg
      receivers                  = i_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.

Thanks

Venkat.O

Former Member
0 Kudos
1,456

Hi All,

I have not used that parameter ( Contents_bin ).Its in disable mode only.see my code below and please tell me how to avoid it.

DESCRIBE TABLE i_body LINES g_att_lines.

READ TABLE i_body INTO lw_body INDEX g_att_lines.

gd_doc_data-doc_size = ( g_att_lines - 1 ) * 255 + STRLEN( lw_body ).

lw_packing_list-transf_bin = space.

lw_packing_list-head_start = 1.

lw_packing_list-head_num = 0.

lw_packing_list-body_start = 1.

lw_packing_list-body_num = g_att_lines.

lw_packing_list-doc_type = 'RAW'.

lw_packing_list-doc_size = 255 * g_att_lines.

APPEND lw_packing_list TO i_packing_list .

CLEAR lw_packing_list.

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = gd_doc_data

put_in_outbox = 'X'

commit_work = 'X'

  • IMPORTING

  • SENT_TO_ALL =

  • NEW_OBJECT_ID =

TABLES

packing_list = i_packing_list

object_header = i_context

contents_txt = i_body

receivers = i_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 .

Regards,

Rakesh.

0 Kudos
1,456

Make sure you are using SO_DOCUMENT_SEND_API1 and not 'SO_NEW_DOCUMENT_ATT_SEND_API1.

Regards,

Permal

Edited by: Premal Mistry on Jul 14, 2009 12:46 PM

Former Member
0 Kudos
1,456

Hi Rakesh,

Use this FM "SO_DOCUMENT_SEND_API1"

Regards

Milan

Former Member
0 Kudos
1,456

Answered