<?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: TABLE_ILLEGAL_STATEMENT in modify statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426744#M1647191</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kishan ji..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But how can I reflect the changes in gt_final with two fields named amt_plan and qty_plan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Dec 2011 10:18:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-12-20T10:18:59Z</dc:date>
    <item>
      <title>TABLE_ILLEGAL_STATEMENT in modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426737#M1647184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I am getting a dump( TABLE_ILLEGAL_STATEMENT) in modify statement in a section of my code where I want to modify two fields named amt_plan and qty_plan into an internal table gt_final.&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    SELECT objnr gjahr wrttp versn uspob wkg001 wkg002 wkg003 wkg004 wkg005 wkg006 wkg007 wkg008 wkg009
           wkg010 wkg011 wkg012 meg001 meg002 meg003 meg004 meg005 meg006 meg007 meg008 meg009 meg010
           meg011 meg012 FROM coss INTO TABLE gt_coss FOR ALL ENTRIES IN gt_afvc
           WHERE objnr = gt_afvc-objnr OR wrttp = 1 OR versn = 0 OR gjahr NE ''.

    LOOP AT gt_coss INTO gw_coss.
      READ TABLE gt_final INTO gw_final WITH KEY objnr = gw_coss-objnr.
      IF sy-subrc = 0.
        gw_final-amt_plan = gw_coss-wkg001 + gw_coss-wkg002 + gw_coss-wkg003 + gw_coss-wkg004
                            + gw_coss-wkg005 + gw_coss-wkg006 + gw_coss-wkg007 + gw_coss-wkg008
                            + gw_coss-wkg009 + gw_coss-wkg010 + gw_coss-wkg011 + gw_coss-wkg012.

        gw_final-qty_plan = gw_coss-meg001 + gw_coss-meg002 + gw_coss-meg003 + gw_coss-meg004
                            + gw_coss-meg005 + gw_coss-meg006 + gw_coss-meg007 + gw_coss-meg008
                            + gw_coss-meg009 + gw_coss-meg010 + gw_coss-meg011 + gw_coss-meg012.
*        APPEND gw_final TO gt_final.
        MODIFY gt_final FROM gw_final.
      ENDIF.
      CLEAR: gw_final, gw_coss.
    ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Paaavan on Dec 20, 2011 11:08 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 10:07:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426737#M1647184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T10:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: TABLE_ILLEGAL_STATEMENT in modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426738#M1647185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thats because you are looping table &lt;STRONG&gt;gt_coss&lt;/STRONG&gt;  and modifying table &lt;STRONG&gt;gt_final&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;This is not allowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 10:13:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426738#M1647185</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T10:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: TABLE_ILLEGAL_STATEMENT in modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426739#M1647186</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;Modify using Transporting with this 2 fileds amt_plan, qty_plan.&lt;/P&gt;&lt;P&gt;it will works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sanjay Gogikar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 10:15:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426739#M1647186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T10:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: TABLE_ILLEGAL_STATEMENT in modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426740#M1647187</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 using 'TRANSPORITING' along with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY gt_final FROM gw_final transporting amt_plan qty_plan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sharin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 10:16:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426740#M1647187</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T10:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: TABLE_ILLEGAL_STATEMENT in modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426741#M1647188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Use transporting keyword&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify itab from wa transporting field1 field2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field1 and field2 are modifying fields in your internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;G.Aditya&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Aditya.G on Dec 20, 2011 3:48 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 10:17:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426741#M1647188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T10:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: TABLE_ILLEGAL_STATEMENT in modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426742#M1647189</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;Can you try moving the gt_final into some temp internal table and do this action. Also try with Transporting the required fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;senthil kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 10:18:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426742#M1647189</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T10:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: TABLE_ILLEGAL_STATEMENT in modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426743#M1647190</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;You need to use MODIFY &lt;STRONG&gt;table&lt;/STRONG&gt; gt_final from gw_final as you are not trying to update the gt_final table in a loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Sriranjani Chimakurthy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 10:18:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426743#M1647190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T10:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: TABLE_ILLEGAL_STATEMENT in modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426744#M1647191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kishan ji..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But how can I reflect the changes in gt_final with two fields named amt_plan and qty_plan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 10:18:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426744#M1647191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T10:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: TABLE_ILLEGAL_STATEMENT in modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426745#M1647192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   Following changes need to be done :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data : l_tabix type sy-tabix.

LOOP AT gt_coss INTO gw_coss.
      READ TABLE gt_final INTO gw_final WITH KEY objnr = gw_coss-objnr.
      IF sy-subrc = 0.
     clear l_tabix.
      l_tabix = sy-tabix.
        gw_final-amt_plan = gw_coss-wkg001 + gw_coss-wkg002 + gw_coss-wkg003 + gw_coss-wkg004
                            + gw_coss-wkg005 + gw_coss-wkg006 + gw_coss-wkg007 + gw_coss-wkg008
                            + gw_coss-wkg009 + gw_coss-wkg010 + gw_coss-wkg011 + gw_coss-wkg012.
 
        gw_final-qty_plan = gw_coss-meg001 + gw_coss-meg002 + gw_coss-meg003 + gw_coss-meg004
                            + gw_coss-meg005 + gw_coss-meg006 + gw_coss-meg007 + gw_coss-meg008
                            + gw_coss-meg009 + gw_coss-meg010 + gw_coss-meg011 + gw_coss-meg012.
*        APPEND gw_final TO gt_final.
        MODIFY gt_final FROM gw_final index l_tabix transporting amt_plan qty_plan.

 (Check syntax here , maybe index comes after transporting)

      ENDIF.
      CLEAR: gw_final, gw_coss.
ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the internal table you are using is not in loop, you will have to explicitly give the index as wel..&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: arun warrier on Dec 20, 2011 3:52 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 10:21:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426745#M1647192</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T10:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: TABLE_ILLEGAL_STATEMENT in modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426746#M1647193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As it is giving a problem with ur table index's in the loop since the read stament is been used in it. you can use the index or transpoting the fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I prefer Rather than using modify use the field symbols will not give the dump.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 10:23:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426746#M1647193</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T10:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: TABLE_ILLEGAL_STATEMENT in modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426747#M1647194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;use the following syntax&lt;/P&gt;&lt;P&gt;MODIFY it_final  from wa_final index sy-tabix.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 10:43:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-illegal-statement-in-modify-statement/m-p/8426747#M1647194</guid>
      <dc:creator>naresh_bammidi</dc:creator>
      <dc:date>2011-12-20T10:43:57Z</dc:date>
    </item>
  </channel>
</rss>

