<?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 Re: send fax in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-fax/m-p/1849537#M360029</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Iam not finding entry in scot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jan 2007 13:24:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-16T13:24:45Z</dc:date>
    <item>
      <title>send fax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-fax/m-p/1849534#M360026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have written the following code to send a fax.&lt;/P&gt;&lt;P&gt;But finally SUBRC is setting to 0 and raising an exception.&lt;/P&gt;&lt;P&gt;Are there any basis settings required for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;*for the htmlb event handling&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;evt type ref to if_htmlb_data,&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*mail elements&lt;/P&gt;&lt;P&gt; bodyTable type table of char255,      "body&lt;/P&gt;&lt;P&gt; receiver type somlreci1,              "reciver&lt;/P&gt;&lt;P&gt; receivers type TABLE OF somlreci1,    "table containing the reciver&lt;/P&gt;&lt;P&gt; senderAddr TYPE sender,               "sender&lt;/P&gt;&lt;P&gt; document_data type SODOCCHGI1,        "header informations&lt;/P&gt;&lt;P&gt; packing_list type table of SOPCKLSTI1,"document content description&lt;/P&gt;&lt;P&gt; sent_to_all type boolean,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*help variables&lt;/P&gt;&lt;P&gt; len type int4,&lt;/P&gt;&lt;P&gt; base type int4,&lt;/P&gt;&lt;P&gt; line type char255,&lt;/P&gt;&lt;P&gt; BODY TYPE STRING,&lt;/P&gt;&lt;P&gt; statust(255).&lt;/P&gt;&lt;P&gt; body = 'This is a test fax'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; first we need to split the string into an internal table&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; with line length of 255&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    len = strlen( body ) / 256.&lt;/P&gt;&lt;P&gt;    if len gt 0.&lt;/P&gt;&lt;P&gt;    do  len times.&lt;/P&gt;&lt;P&gt;      base = ( sy-index - 1 ) * 256.&lt;/P&gt;&lt;P&gt;      if sy-index = len.&lt;/P&gt;&lt;P&gt;        line = body+base.&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;        line = body+base(256).&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      APPEND line to bodyTable.&lt;/P&gt;&lt;P&gt;    enddo.&lt;/P&gt;&lt;P&gt;    ELSE. "one line length.&lt;/P&gt;&lt;P&gt;     append body to bodyTable.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The text is now in the table bodytable.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   if typeSelector eq 'INT'.               "MAIL RECIPIENT&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     receiver-receiver = recipient.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     receiver-rec_type = 'U'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     APPEND receiver to receivers.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     move sender to senderAddr.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   if typeSelector eq 'FAX'.               "FAX RECIPIENT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      field-symbols &amp;lt;receiver&amp;gt; type c.&lt;/P&gt;&lt;P&gt;      data recipient_fax type sadrfd.&lt;/P&gt;&lt;P&gt;      recipient_fax-rec_fax    = '02066425476'.&lt;/P&gt;&lt;P&gt;      recipient_fax-rec_state  = '91'.&lt;/P&gt;&lt;P&gt;      TRANSLATE recipient_fax-rec_state to UPPER CASE.&lt;/P&gt;&lt;P&gt;      recipient_fax-send_cover = 'X'.&lt;/P&gt;&lt;P&gt;      assign recipient_fax to &amp;lt;receiver&amp;gt; casting.&lt;/P&gt;&lt;P&gt;      receiver-receiver = &amp;lt;receiver&amp;gt;.&lt;/P&gt;&lt;P&gt;      receiver-rec_type = 'F'.&lt;/P&gt;&lt;P&gt;      APPEND receiver to receivers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*In case of fax the sender also needs to be adjusted.(country code)&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     field-symbols &amp;lt;sender&amp;gt; type c.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     data sender_fax type sadrfd.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     sender_fax-rec_fax = sender+2.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     sender_fax-rec_state = sender+0(2).&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     TRANSLATE sender_fax-rec_state to UPPER CASE.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     assign sender_fax to &amp;lt;sender&amp;gt; casting.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     senderAddr = &amp;lt;sender&amp;gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill the document data /subject/&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    document_data-obj_descr = 'Order Acknowledgement'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill packing list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    data: p_item type SOPCKLSTI1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    describe table bodyTable lines len.  " the length of the document&lt;/P&gt;&lt;P&gt;    p_item-doc_type = 'RAW'.        " text document&lt;/P&gt;&lt;P&gt;    p_item-transf_bin = ' '.        " non binary&lt;/P&gt;&lt;P&gt;    p_item-obj_descr = 'Order Acknowledgement'."subject.&lt;/P&gt;&lt;P&gt;    p_item-body_start = 1.          " first (and only) object&lt;/P&gt;&lt;P&gt;    p_item-body_num = len.          " set the length.&lt;/P&gt;&lt;P&gt;    APPEND p_item to packing_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**send the document&lt;/P&gt;&lt;P&gt;     call function 'SO_DOCUMENT_SEND_API1'&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        document_data              = document_data&lt;/P&gt;&lt;P&gt;        put_in_outbox              = ' '&lt;/P&gt;&lt;P&gt;        commit_work                = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       sender_address             = senderAddr&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        sender_address_type        = 'FAX' "typeSelector&lt;/P&gt;&lt;P&gt;      importing&lt;/P&gt;&lt;P&gt;        sent_to_all                = sent_to_all&lt;/P&gt;&lt;P&gt;      tables&lt;/P&gt;&lt;P&gt;        packing_list               = packing_list&lt;/P&gt;&lt;P&gt;        contents_txt               = bodyTable&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      contents_hex               = contents_hex&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        receivers                  = receivers&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;        too_many_receivers         = 1&lt;/P&gt;&lt;P&gt;        document_not_sent          = 2&lt;/P&gt;&lt;P&gt;        document_type_not_exist    = 3&lt;/P&gt;&lt;P&gt;        operation_no_authorization = 4&lt;/P&gt;&lt;P&gt;        parameter_error            = 5&lt;/P&gt;&lt;P&gt;        x_error                    = 6&lt;/P&gt;&lt;P&gt;        enqueue_error              = 7&lt;/P&gt;&lt;P&gt;     others                     = 8.&lt;/P&gt;&lt;P&gt;    case sy-subrc.  "Error handling&lt;/P&gt;&lt;P&gt;      when '0'.&lt;/P&gt;&lt;P&gt;        statusT = 'Document is sent.'.&lt;/P&gt;&lt;P&gt;      when others.&lt;/P&gt;&lt;P&gt;        statusT = 'Error during the operation'.&lt;/P&gt;&lt;P&gt;    endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    write: / statust.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 13:08:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-fax/m-p/1849534#M360026</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T13:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: send fax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-fax/m-p/1849535#M360027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the SY-SUBRC is 0, which is exception raised?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway the fm SO_DOCUMENT_SEND_API1 send your message to the SAPConnet (trx SCOT), so the message is really send only from here: you have to check how the SCOT is setted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 13:12:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-fax/m-p/1849535#M360027</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T13:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: send fax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-fax/m-p/1849536#M360028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry. here the subrc is setting to 2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 13:13:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-fax/m-p/1849536#M360028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T13:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: send fax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-fax/m-p/1849537#M360029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Iam not finding entry in scot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 13:24:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-fax/m-p/1849537#M360029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T13:24:45Z</dc:date>
    </item>
  </channel>
</rss>

