<?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: SBCOMS_SR_FROM_DOCUMENT_CREATE shows exception 'Error Document Insert'  'Save Document DB' in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sbcoms-sr-from-document-create-shows-exception-error-document-insert-save/m-p/636964#M26970</link>
    <description>&lt;P&gt;Hi G Lakshmipathi the same code works in other servers except the client server who has this requirement :'( . &lt;/P&gt;</description>
    <pubDate>Wed, 31 Jan 2018 11:20:35 GMT</pubDate>
    <dc:creator>former_member333321</dc:creator>
    <dc:date>2018-01-31T11:20:35Z</dc:date>
    <item>
      <title>SBCOMS_SR_FROM_DOCUMENT_CREATE shows exception 'Error Document Insert'  'Save Document DB'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sbcoms-sr-from-document-create-shows-exception-error-document-insert-save/m-p/636962#M26968</link>
      <description>&lt;P&gt;Iam trying to send smart form pdf to email as an attachment . The smart form document is converted to pdf by this code.&lt;/P&gt;
  &lt;P&gt;======== Code to call smart form and get Job Output Data =============&lt;/P&gt;
  &lt;P&gt;CALL FUNCTION lv_fm_name """"" Calling Smartform function module&lt;BR /&gt; EXPORTING&lt;BR /&gt; archive_index = toa_dara&lt;BR /&gt; archive_parameters = arc_params&lt;BR /&gt; control_parameters = ls_control_param&lt;BR /&gt; mail_recipient = ls_recipient&lt;BR /&gt; mail_sender = ls_sender&lt;BR /&gt; output_options = ls_composer_param&lt;BR /&gt; user_settings = l_user_settings&lt;BR /&gt; l_ponumber = lv_po&lt;BR /&gt; l_adrnr = l_adrnr&lt;BR /&gt; gs_frgct1 = l_frgct1&lt;BR /&gt; gs_frgct2 = l_frgct1&lt;BR /&gt; IMPORTING&lt;BR /&gt; job_output_info = ls_job_info&lt;BR /&gt; TABLES&lt;BR /&gt; gt_lines = gt_lines&lt;BR /&gt; EXCEPTIONS&lt;BR /&gt; formatting_error = 1&lt;BR /&gt; internal_error = 2&lt;BR /&gt; send_error = 3&lt;BR /&gt; user_canceled = 4&lt;BR /&gt; OTHERS = 5.&lt;/P&gt;
  &lt;P&gt;MOVE ls_job_info-otfdata TO lt_tsfotf.&lt;/P&gt;
  &lt;P&gt;====== Code to Convert the OTF to PDF ======================&lt;/P&gt;
  &lt;P&gt; CALL FUNCTION 'CONVERT_OTF' """""" Converting OFT data to xstring&lt;BR /&gt; EXPORTING&lt;BR /&gt; format = 'PDF'&lt;BR /&gt; * max_linewidth = 132&lt;BR /&gt; IMPORTING&lt;BR /&gt; bin_filesize = lv_pdf_len&lt;BR /&gt; bin_file = lv_xstring " binary file&lt;BR /&gt; TABLES&lt;BR /&gt; otf = lt_tsfotf "lt_tstotf&lt;BR /&gt; lines = lt_lines&lt;BR /&gt; EXCEPTIONS&lt;BR /&gt; err_max_linewidth = 1&lt;BR /&gt; err_format = 2&lt;BR /&gt; err_conv_not_possible = 3&lt;BR /&gt; err_bad_otf = 4&lt;BR /&gt; OTHERS = 5.&lt;/P&gt;
  &lt;P&gt;CALL METHOD cl_bcs_convert=&amp;gt;xstring_to_solix&lt;BR /&gt; EXPORTING&lt;BR /&gt; iv_xstring = lv_xstring&lt;BR /&gt; RECEIVING&lt;BR /&gt; et_solix = lt_pdf_xstring.&lt;BR /&gt; &lt;BR /&gt; APPEND LINES OF lt_pdf_xstring TO lt_pdf_final.&lt;/P&gt;
  &lt;P&gt;======= Code to Append Body Recievers and Attachment ===========&lt;/P&gt;
  &lt;P&gt;CLEAR ls_message.&lt;BR /&gt; ls_message-line = '&amp;lt;!DOCTYPE html&amp;gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;'.&lt;BR /&gt; APPEND ls_message TO lt_message.&lt;BR /&gt; &lt;BR /&gt; CLEAR ls_message.&lt;BR /&gt; ls_message-line = '&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;'.&lt;BR /&gt; APPEND ls_message TO lt_message.&lt;BR /&gt; &lt;BR /&gt; CLEAR ls_message.&lt;BR /&gt; ls_message-line = 'Dear Customer,&amp;lt;br&amp;gt;'.&lt;BR /&gt; APPEND ls_message TO lt_message.&lt;/P&gt;
  &lt;P&gt;CLEAR ls_message.&lt;BR /&gt;ls_message-line = 'Find Attachment,&amp;lt;br&amp;gt;'.&lt;BR /&gt;APPEND ls_message TO lt_message.&lt;/P&gt;
  &lt;P&gt; &lt;BR /&gt; CLEAR ls_message.&lt;BR /&gt; ls_message-line = '&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;'.&lt;BR /&gt; APPEND ls_message TO lt_message.&lt;BR /&gt; &lt;BR /&gt; lv_start = 1.&lt;BR /&gt; &lt;BR /&gt; ls_pack_list-transf_bin = 'X'.&lt;BR /&gt; ls_pack_list-head_start = 1.&lt;BR /&gt; ls_pack_list-head_num = 1.&lt;BR /&gt; ls_pack_list-body_start = lv_start.&lt;BR /&gt; &lt;BR /&gt; DESCRIBE TABLE lt_pdf_xstring LINES ls_pack_list-body_num.&lt;BR /&gt; ls_pack_list-doc_type = 'PDF'.&lt;BR /&gt; &lt;BR /&gt; CONCATENATE 'Invoice' 'Test' INTO ls_pack_list-obj_descr SEPARATED BY '_'.&lt;BR /&gt; ls_pack_list-obj_name = 'Test'.&lt;BR /&gt; ls_pack_list-doc_size = ls_pack_list-body_num * 255.&lt;BR /&gt; lv_start = lv_start + ls_pack_list-body_num.&lt;BR /&gt; &lt;BR /&gt; APPEND ls_pack_list TO lt_pack_list.&lt;BR /&gt; CLEAR ls_pack_list.&lt;BR /&gt; &lt;BR /&gt; MOVE sy-langu TO ls_doc_data-obj_langu.&lt;BR /&gt; MOVE 'Test' TO ls_doc_data-obj_descr.&lt;BR /&gt; &lt;BR /&gt; DESCRIBE TABLE lt_message LINES ls_pack_list-body_num.&lt;BR /&gt; CLEAR lv_length.&lt;BR /&gt; MOVE ls_pack_list-body_num TO lv_length.&lt;BR /&gt; MOVE 'HTM' TO ls_pack_list-doc_type.&lt;BR /&gt; MOVE space TO ls_pack_list-transf_bin.&lt;BR /&gt; MOVE '1' TO ls_pack_list-head_start.&lt;BR /&gt; MOVE '0' TO ls_pack_list-head_num.&lt;BR /&gt; MOVE '1' TO ls_pack_list-body_start.&lt;BR /&gt; &lt;BR /&gt; INSERT ls_pack_list INTO lt_pack_list INDEX 1.&lt;BR /&gt; CLEAR ls_pack_list.&lt;BR /&gt; &lt;BR /&gt; MOVE 'test@ex.com' TO ls_receivers-receiver. "*Email ID&lt;BR /&gt; MOVE 'U' TO ls_receivers-rec_type.&lt;BR /&gt; ls_receivers-com_type = 'INT'.&lt;BR /&gt; ls_receivers-notif_del = 'X'.&lt;BR /&gt; ls_receivers-notif_ndel = 'X'.&lt;BR /&gt; APPEND ls_receivers TO lt_receivers.&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'&lt;BR /&gt; EXPORTING&lt;BR /&gt; document_data = ls_doc_data&lt;BR /&gt; put_in_outbox = c_x&lt;BR /&gt; commit_work = c_x&lt;BR /&gt; TABLES&lt;BR /&gt; packing_list = lt_pack_list&lt;BR /&gt; contents_txt = lt_message&lt;BR /&gt; receivers = lt_receivers&lt;BR /&gt; * contents_bin = lt_pdf_xstring&lt;BR /&gt; contents_hex = lt_pdf_final&lt;BR /&gt; EXCEPTIONS&lt;BR /&gt; too_many_receivers = 1&lt;BR /&gt; document_not_sent = 2&lt;BR /&gt; document_type_not_exist = 3&lt;BR /&gt; operation_no_authorization = 4&lt;BR /&gt; parameter_error = 5&lt;BR /&gt; x_error = 6&lt;BR /&gt; enqueue_error = 7&lt;BR /&gt; OTHERS = 8.&lt;/P&gt;
  &lt;P&gt;Function Module raises sy-subrc 6 and in debugging i found exception is raised in SBCOMS_SR_FROM_DOCUMENT_CREATE . Exception is shown in image attached in this question.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/109445-api1-error.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 08:00:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sbcoms-sr-from-document-create-shows-exception-error-document-insert-save/m-p/636962#M26968</guid>
      <dc:creator>former_member333321</dc:creator>
      <dc:date>2018-01-31T08:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: SBCOMS_SR_FROM_DOCUMENT_CREATE shows exception 'Error Document Insert'  'Save Document DB'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sbcoms-sr-from-document-create-shows-exception-error-document-insert-save/m-p/636963#M26969</link>
      <description>&lt;P&gt;Probably you need to implement the code corrections as recommended in OSS note 1430123&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 09:15:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sbcoms-sr-from-document-create-shows-exception-error-document-insert-save/m-p/636963#M26969</guid>
      <dc:creator>Lakshmipathi</dc:creator>
      <dc:date>2018-01-31T09:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: SBCOMS_SR_FROM_DOCUMENT_CREATE shows exception 'Error Document Insert'  'Save Document DB'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sbcoms-sr-from-document-create-shows-exception-error-document-insert-save/m-p/636964#M26970</link>
      <description>&lt;P&gt;Hi G Lakshmipathi the same code works in other servers except the client server who has this requirement :'( . &lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 11:20:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sbcoms-sr-from-document-create-shows-exception-error-document-insert-save/m-p/636964#M26970</guid>
      <dc:creator>former_member333321</dc:creator>
      <dc:date>2018-01-31T11:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: SBCOMS_SR_FROM_DOCUMENT_CREATE shows exception 'Error Document Insert'  'Save Document DB'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sbcoms-sr-from-document-create-shows-exception-error-document-insert-save/m-p/636965#M26971</link>
      <description>&lt;P&gt;Solved the issue! In debugging i found content server was not running.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jun 2018 13:26:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sbcoms-sr-from-document-create-shows-exception-error-document-insert-save/m-p/636965#M26971</guid>
      <dc:creator>former_member333321</dc:creator>
      <dc:date>2018-06-09T13:26:38Z</dc:date>
    </item>
  </channel>
</rss>

