<?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: Field symbols - casting error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbols-casting-error/m-p/1430138#M205736</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;Have u tried to use MOVE statament instead of CONCATENATE?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;assign component sy-index of structure &amp;lt;w_wa&amp;gt; to &amp;lt;w_field&amp;gt;.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE FIELD &amp;lt;W_FIELD&amp;gt; LENGTH V_LEN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE &amp;lt;W_FIELD&amp;gt; TO w_temp+V_OFFSET(V_LEN).&lt;/P&gt;&lt;P&gt;V_OFFSERT = V_OFFSET + V_LEN. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Jul 2006 15:13:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-14T15:13:18Z</dc:date>
    <item>
      <title>Field symbols - casting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbols-casting-error/m-p/1430137#M205735</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 created a table dynamically and assigned it to field symbol. Now i want to write the contents of the internal table to a flat file in app server. Here is what i am doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_table(30) type c default 'PA0008',&lt;/P&gt;&lt;P&gt;            p_file LIKE RLGRAP-FILENAME default '/usr/sap/tmp/test.txt'.         " Path to save files to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;w_table&amp;gt; type standard table,&lt;/P&gt;&lt;P&gt;               &amp;lt;w_wa&amp;gt;   TYPE any,&lt;/P&gt;&lt;P&gt;               &amp;lt;w_field&amp;gt; type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: w_dyn_wa type ref to data,&lt;/P&gt;&lt;P&gt;      w_dyn_table type ref to data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE DATA w_dyn_wa TYPE (p_table). "Suitable work area&lt;/P&gt;&lt;P&gt;ASSIGN w_dyn_wa-&amp;gt;* TO &amp;lt;w_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create data w_dyn_table type standard table of (p_table).&lt;/P&gt;&lt;P&gt;assign w_dyn_table-&amp;gt;* to &amp;lt;w_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data w_dyn_data(5000) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM (p_table) INTO table &amp;lt;w_table&amp;gt; where endda &amp;gt;= sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: w_temp type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET p_file FOR OUTPUT IN TEXT MODE encoding default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at &amp;lt;w_table&amp;gt; into &amp;lt;w_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;  w_temp = ''.&lt;/P&gt;&lt;P&gt;    do.&lt;/P&gt;&lt;P&gt;      assign component sy-index of structure &amp;lt;w_wa&amp;gt; to &amp;lt;w_field&amp;gt;.&lt;/P&gt;&lt;P&gt;      if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      concatenate w_temp &amp;lt;w_field&amp;gt; into w_temp respecting blanks.&lt;/P&gt;&lt;P&gt;      if sy-index = 1.&lt;/P&gt;&lt;P&gt;        transfer '' to p_file.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     transfer &amp;lt;w_field&amp;gt; to p_file no end of line.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    enddo.&lt;/P&gt;&lt;P&gt;   transfer w_temp to p_file no end of line.&lt;/P&gt;&lt;P&gt;   write:/ w_temp.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;close dataset p_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i run the program with PA0008 i am getting a casting error "Object not char like". How do i get rid of this error?. I tried moving the contents of field symbol to a string and appending it. It worked, but i lost the exact formatting of data in the file. In other words, it got rid of extra blanks. I need exact structure of internal table in the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2006 15:01:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbols-casting-error/m-p/1430137#M205735</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-14T15:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Field symbols - casting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbols-casting-error/m-p/1430138#M205736</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;Have u tried to use MOVE statament instead of CONCATENATE?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;assign component sy-index of structure &amp;lt;w_wa&amp;gt; to &amp;lt;w_field&amp;gt;.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE FIELD &amp;lt;W_FIELD&amp;gt; LENGTH V_LEN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE &amp;lt;W_FIELD&amp;gt; TO w_temp+V_OFFSET(V_LEN).&lt;/P&gt;&lt;P&gt;V_OFFSERT = V_OFFSET + V_LEN. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2006 15:13:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbols-casting-error/m-p/1430138#M205736</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-14T15:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Field symbols - casting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbols-casting-error/m-p/1430139#M205737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It threw the same error "Objects not char like" at&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      DESCRIBE FIELD &amp;lt;W_FIELD&amp;gt; LENGTH V_LEN in byte mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried both byte mode and char mode.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2006 15:46:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbols-casting-error/m-p/1430139#M205737</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-14T15:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Field symbols - casting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbols-casting-error/m-p/1430140#M205738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think your concatenate statement dumping when the program reaches the first non char like field in PA0008.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use DESCRIBE field &amp;lt;W_FIELD&amp;gt; type v_type, if it's not char like, move the field into a char field and concatenate or try to concatenate in byte mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2006 16:24:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbols-casting-error/m-p/1430140#M205738</guid>
      <dc:creator>sridhar_k1</dc:creator>
      <dc:date>2006-07-14T16:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Field symbols - casting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbols-casting-error/m-p/1430141#M205739</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;Try to define w_temp as char instead of string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA W_TEMP(10000).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2006 17:26:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbols-casting-error/m-p/1430141#M205739</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-14T17:26:31Z</dc:date>
    </item>
  </channel>
</rss>

