<?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: Checking variables are fitting to data element in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-variables-are-fitting-to-data-element/m-p/11133814#M1905585</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can put below piece of code in your logic.&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var1 = var2.&lt;/P&gt;&lt;P&gt;CATCH cx_sy_conversion_error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Conversion not possible&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jul 2015 12:00:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-07-23T12:00:51Z</dc:date>
    <item>
      <title>Checking variables are fitting to data element</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-variables-are-fitting-to-data-element/m-p/11133813#M1905584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on a migration tool where I'm reading data from a file and converting these variables in a correct format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a function module who can check a variable and an other variable from a DDIC data type and can just check if the conversion is possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For exemple: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case1&lt;/P&gt;&lt;P&gt;-----------&lt;/P&gt;&lt;P&gt;Var1 = 'ABCDEFGH'&lt;/P&gt;&lt;P&gt;Var2 TYPE C(4)&lt;/P&gt;&lt;P&gt;=&amp;gt; This should give an error that it's not possible&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Case2&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;-----------&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Var1 = 'ABCDEFGH'&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Var2 TYPE String&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;=&amp;gt; OK&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Case3&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;-----------&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Var1 = 'ABCDEFGH'&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Var2 TYPE I&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;=&amp;gt; This should give an error that it's not possible&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Kind regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 11:48:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-variables-are-fitting-to-data-element/m-p/11133813#M1905584</guid>
      <dc:creator>TimVDB92</dc:creator>
      <dc:date>2015-07-23T11:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Checking variables are fitting to data element</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-variables-are-fitting-to-data-element/m-p/11133814#M1905585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can put below piece of code in your logic.&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var1 = var2.&lt;/P&gt;&lt;P&gt;CATCH cx_sy_conversion_error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Conversion not possible&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 12:00:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-variables-are-fitting-to-data-element/m-p/11133814#M1905585</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-07-23T12:00:51Z</dc:date>
    </item>
  </channel>
</rss>

