<?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: ABAP code to check for dynamic data object convertibility to avoid short dump in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787122#M2024149</link>
    <description>&lt;P&gt;Unfortunately this is wrong.&lt;/P&gt;&lt;P&gt;If I supply say 'ABC' in a string and ask if it can be compared to a NUMC, then it would not bind to the failure returning variable.&lt;/P&gt;&lt;P&gt;Which in turn could cause a CONVT_NO_NUMBER runtime exception if this string was part of a string range as low and one would like to check if 'ABC' is in ( sign = 'I' option = 'EQ' low = '123' ).&lt;/P&gt;</description>
    <pubDate>Fri, 17 Nov 2023 14:48:23 GMT</pubDate>
    <dc:creator>szebenyib</dc:creator>
    <dc:date>2023-11-17T14:48:23Z</dc:date>
    <item>
      <title>ABAP code to check for dynamic data object convertibility to avoid short dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787117#M2024144</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;
  &lt;P&gt;I am working on a tool for developers.&lt;/P&gt;
  &lt;P&gt;I have a CONV #( ... ) to convert dynamic data object at runtime (type unknown at compile time), which may be not convertible -&amp;gt; it fails with a short dump (e.g. OBJECTS_TABLES_NOT_COMPATIBLE for internal table).&lt;/P&gt;
  &lt;P&gt;It's normal.&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenconversion_rules.htm"&gt;ABAP Keyword Documentation - Assignment and Conversion Rules&lt;/A&gt;&lt;/P&gt;
  &lt;OL&gt; 
   &lt;LI&gt;If the data objects are neither compatible nor convertible, no assignment can take place. If the syntax check recognizes this state, a syntax error is raised, otherwise an exception is raised when the program is executed.&lt;/LI&gt; 
  &lt;/OL&gt;
  &lt;P&gt;Now I want to make my own ABAP code to check the "convertibility" to raise a catchable exception (with good validation message), in order to avoid the short dump.&lt;/P&gt;
  &lt;P&gt;Usually I do the code myself but I'm lazy today.&lt;/P&gt;
  &lt;P&gt;Does anyone have a code to do that? Or something close to it? Or any standard code?&lt;/P&gt;
  &lt;P&gt;NB: I will do a quick temporary solution with RFC 'NONE' and SYSTEM_FAILURE to handle the short dump, but I'm interested by your input. &lt;STRONG&gt;EDIT December 2023&lt;/STRONG&gt;: still interested because the RFC solution works only with data objects which can be serialized + I guess that the performance is "low" due to RFC + producing short dumps in the system for just doing a check really "kills" me.&lt;/P&gt;
  &lt;P&gt;Thanks!&lt;/P&gt;
  &lt;P&gt;Sandra&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 12:22:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787117#M2024144</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-08-28T12:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to check for dynamic data object convertibility to avoid short dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787118#M2024145</link>
      <description>&lt;P&gt;I use the RFC route.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 12:55:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787118#M2024145</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2023-08-28T12:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to check for dynamic data object convertibility to avoid short dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787119#M2024146</link>
      <description>&lt;P&gt;A nice check whether two data fields can be compared can be found in CL_ABAP_UNIT_ASSERT=&amp;gt;ASSERT_EQUALS.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2204599-image.png" /&gt;&lt;/P&gt;&lt;P&gt;Best regards, Holm&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 13:50:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787119#M2024146</guid>
      <dc:creator>holm</dc:creator>
      <dc:date>2023-08-28T13:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to check for dynamic data object convertibility to avoid short dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787120#M2024147</link>
      <description>&lt;P&gt;Cool, this is already there in older systems!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 14:26:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787120#M2024147</guid>
      <dc:creator>abo</dc:creator>
      <dc:date>2023-08-28T14:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to check for dynamic data object convertibility to avoid short dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787121#M2024148</link>
      <description>&lt;P&gt;Exactly what I need, thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 15:28:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787121#M2024148</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-08-28T15:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to check for dynamic data object convertibility to avoid short dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787122#M2024149</link>
      <description>&lt;P&gt;Unfortunately this is wrong.&lt;/P&gt;&lt;P&gt;If I supply say 'ABC' in a string and ask if it can be compared to a NUMC, then it would not bind to the failure returning variable.&lt;/P&gt;&lt;P&gt;Which in turn could cause a CONVT_NO_NUMBER runtime exception if this string was part of a string range as low and one would like to check if 'ABC' is in ( sign = 'I' option = 'EQ' low = '123' ).&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 14:48:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787122#M2024149</guid>
      <dc:creator>szebenyib</dc:creator>
      <dc:date>2023-11-17T14:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to check for dynamic data object convertibility to avoid short dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787123#M2024150</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;szebenyi_balint&lt;/SPAN&gt; Thanks for the feedback. Could you share your code please, so that I can check on my system, please?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 15:58:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787123#M2024150</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-17T15:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to check for dynamic data object convertibility to avoid short dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787124#M2024151</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;szebenyi_balint&lt;/SPAN&gt; I confirm that the method &lt;STRONG&gt;analysis_Svc=&amp;gt;fail_If_Not_Comparable&lt;/STRONG&gt; doesn't work as I expect, not limited to what you say, it needs to be adapted (I don't know how much). I will create and publish a code to test whether two data objects are convertible.&lt;/P&gt;&lt;P&gt;Probably it's because the method &lt;STRONG&gt;analysis_Svc=&amp;gt;fail_If_Not_Comparable&lt;/STRONG&gt; deals with the &lt;A href="https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenlogexp_rules.htm"&gt;comparison rules&lt;/A&gt;, which are different from the &lt;A href="https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenconversion_rules.htm"&gt;conversion rules&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 18:27:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787124#M2024151</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-17T18:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to check for dynamic data object convertibility to avoid short dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787125#M2024152</link>
      <description>&lt;P&gt;As &lt;SPAN class="mention-scrubbed"&gt;szebenyi_balint&lt;/SPAN&gt; said, the code in CL_ABAP_UNIT_ASSERT=&amp;gt;ASSERT_EQUALS checks if variables can be compared, but doesn't check for assignment (convertibility).&lt;/P&gt;&lt;P&gt;I have started the below code to check convertibility. Pull requests are welcome to fix bugs and add missing features.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/sandraros/abap-convertible"&gt;sandraros/abap-convertible: To check whether a data object is convertible to another (github.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2023 13:36:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787125#M2024152</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-12-26T13:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP code to check for dynamic data object convertibility to avoid short dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787126#M2024153</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;szebenyi_balint&lt;/SPAN&gt; I added an answer with link to GitHub code which performs a few convertibility checks.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2023 13:38:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-to-check-for-dynamic-data-object-convertibility-to-avoid-short/m-p/12787126#M2024153</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-12-26T13:38:18Z</dc:date>
    </item>
  </channel>
</rss>

