<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SO_NEW_DOCUMENT_SEND_API1 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/1056938#M90633</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;please see the next post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Enzo Porcasi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Nov 2005 15:28:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-11-09T15:28:33Z</dc:date>
    <item>
      <title>SO_NEW_DOCUMENT_SEND_API1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/1056938#M90633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;please see the next post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Enzo Porcasi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2005 15:28:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/1056938#M90633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-09T15:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: SO_NEW_DOCUMENT_SEND_API1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/1056939#M90634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have put a body text in a emil sent by the FM SO_NEW_DOCUMENT_SEND_API1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There isn't any problem for putting the text.&lt;/P&gt;&lt;P&gt;But now I need to put some information like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Sales Document Salse Customer
1              A
2              B
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and so on with a table format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the body text that is in the email is.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Sales Document Salse Customer
1 A
2 B
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the table passing to the function module the text has the correst format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;enzo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Enzo Porcasi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2005 15:31:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/1056939#M90634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-09T15:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: SO_NEW_DOCUMENT_SEND_API1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/1056940#M90635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would suggest using HTML in your body text.  You can use a table in HTML to do the formatting for you.  Here is a sample program using HTML.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0002.

data: maildata   like sodocchgi1.
data: mailtxt    like solisti1 occurs 10 with header line.
data: mailrec    like somlrec90 occurs 0  with header line.

start-of-selection.

  clear:    maildata, mailtxt,  mailrec.
  refresh:  mailtxt, mailrec.

  perform build_text_message.
  perform build_receivers.
  perform send_mail_nodialog..

************************************************************************
*      Form  BUILD_TEXT_MESSAGE
************************************************************************
form build_text_message.


  maildata-obj_name = 'TEST'.
  maildata-obj_descr = 'Test Subject'.


  mailtxt  = '&amp;lt;html&amp;gt;'.
  append mailtxt.
  mailtxt  = '&amp;lt;head&amp;gt;'.
  append mailtxt.
  mailtxt  = '&amp;lt;title&amp;gt;Untitled Document&amp;lt;/title&amp;gt;'.
  append mailtxt.
  mailtxt  = '&amp;lt;meta http-equiv="Content-Type" content="text/html;'.
  append mailtxt.
  mailtxt  = 'charset=iso-8859-1"&amp;gt;'.
  append mailtxt.
  mailtxt  = '&amp;lt;/head&amp;gt;'.
  append mailtxt.
  mailtxt  = '&amp;lt;body&amp;gt;'.
  append mailtxt.
  mailtxt  = '&amp;lt;div align="center"&amp;gt;&amp;lt;em&amp;gt;&amp;lt;font' .
  append mailtxt.
  mailtxt  = 'color="#0000FF" size="+7" face="Arial,'.
  append mailtxt.
  mailtxt  = 'Helvetica, sans-serif"&amp;gt;THIS'.
  append mailtxt.
  mailtxt  = '  IS A TEST &amp;lt;/font&amp;gt;&amp;lt;/em&amp;gt;&amp;lt;font' .
  append mailtxt.
  mailtxt  = 'color="#0000FF" size="+7" face="Arial,'.
  append mailtxt.
  mailtxt  = 'Helvetica, sans-serif"&amp;gt;&amp;lt;/font&amp;gt;'.
  append mailtxt.
  mailtxt  = '&amp;lt;/div&amp;gt;'.
  append mailtxt.
  mailtxt  = '&amp;lt;/body&amp;gt;'.
  append mailtxt.
  mailtxt  = '&amp;lt;/html&amp;gt;'.
  append mailtxt.

endform.

************************************************************************
*      Form  BUILD_RECEIVERS
************************************************************************
form build_receivers.

  mailrec-receiver = you@yourcompany.com'.
  mailrec-rec_type  = 'U'.
  append mailrec.

endform.

************************************************************************
*      Form  SEND_MAIL_NODIALOG
************************************************************************
form send_mail_nodialog.

  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
       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 &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.

endform.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2005 15:33:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/1056940#M90635</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-11-09T15:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: SO_NEW_DOCUMENT_SEND_API1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/1056941#M90636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This opens up all kinds of possibilities for you.  You can make your email look like a webpage, with logos and pictures, cool fonts.  For you purposes, I'm sure that all you really want is the &amp;lt;table&amp;gt; tag.  If you don't know HTML, you can develop the table in products such as Dreamweaver or that other MS product  &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2005 15:35:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/1056941#M90636</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-11-09T15:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: SO_NEW_DOCUMENT_SEND_API1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/1056942#M90637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Enzo,&lt;/P&gt;&lt;P&gt;What is the declaration for those fields Sales Document and sales Customer??&lt;/P&gt;&lt;P&gt;When you have the data in the required format in the internal table, you can pass that data line by line as it is into an internal table of type string or character string and then pass that data to  the FM SO_NEW_DOCUMENT_SEND_API1.&lt;/P&gt;&lt;P&gt;Try this and see if it helps you.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2005 15:35:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/1056942#M90637</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-09T15:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: SO_NEW_DOCUMENT_SEND_API1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/1056943#M90638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another fun little option for generating HTML emails is use a BSP application.  You can call the BSP page using the internal ABAP HTTP client.  You can then use the rendered HTML as your email (you might just have to adjust some of the internal src references): &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 call method cl_http_ext_webapp=&amp;gt;create_url_for_bsp_application
    exporting
      bsp_application      = 'zes_asap_detail'
      bsp_start_page       = 'detail.htm'
      bsp_start_parameters = params
    importing
      local_url            = bsp_loc_url
      abs_url              = bsp_abs_url.

  data: e_data type xstring.
  call function 'SWF_WSC_LAUNCH_SYNC_REQUEST'
    exporting
      i_url                         = bsp_abs_url
   importing
*   E_HTTP_STATUS_CODE            =
*   E_HTTP_STATUS_REASON          =
     e_data                        = e_data
   exceptions
     no_proxy_found                = 1
     client_creation_failure       = 2
     http_error                    = 3
     others                        = 4.
  if sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.
...
clear path1.
  concatenate `src="`
              apath-url
              `/sap/public/bsp/`
              into path1.
  replace all occurences of `src="/sap/public/bsp/`
     in cdocument
   with path1.

  clear path1.
  concatenate `href="`
              apath-url
              `/sap/public/bsp/`
              into path1.
  replace all occurences of `href="https://answers.sap.com/sap/public/bsp/`
    in cdocument
  with path1.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2005 15:52:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/1056943#M90638</guid>
      <dc:creator>thomas_jung</dc:creator>
      <dc:date>2005-11-09T15:52:14Z</dc:date>
    </item>
  </channel>
</rss>

