<?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>Question Re: range error invalid string length at json.stringify in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256439#M4590201</link>
    <description>&lt;P&gt;Can you show what value your result variable contains.&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jul 2020 18:09:39 GMT</pubDate>
    <dc:creator>pfefferf</dc:creator>
    <dc:date>2020-07-18T18:09:39Z</dc:date>
    <item>
      <title>range error invalid string length at json.stringify</title>
      <link>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaq-p/12256438</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
  &lt;P&gt;I am facing issue at this line in my xsjs file &lt;/P&gt;
  &lt;P&gt;$.response.setBody(JSON.stringify(result));&lt;/P&gt;
  &lt;P&gt;ERROR MSG:&lt;STRONG&gt;range error invalid string length at json.stringify&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jul 2020 15:59:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaq-p/12256438</guid>
      <dc:creator>former_member665201</dc:creator>
      <dc:date>2020-07-18T15:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: range error invalid string length at json.stringify</title>
      <link>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256439#M4590201</link>
      <description>&lt;P&gt;Can you show what value your result variable contains.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jul 2020 18:09:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256439#M4590201</guid>
      <dc:creator>pfefferf</dc:creator>
      <dc:date>2020-07-18T18:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: range error invalid string length at json.stringify</title>
      <link>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256440#M4590202</link>
      <description>&lt;P&gt;Its a array of object . . Multiple rows will be return from the data base  query. . I am juz trying to pass it to front end . . &lt;/P&gt;</description>
      <pubDate>Sat, 18 Jul 2020 20:23:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256440#M4590202</guid>
      <dc:creator>former_member665201</dc:creator>
      <dc:date>2020-07-18T20:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: range error invalid string length at json.stringify</title>
      <link>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256441#M4590203</link>
      <description>&lt;P&gt;Again, please show the content/structure of the result variable.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jul 2020 05:19:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256441#M4590203</guid>
      <dc:creator>pfefferf</dc:creator>
      <dc:date>2020-07-19T05:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: range error invalid string length at json.stringify</title>
      <link>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256442#M4590204</link>
      <description>&lt;P&gt;Hi Florian,&lt;BR /&gt;&lt;BR /&gt;Same error for me also.&lt;BR /&gt;Attached screenshot.&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Yaswanth&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://answers.sap.com/storage/temp/1862714-invalid-string-length.png"&gt;invalid-string-length.png&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 06:23:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256442#M4590204</guid>
      <dc:creator>former_member667818</dc:creator>
      <dc:date>2020-11-13T06:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: range error invalid string length at json.stringify</title>
      <link>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256443#M4590205</link>
      <description>&lt;P&gt;This happens only when we have huge data in the array.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 06:46:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256443#M4590205</guid>
      <dc:creator>former_member667818</dc:creator>
      <dc:date>2020-11-13T06:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: range error invalid string length at json.stringify</title>
      <link>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256444#M4590206</link>
      <description>&lt;P&gt;Seems that your node process runs out of memory during serialization of the "huge array" data. You can try to do the serialization in chunks or increase the memory for the node process.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 07:41:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256444#M4590206</guid>
      <dc:creator>pfefferf</dc:creator>
      <dc:date>2020-11-13T07:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: range error invalid string length at json.stringify</title>
      <link>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256445#M4590207</link>
      <description>&lt;P&gt;How can it could be done ?&lt;BR /&gt;can you please elaborate a little bit &lt;BR /&gt;Any reference code will be helpful &lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 04:41:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256445#M4590207</guid>
      <dc:creator>former_member667818</dc:creator>
      <dc:date>2020-11-17T04:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: range error invalid string length at json.stringify</title>
      <link>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256446#M4590208</link>
      <description>&lt;P&gt;As mentioned in the comments above, the error ususally appears because runnining into a memory issue.&lt;/P&gt;&lt;P&gt;You can try&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;to process the serialization of your large array in chunks (e.g. if you have 1000 entries in your array, to a stepwise serialization per 100 entries for instance and concatenate the result).&lt;/LI&gt;&lt;LI&gt;increase the memory of your node process aka application (assuming you are using an XSA node module). You can do that via the deployment descriptor or manually (for test reasons) via the SAP HANA XSA Cockpit or the XS CLI (check the scaling options for memory &lt;A href="https://help.sap.com/viewer/6b94445c94ae495c83a19646e7c3fd56/2.0.04/en-US/e5853506bab145dab7ec672b52a74145.html" target="_blank"&gt;here&lt;/A&gt;)&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 17 Nov 2020 05:41:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/range-error-invalid-string-length-at-json-stringify/qaa-p/12256446#M4590208</guid>
      <dc:creator>pfefferf</dc:creator>
      <dc:date>2020-11-17T05:41:09Z</dc:date>
    </item>
  </channel>
</rss>

