<?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: Need Help ABAP to JSON Boolean &amp; null Conversion using /UI2/CL_JSON in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/13708134#M2028129</link>
    <description>&lt;P&gt;Thanks for this post, came from google too! Using type&amp;nbsp;&lt;SPAN&gt;XSDBOOLEAN solved my issue too (all other abap types were ignored and left it as string), and 'X' or '' turned correctly into true or false&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 21 May 2024 16:06:18 GMT</pubDate>
    <dc:creator>MihalyDucz</dc:creator>
    <dc:date>2024-05-21T16:06:18Z</dc:date>
    <item>
      <title>Need Help ABAP to JSON Boolean &amp; null Conversion using /UI2/CL_JSON</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219533#M1983480</link>
      <description>&lt;P&gt;How do i convert a boolean &amp;amp; null value from abap to json using /UI2/CL_JSON class.&lt;/P&gt;
  &lt;P&gt;DUMMY_TYPE is a method available in the class but unable to use it.&lt;/P&gt;
  &lt;P&gt;Please help with this conversion.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 11:04:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219533#M1983480</guid>
      <dc:creator>former_member353120</dc:creator>
      <dc:date>2020-07-30T11:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help ABAP to JSON Boolean &amp; null Conversion using /UI2/CL_JSON</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219534#M1983481</link>
      <description>&lt;P&gt;Maybe  &lt;SPAN class="mention-scrubbed"&gt;alexey.arseniev&lt;/SPAN&gt;  can help you on this question.&lt;/P&gt;&lt;P&gt;For a boolean, I guess it should be automatic if the ABAP component has the data element FLAG or type ABAP_BOOL. But for NULL, I don't know (because null doesn't exist in ABAP).&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 14:21:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219534#M1983481</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-07-30T14:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help ABAP to JSON Boolean &amp; null Conversion using /UI2/CL_JSON</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219535#M1983482</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;/ui2/cl_json supports native conversion into JSON boolean or null reference. &lt;/P&gt;&lt;P&gt;To get value serialized into boolean, use on ABAP side ABAP_BOOL type.&lt;/P&gt;&lt;P&gt;For null reference, use initial REF TO ... &lt;/P&gt;&lt;P&gt;There is no DUMMY_TYPE, but DUMP_TYPE. The method is protected, because is not intended to be called directly, but only by extending classes. &lt;/P&gt;&lt;P&gt;For more information please see the blog &lt;A href="https://wiki.scn.sap.com/wiki/display/Snippets/One+more+ABAP+to+JSON+Serializer+and+Deserializer"&gt;https://wiki.scn.sap.com/wiki/display/Snippets/One+more+ABAP+to+JSON+Serializer+and+Deserializer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and ask question directly there.&lt;/P&gt;&lt;P&gt;BR, Alexey-&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 13:38:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219535#M1983482</guid>
      <dc:creator>alexey_arseniev</dc:creator>
      <dc:date>2020-08-04T13:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help ABAP to JSON Boolean &amp; null Conversion using /UI2/CL_JSON</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219536#M1983483</link>
      <description>&lt;P&gt;There is no ABAP_BOOL type in the data dictionary so you can't use it in DD stuctures.&lt;/P&gt;&lt;P&gt;It's unfortunate the developers of /ui2/cl_json did not know about ABAP_BOOL which defines false as ' ' and undefined as '-'. The implementation of /ui2/cl_json does exactly the opposite and serializes '' to null and '-' to false.&lt;/P&gt;&lt;P&gt;Anyone have a DD-compatible solution?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 08:11:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219536#M1983483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2021-02-10T08:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help ABAP to JSON Boolean &amp; null Conversion using /UI2/CL_JSON</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219537#M1983484</link>
      <description>&lt;P&gt;Do we have any solution to have Boolean values transformed using DD-compatible solution.&lt;BR /&gt;The Json that I have is a very large structure and have atleast 8 sublevels with multiple arrays and objects so having to create the same one locally is a pain and could cause issues with the key names.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 06:27:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219537#M1983484</guid>
      <dc:creator>former_member750684</dc:creator>
      <dc:date>2021-06-10T06:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help ABAP to JSON Boolean &amp; null Conversion using /UI2/CL_JSON</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219538#M1983485</link>
      <description>&lt;P&gt;Use the Data Element as BOOLEAN and override the Key name with the name_mappings parameter and both these should work fine&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 22:01:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219538#M1983485</guid>
      <dc:creator>former_member750684</dc:creator>
      <dc:date>2021-06-10T22:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help ABAP to JSON Boolean &amp; null Conversion using /UI2/CL_JSON</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219539#M1983486</link>
      <description>&lt;P&gt;It is old question, but I needed the answer now. I copied /ui2/cl_json to zcl_json and in &lt;/P&gt;&lt;P&gt;Loc. Definitions/Implementations&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2096757-image.png" /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;elseif mc_bool_3state cs &amp;amp;2-&amp;gt;absolute_name and data is initial.&lt;BR /&gt;"to&lt;BR /&gt;elseif mc_bool_3state cs &amp;amp;2-&amp;gt;absolute_name and &amp;amp;1 = `-`.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Be aware that data type used for boolean need to be either "BOOLEAN" not abap_bool&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  class-data MC_BOOL_TYPES type STRING read-only value `\TYPE-POOL=ABAP\TYPE=ABAP_BOOL\TYPE=BOOLEAN\TYPE=BOOLE_D\TYPE=XFELD` ##NO_TEXT.&lt;BR /&gt;  class-data MC_BOOL_3STATE type STRING read-only value `\TYPE=BOOLEAN` ##NO_TEXT.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Sep 2022 14:11:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219539#M1983486</guid>
      <dc:creator>vladimir_culic</dc:creator>
      <dc:date>2022-09-15T14:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help ABAP to JSON Boolean &amp; null Conversion using /UI2/CL_JSON</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219540#M1983487</link>
      <description>&lt;P&gt;DD- Type &lt;EM&gt;BOOLE_D&lt;/EM&gt; works for me. Take a look at attibut &lt;EM&gt;MC_BOOL_TYPES of &lt;/EM&gt;&lt;EM&gt;/UI2/CL_JSON&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 14:58:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219540#M1983487</guid>
      <dc:creator>frank_vonderbrelje</dc:creator>
      <dc:date>2022-12-15T14:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help ABAP to JSON Boolean &amp; null Conversion using /UI2/CL_JSON</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219541#M1983488</link>
      <description>&lt;P&gt;Since I myself was brought to this post by Google because I faced the same problem: the class /ui2/cl_json does actually have the solution. Maybe it was changed, but the class differentiates between boolean (X for true and blank for false) and triboolean (x for true, - for false, and blank for undefined) types. A data type from the DDIC it recognizes correctly is e.g. XSDBOOLEAN, meaning if you give the serialize method a structure containing a component with data type xsdboolean and fill it with abap_true or abap_false it will correctly map to true or false in the JSON string.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 15:27:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/12219541#M1983488</guid>
      <dc:creator>thettenhausen_miele</dc:creator>
      <dc:date>2023-09-07T15:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help ABAP to JSON Boolean &amp; null Conversion using /UI2/CL_JSON</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/13708134#M2028129</link>
      <description>&lt;P&gt;Thanks for this post, came from google too! Using type&amp;nbsp;&lt;SPAN&gt;XSDBOOLEAN solved my issue too (all other abap types were ignored and left it as string), and 'X' or '' turned correctly into true or false&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 16:06:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-abap-to-json-boolean-null-conversion-using-ui2-cl-json/m-p/13708134#M2028129</guid>
      <dc:creator>MihalyDucz</dc:creator>
      <dc:date>2024-05-21T16:06:18Z</dc:date>
    </item>
  </channel>
</rss>

