Skip to Content
author's profile photo Former Member
Former Member

Pls help me

I am using FM 'SO_NEW_DOCUMENT_SEND_API1' to send mail to outlook from sap. It is working fine.

my issue is Extra text '&SO_FORMAT=ASC' is added in the main body. I don no where it is coming from! Any one pls help me to remove this extra text

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 04:27 AM

    Hi

    I can not find any solution in Above thread.

    Following is my code

    data: maildata type sodocchgi1.
    data: mailtxt type table of solisti1 with header line.
    
    DATA : BEGIN OF MAILREC1 OCCURS 0,
    EMAIL1(30),
    EMAIL2(30),
    EMAIL3(30),
    EMAIL4(30),
    EMAIL5(30),
    EMAIL6(30),
    EMAIL7(30),
    EMAIL8(30),
    EMAIL9(30),
    EMAIL10(30),
    end OF MAILREC1.
    
    data: mailrec type table of somlrec90 with header line.
    clear: maildata, mailtxt, mailrec.
    refresh: mailtxt, mailrec.
    *maildata-obj_name = 'TEST'.
    maildata-obj_descr = 'DDL Reloaded for Approvel Number'.
    CONCATENATE maildata-obj_descr p_appno INTO maildata-obj_descr.
    maildata-obj_langu = sy-langu.
    
    mailtxt-line = 'Please Note above request has been Completed'.
    append mailtxt.
    
    select email1 email2 email3 email4 email5
           email6 email7 email8 email9  email10
     from z1ychclientid into table mailrec1
          where werks = p_werks.
    if mailrec1[] is not initial.
    loop at mailrec1.
    mailrec-rec_type = 'U'.
    mailrec-receiver =  mailrec1-email1.
    append mailrec.
    mailrec-receiver =  mailrec1-email2.
    append mailrec.
    mailrec-receiver =  mailrec1-email3.
    append mailrec.
    mailrec-receiver =  mailrec1-email4.
    append mailrec.
    mailrec-receiver =  mailrec1-email5.
    append mailrec.
    mailrec-receiver =  mailrec1-email6.
    append mailrec.
    mailrec-receiver =  mailrec1-email7.
    append mailrec.
    mailrec-receiver =  mailrec1-email8.
    append mailrec.
    mailrec-receiver =  mailrec1-email9.
    append mailrec.
    mailrec-receiver =  mailrec1-email10.
    append mailrec.
    endloop.
    endif.
    
    call function 'SO_NEW_DOCUMENT_SEND_API1'
    exporting
    document_data = maildata
    *document_type = 'RAW'
    put_in_outbox = 'X'
    tables
    object_header = mailtxt
    object_content = mailtxt
    receivers = mailrec
    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.
    COMMIT WORK.
    if sy-subrc = 0.
    *write : 'mail sent'.
    endif.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      HI kumar,'

      have you seen clearly this....

      I found the solution to the problem with the added text "&SO_FORMAT=ASC" etc. In the examples found elsewhere in this forum, the same table structure was passed to both object header and contents, like this:

      CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

      EXPORTING

      document_data = maildata

      document_type = 'HTM'

      put_in_outbox = 'X'

      TABLES

      object_header = mailtxt

      object_content = mailtxt

      receivers = mailrec

      To remove tha trailing text, assign a different table to "object_header" instead, in my case I just left it empty (unassigned):

      CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

      EXPORTING

      document_data = maildata

      document_type = 'HTM'

      put_in_outbox = 'X'

      TABLES

      object_header = mailhdr

      object_content = mailtxt

      receivers = mailrec

      happy solving.

      thanks

      karthik.

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 04:18 AM

    HI Kumar,

    welcome to sdn,

    see this threads your prob may solve...................

    sonewdocumentsendapi1

    Downloading file from WorkFlow(Its interesting check this out) - 29k

    thanks

    karthik

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.