<?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 of data type. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-of-data-type/m-p/3718102#M895081</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nagesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think data type might be different in your case, but not the the lengths, i hope. If the lengths are also different, then there ids no point in moving the data in Internal Table to another table, as u lose some of the information i.e the value will be truncated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As well as the MOVE statement, which converts the value of the source field into the data type of the target field, there is also a statement WRITE TO, which converts the contents of the source field into a field with type C. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE &amp;lt;f1&amp;gt; TO &amp;lt;f2&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statement converts the contents of a data object &amp;lt;f1&amp;gt; to type C, and places the string in the variable &amp;lt;f2&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if u have some Quantity fields or Currency fields in ur internal table &amp;amp; if the target field in ur Table is of Char type, then u can use WRITE...TO... command for the conversion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE wa_table-field1 TO v_char1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, u insert v_char1 into ur table. If u need to convert any type of field value to Char type, this would be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u want further information about this, go for F1 Help on WRITE...TO...statement.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dont forget to reward if helpful.....&lt;/P&gt;&lt;P&gt;Pavan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Apr 2008 05:52:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-23T05:52:40Z</dc:date>
    <item>
      <title>Conversion of data type.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-of-data-type/m-p/3718100#M895079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing a code where i am getting a data from data base table into a internal table                ( structure of internal table same as database table ) and then from internal table moving the data into a different table (defined in the program) this defined program has less number of fields. Like internal table has 10 fields where as this defined table has 8 fields. Data type of the fields are not same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so i want to know whether data type creates problem while loading and if yes then how shall i move the data into the defined table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nagesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 05:31:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-of-data-type/m-p/3718100#M895079</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T05:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion of data type.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-of-data-type/m-p/3718101#M895080</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;Data type matters sometime, but length matters the most.&lt;/P&gt;&lt;P&gt;for eg:  if ur inserting any numeric (internal table) field to charcter type (table) it will accept. Its always advised to have same data type. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SOMETIMES IT MIGHT THROW RUNTIME ERROR, DUE TO CONVERSION PROBLEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;REWARD IF USEFUL&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 05:39:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-of-data-type/m-p/3718101#M895080</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T05:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion of data type.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-of-data-type/m-p/3718102#M895081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nagesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think data type might be different in your case, but not the the lengths, i hope. If the lengths are also different, then there ids no point in moving the data in Internal Table to another table, as u lose some of the information i.e the value will be truncated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As well as the MOVE statement, which converts the value of the source field into the data type of the target field, there is also a statement WRITE TO, which converts the contents of the source field into a field with type C. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE &amp;lt;f1&amp;gt; TO &amp;lt;f2&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statement converts the contents of a data object &amp;lt;f1&amp;gt; to type C, and places the string in the variable &amp;lt;f2&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if u have some Quantity fields or Currency fields in ur internal table &amp;amp; if the target field in ur Table is of Char type, then u can use WRITE...TO... command for the conversion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE wa_table-field1 TO v_char1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, u insert v_char1 into ur table. If u need to convert any type of field value to Char type, this would be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u want further information about this, go for F1 Help on WRITE...TO...statement.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dont forget to reward if helpful.....&lt;/P&gt;&lt;P&gt;Pavan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 05:52:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-of-data-type/m-p/3718102#M895081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T05:52:40Z</dc:date>
    </item>
  </channel>
</rss>

