<?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: Conversion error in Unicode system in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620317#M2012555</link>
    <description>&lt;P&gt;Good point &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Why I not realize this.&lt;/P&gt;&lt;P&gt;It was a mature interface (no idea who made it), and in the past as I see this SapScript invoices has lines which fits into 2000 chars. Anyway I changed the interface and the WS. The conversion problem not solved:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2068523-image.png" /&gt;&lt;/P&gt;&lt;P&gt;Attached the new response.&lt;A href="https://answers.sap.com/storage/temp/2068524-sap-soap-response2.txt" data-attachment="2068524"&gt;sap-soap-response2.txt&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Jul 2022 12:15:01 GMT</pubDate>
    <dc:creator>bajusz79</dc:creator>
    <dc:date>2022-07-01T12:15:01Z</dc:date>
    <item>
      <title>Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620298#M2012536</link>
      <description>&lt;P&gt;Dear Experts,&lt;/P&gt;
  &lt;P&gt;I read an Adobe pdf from archive, convert it to string and send with an interface. It was working with SapScripts (as pdf in archive), but stopped working with Adobe pdf forms. &lt;/P&gt;
  &lt;P&gt;The root cause is, that the binary data can't be converted to string. &lt;/P&gt;
  &lt;P&gt;The pdf file contains lot of special characters, which are substituted with: #&lt;/P&gt;
  &lt;P&gt;We have Unicode system.&lt;/P&gt;
  &lt;P&gt;Part from original file (when I manually download from archive):&lt;/P&gt;
  &lt;P&gt;hÞ”Ymo&amp;#27;7&amp;#18;þ+û±ýd’ÃW&lt;/P&gt;
  &lt;P&gt;And how it is looks like after Binary -&amp;gt; String conversion:&lt;/P&gt;
  &lt;P&gt;h#ФYmo←7##+##¤dТ├W&lt;/P&gt;
  &lt;P&gt;I use this fm for the conversion:&lt;/P&gt;
  &lt;P&gt; CALL FUNCTION 'CACS_CONVERT_HEX_TO_STRING'&lt;BR /&gt; EXPORTING&lt;BR /&gt; xstring = l_xstring&lt;BR /&gt; IMPORTING&lt;BR /&gt; cstring = l_string.&lt;/P&gt;
  &lt;P&gt;But I try this, and not working too:&lt;/P&gt;
  &lt;P&gt; lv_encoding = '4102'. (tried with NON-UNICODE, UTF-8, 4110, etc...)&lt;BR /&gt; lv_ignore = abap_true.&lt;/P&gt;
  &lt;P&gt; cl_abap_conv_in_ce=&amp;gt;create(&lt;BR /&gt; EXPORTING&lt;BR /&gt; encoding = lv_encoding&lt;BR /&gt; ignore_cerr = lv_ignore&lt;BR /&gt; "endian = lv_endian&lt;BR /&gt; RECEIVING&lt;BR /&gt; conv = lr_conv ).&lt;BR /&gt;&lt;BR /&gt; LOOP AT lt_bin_tab ASSIGNING &amp;lt;ls_bin&amp;gt;.&lt;BR /&gt; l_xstring = &amp;lt;ls_bin&amp;gt;-line.&lt;BR /&gt; TRY.&lt;BR /&gt; lr_conv-&amp;gt;convert(&lt;BR /&gt; EXPORTING&lt;BR /&gt; input = l_xstring&lt;BR /&gt; IMPORTING&lt;BR /&gt; data = l_string ).&lt;BR /&gt; CATCH cx_sy_conversion_codepage .&lt;BR /&gt; CATCH cx_root.&lt;BR /&gt; ENDTRY.&lt;BR /&gt;&lt;BR /&gt; l_string_pdf = l_string_pdf &amp;amp;&amp;amp; l_string.&lt;BR /&gt; ENDLOOP.&lt;/P&gt;
  &lt;P&gt;If you have any ide what can cause the problem, let me know.&lt;/P&gt;
  &lt;P&gt;Thanks&lt;/P&gt;
  &lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 08:40:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620298#M2012536</guid>
      <dc:creator>bajusz79</dc:creator>
      <dc:date>2022-06-24T08:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620299#M2012537</link>
      <description>&lt;P&gt;I guess the main problem is not in the code you have posted, but the fact that you want a STRING for storing the PDF "file". PDF is made of bytes, not characters. Please provide the rest of the code how you generate the PDF.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 11:18:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620299#M2012537</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-24T11:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620300#M2012538</link>
      <description>&lt;P&gt;I don't generate the pdf, just send it via Webservice. And as I mention it was working with Sapscript.&lt;/P&gt;&lt;P&gt;I read from archive with fm: SCMS_AO_TABLE_GET&lt;/P&gt;&lt;P&gt;And convert the binary data to string (which is not working fine), and send l_string_pdf with the WebService.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 11:53:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620300#M2012538</guid>
      <dc:creator>bajusz79</dc:creator>
      <dc:date>2022-06-24T11:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620301#M2012539</link>
      <description>&lt;P&gt;OK. How do you pass it in the Web service? &lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 13:31:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620301#M2012539</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-24T13:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620302#M2012540</link>
      <description>&lt;P&gt;As an export parameter (table type):&lt;/P&gt;&lt;P&gt;ET_PDF_DATA	TYPE	RSBO_T_CHARLINE&lt;/P&gt;&lt;P&gt;And this is working fine, just the special characters substituted during the conversion. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 13:34:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620302#M2012540</guid>
      <dc:creator>bajusz79</dc:creator>
      <dc:date>2022-06-24T13:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620303#M2012541</link>
      <description>&lt;P&gt;I mean, how is the PDF encoded in the Web service. Base64? Possibly zipped in some way? I can't imagine it's transported via "characters", it's non-sense. Don't forget that in Non-Unicode ABAP systems, it was accepted to pass bytes as characters, because technically one character was stored as one byte (omitting all DBCS stuff), but it was incorrect to use characters instead of bytes, semantically/theoretically speaking.&lt;/P&gt;&lt;P&gt;Go directly from Xstring to base64, it's exactly one ABAP line of code (could even be implicit during XML serialization, if the PDF is transmitted inside XML). No need to encore in UTF-8 or whatever.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 17:17:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620303#M2012541</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-24T17:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620304#M2012542</link>
      <description>&lt;P&gt;Believe or not, it is not encoded. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Just passed the character stream of the file. I tried in SOAPUI, call the service, save the content in notepad, and it and be opened as a pdf. It is a mature application which use this, so not easily possible to change the code itself only in SAP, because other side need to be adjusted too.&lt;/P&gt;&lt;P&gt;Of course if I need to rewrite from scratch I would use base64 encoding with fm: SSFC_BASE64_CODE&lt;/P&gt;&lt;P&gt;As we use in other interfaces. This is the background, but now they expect character stream. &lt;/P&gt;&lt;P&gt;What I find out, that it is working perfectly for simple SapScripts, but not pdf forms. If SapScript contains pictures some characters are substituted too, but the pdf displays, just without pictures.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 06:46:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620304#M2012542</guid>
      <dc:creator>bajusz79</dc:creator>
      <dc:date>2022-06-27T06:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620305#M2012543</link>
      <description>&lt;P&gt;I'm pretty sure it's impossible that it's not encoded, MIME don't support that. Or it's a very simple HTTP request with directly the PDF as body?&lt;/P&gt;&lt;P&gt; I think it's interesting to share how you did it in SOAPUI (share the HTTP request body containing the PDF), and we'll be fixed, and be able to propose a solution.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 08:02:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620305#M2012543</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-27T08:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620306#M2012544</link>
      <description>&lt;P&gt;Hi Sandra,&lt;/P&gt;&lt;P&gt;Thanks your time to check it. Is it possible to send somehow to you the full response?&lt;/P&gt;&lt;P&gt;It is a simple SOAP response with the PDF in the ET_PDF_DATA.&lt;/P&gt;&lt;P&gt;I don't want to post the response here as it is a real invoice from live system.&lt;/P&gt;&lt;P&gt;A part from the working case (an old Sapscript invoice from Archive as pdf):&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2063591-image.png" /&gt;&lt;/P&gt;&lt;P&gt;This is a part from "not working" case from SOAPUI:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2063592-image.png" /&gt;&lt;/P&gt;&lt;P&gt;With a lot of substitution character: #&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 09:59:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620306#M2012544</guid>
      <dc:creator>bajusz79</dc:creator>
      <dc:date>2022-06-27T09:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620307#M2012545</link>
      <description>&lt;P&gt;Thanks, it's sufficient. So, it's encoded inside XML, using Character or Entity References. In your screenshot I see that you are using Character References, starting with 2 characters &amp;amp; and # (possibly 3rd character is X for hexa) followed by byte value and ending with semicolon. I can see hex 12, hex C, decimal 8, decimal 1, hex 1C.&lt;/P&gt;&lt;P&gt;Starting from binary, you could convert to characters but I think you can't consider it as being UTF-8 as it could store 2 bytes as 1 character due to surrogate characters. But it should be fine with iso-8859-1 for instance (code page 1100). After that I guess it would be fine.&lt;/P&gt;&lt;P&gt;PS: it's really just to solve your specific issue, but you should re-think the whole solution, and pass binary as one base64 value, instead of text...&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 14:26:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620307#M2012545</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-27T14:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620308#M2012546</link>
      <description>lv_encoding = '1100'.&lt;BR /&gt;    lv_ignore   = abap_true.&lt;BR /&gt;&lt;BR /&gt;    cl_abap_conv_in_ce=&amp;gt;create(&lt;BR /&gt;    EXPORTING&lt;BR /&gt;    encoding = lv_encoding&lt;BR /&gt;    ignore_cerr = lv_ignore&lt;BR /&gt;    "endian = lv_endian&lt;BR /&gt;    RECEIVING&lt;BR /&gt;    conv = lr_conv ).&lt;BR /&gt;&lt;BR /&gt;    LOOP AT lt_otf_tab ASSIGNING &amp;lt;ls_otf&amp;gt;.&lt;BR /&gt;      l_xstring = &amp;lt;ls_otf&amp;gt;-line.&lt;BR /&gt;      TRY.&lt;BR /&gt;          lr_conv-&amp;gt;convert(&lt;BR /&gt;          EXPORTING&lt;BR /&gt;          input = l_xstring&lt;BR /&gt;          IMPORTING&lt;BR /&gt;          data = l_string ).&lt;BR /&gt;        CATCH cx_sy_conversion_codepage .&lt;BR /&gt;        CATCH cx_root.&lt;BR /&gt;      ENDTRY.&lt;BR /&gt;&lt;BR /&gt;      l_string_pdf = l_string_pdf &amp;amp;&amp;amp; l_string.&lt;BR /&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;I try with this code in the past too, but not success.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2063632-image.png" /&gt;&lt;/P&gt;&lt;P&gt;convert method returns the same substitution characters with codepage 1100. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 08:23:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620308#M2012546</guid>
      <dc:creator>bajusz79</dc:creator>
      <dc:date>2022-06-28T08:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620309#M2012547</link>
      <description>&lt;P&gt;No, it's fine, you can see the first "#" is hex 0D. When it's stored inside XML, these "#" characters will be converted into XML Character References, like sequence of these characters for hex 0D : &amp;amp; # x D ; for hex or &amp;amp; # 13 ; for decimal, which are equivalent.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 08:54:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620309#M2012547</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-28T08:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620310#M2012548</link>
      <description>&lt;P&gt;Thanks the help.&lt;/P&gt;&lt;P&gt;Now it is a bit better, but seems not working fully:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2068479-image.png" /&gt;&lt;/P&gt;&lt;P&gt;On the top you see the WS response, and down the working pdf.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 14:33:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620310#M2012548</guid>
      <dc:creator>bajusz79</dc:creator>
      <dc:date>2022-06-30T14:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620311#M2012549</link>
      <description>&lt;P&gt;I don't see any difference. The sequence &amp;amp; # x 1 B ; means hex 1B which is a "non-printable character". Notepad displays it as a square (like SAP often displays it as a #).&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 15:36:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620311#M2012549</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-30T15:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620312#M2012550</link>
      <description>&lt;P&gt;Okay, I see something else: the character before Ymo.&lt;/P&gt;&lt;P&gt;Possibly it's the software you use which renders it incorrectly, or you don't pass the right "encoding" value in the XML header.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 15:42:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620312#M2012550</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-30T15:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620313#M2012551</link>
      <description>&lt;P&gt;If you can create a small program which reproduces the issue, and provide it along a small PDF and the full generated HTTP request, that would be simpler to tell you what the issue is. Till now I can advise only based on incomplete pieces.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 15:45:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620313#M2012551</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-30T15:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620314#M2012552</link>
      <description>&lt;P&gt;This is an example interface I created now:&lt;/P&gt;&lt;P&gt;FUNCTION zsd_pdf_test2.&lt;BR /&gt;*"--------------------------------------------------------------------&lt;BR /&gt;*"*"Local Interface:&lt;BR /&gt;*" IMPORTING&lt;BR /&gt;*" VALUE(I_VBELN_VF) TYPE VBELN_VF OPTIONAL&lt;BR /&gt;*" VALUE(I_XBLNR) TYPE XBLNR OPTIONAL&lt;BR /&gt;*" VALUE(I_BLDAT) TYPE BLDAT OPTIONAL&lt;BR /&gt;*" VALUE(I_KUNNR) TYPE KUNNR OPTIONAL&lt;BR /&gt;*" EXPORTING&lt;BR /&gt;*" VALUE(E_FILE_MIME_TYPE) TYPE ZFILE_MIME_TYPE&lt;BR /&gt;*" VALUE(E_FILE_MIME_LENGTH) TYPE ZFILE_MIME_LENGHT&lt;BR /&gt;*" VALUE(E_BAPIRET1) TYPE BAPIRET1&lt;BR /&gt;*" VALUE(ET_PDF_DATA) TYPE RSBO_T_CHARLINE&lt;BR /&gt;*"--------------------------------------------------------------------&lt;BR /&gt;*Invoice number is given as Input.&lt;BR /&gt;*FInd the latest attchment of Invoice PDF Stored in easy archive.&lt;BR /&gt;*Download it into memory and convert it in to Binary.&lt;BR /&gt;* Return the RFC call with the Binary data of the file.&lt;BR /&gt;&lt;BR /&gt; DATA:&lt;BR /&gt; l_vbeln TYPE vbeln_vf,&lt;BR /&gt; l_xstring TYPE xstring,&lt;BR /&gt; l_string TYPE string,&lt;BR /&gt; ls_toav0 TYPE toav0,&lt;BR /&gt; lt_connections TYPE TABLE OF toav0,&lt;BR /&gt; l_otf_length TYPE i,&lt;BR /&gt; lt_otf_tab TYPE TABLE OF tbl1024,&lt;BR /&gt; l_string_pdf TYPE string,&lt;BR /&gt; ls_rsbo_t_charline TYPE char2048,&lt;BR /&gt; lt_split TYPE TABLE OF string,&lt;BR /&gt; l_x_length TYPE i.&lt;BR /&gt;&lt;BR /&gt; DATA: BEGIN OF st_tab_x ,&lt;BR /&gt; line(1024) TYPE x,&lt;BR /&gt; END OF st_tab_x.&lt;BR /&gt; DATA lt_tab_x LIKE STANDARD TABLE OF st_tab_x.&lt;BR /&gt; DATA: lv_pdf TYPE fpcontent.&lt;BR /&gt;&lt;BR /&gt; FIELD-SYMBOLS:&lt;BR /&gt; &amp;lt;ls_otf&amp;gt; TYPE tbl1024,&lt;BR /&gt; &amp;lt;fs_string&amp;gt; TYPE string.&lt;BR /&gt;&lt;BR /&gt; CALL FUNCTION 'FPCOMP_CREATE_PDF_FROM_SPOOL'&lt;BR /&gt; EXPORTING&lt;BR /&gt; i_spoolid = '25102'&lt;BR /&gt; i_partnum = 1&lt;BR /&gt; IMPORTING&lt;BR /&gt; e_pdf = lv_pdf&lt;BR /&gt; "e_pdf_file = lv_file&lt;BR /&gt; EXCEPTIONS&lt;BR /&gt; OTHERS = 1.&lt;BR /&gt;&lt;BR /&gt; DATA: lr_conv TYPE REF TO cl_abap_conv_in_ce.&lt;BR /&gt; DATA: lv_encoding TYPE abap_encoding.&lt;BR /&gt;&lt;BR /&gt; lv_encoding = '1100'.&lt;BR /&gt;&lt;BR /&gt; CALL METHOD cl_abap_conv_in_ce=&amp;gt;create&lt;BR /&gt; EXPORTING&lt;BR /&gt; encoding = lv_encoding&lt;BR /&gt; "endian = ' '&lt;BR /&gt; replacement = '#'&lt;BR /&gt; ignore_cerr = abap_true&lt;BR /&gt; "input = bin_messagetext&lt;BR /&gt; RECEIVING&lt;BR /&gt; conv = lr_conv.&lt;BR /&gt;&lt;BR /&gt; lr_conv-&amp;gt;convert(&lt;BR /&gt; EXPORTING&lt;BR /&gt; input = lv_pdf&lt;BR /&gt; IMPORTING&lt;BR /&gt; data = l_string ).&lt;BR /&gt;&lt;BR /&gt; SPLIT l_string AT cl_abap_char_utilities=&amp;gt;cr_lf INTO&lt;BR /&gt; TABLE lt_split.&lt;BR /&gt;&lt;BR /&gt; LOOP AT lt_split ASSIGNING &amp;lt;fs_string&amp;gt;.&lt;BR /&gt; ls_rsbo_t_charline = &amp;lt;fs_string&amp;gt;.&lt;BR /&gt; APPEND ls_rsbo_t_charline TO et_pdf_data.&lt;BR /&gt; IF &amp;lt;fs_string&amp;gt; EQ '%%EOF'.&lt;BR /&gt; EXIT.&lt;BR /&gt; ENDIF.&lt;BR /&gt; ENDLOOP.&lt;BR /&gt;&lt;BR /&gt; e_file_mime_type = ls_toav0-reserve.&lt;BR /&gt; e_file_mime_length = l_otf_length.&lt;BR /&gt; EXIT.&lt;BR /&gt;&lt;BR /&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt;For simpicity I read the pdf from spool, and process it. The result is the same as in PROD.&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.sap.com/storage/temp/2068511-sap-soap-response.txt" data-attachment="2068511"&gt;sap-soap-response.txt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Attached the WS response (SAP_SOAP_RESPONSE.txt) and the working pdf (SAP_WORKING_PDF.txt), please rename it to pdf and it will work.&lt;/P&gt;&lt;P&gt;Thanks to check. &lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 09:49:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620314#M2012552</guid>
      <dc:creator>bajusz79</dc:creator>
      <dc:date>2022-07-01T09:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620315#M2012553</link>
      <description>&lt;P&gt;Thank you. I'm checking...&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 11:31:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620315#M2012553</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-07-01T11:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620316#M2012554</link>
      <description>&lt;P&gt;What I can first see, is that each line of ET_PDF_DATA is limited at 2048 characters, so it will truncate all bytes/1100-encoded characters beyond 2048th -&amp;gt; corrupt PDF.&lt;/P&gt;&lt;P&gt;Why do you limit at 2048, why don't you use lines of any length? (ET_PDF_DATA type string_table for instance)&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 11:36:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620316#M2012554</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-07-01T11:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error in Unicode system</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620317#M2012555</link>
      <description>&lt;P&gt;Good point &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Why I not realize this.&lt;/P&gt;&lt;P&gt;It was a mature interface (no idea who made it), and in the past as I see this SapScript invoices has lines which fits into 2000 chars. Anyway I changed the interface and the WS. The conversion problem not solved:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2068523-image.png" /&gt;&lt;/P&gt;&lt;P&gt;Attached the new response.&lt;A href="https://answers.sap.com/storage/temp/2068524-sap-soap-response2.txt" data-attachment="2068524"&gt;sap-soap-response2.txt&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 12:15:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-error-in-unicode-system/m-p/12620317#M2012555</guid>
      <dc:creator>bajusz79</dc:creator>
      <dc:date>2022-07-01T12:15:01Z</dc:date>
    </item>
  </channel>
</rss>

