<?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: Modify Statement Not Working in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292882#M1725347</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Askar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unles you declare the itab as sorted or hashed and define a key and insert into this table i&lt;/P&gt;&lt;P&gt;simply would append your wa to itab. (You will not be able to control duplicates like this).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is probably the index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards &lt;/P&gt;&lt;P&gt;Jonas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Mar 2013 12:54:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-03-05T12:54:18Z</dc:date>
    <item>
      <title>Modify Statement Not Working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292877#M1725342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts...&lt;/P&gt;&lt;P&gt;I have a problem in my code,I am trying to modify internal table from workarea which is assigned to table control,&lt;/P&gt;&lt;P&gt;for the purpose when user hits 'ENTER' key i want to modify internal table and update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i checked many posts,but still am stuck here,when i check the subrc value it gives '4'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am pasting my code here.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt;&lt;SPAN class="L0S52"&gt;REPORT&amp;nbsp; &lt;/SPAN&gt;ztable_control&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt;&lt;SPAN class="L0S52"&gt;TABLES &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;zemp_head_tab&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S52"&gt;CONTROLS &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;table &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;TABLEVIEW &lt;SPAN class="L0S52"&gt;USING &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;SCREEN &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'0101'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S52"&gt;DATA &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;itab &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;STANDARD &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;OF &lt;/SPAN&gt;zemp_head_tab&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wa &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;zemp_head_tab&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S52"&gt;CALL &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;SCREEN &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'0101'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;flow logic&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt;PROCESS BEFORE &lt;SPAN class="L0S52"&gt;OUTPUT&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S52"&gt;MODULE &lt;/SPAN&gt;STATUS&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S52"&gt;LOOP &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;at &lt;/SPAN&gt;ITAB &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;zemp_head_tab &lt;SPAN class="L0S52"&gt;WITH &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;CONTROL &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;table&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;endloop&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S31"&gt;*&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S31"&gt;PROCESS AFTER INPUT.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S31"&gt;loop at ITAB.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S31"&gt; MODULE modify_itab.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S31"&gt;&amp;nbsp; endloop.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;EM&gt;&lt;SPAN class="L0S31" style="color: #3366ff;"&gt;&amp;nbsp; module user_command.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;&lt;SPAN class="L0S52"&gt;module &lt;/SPAN&gt;modify_itab &lt;SPAN class="L0S52"&gt;input&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S52"&gt;MOVE-CORRESPONDING &lt;/SPAN&gt;zemp_head_tab &lt;SPAN class="L0S52"&gt;to &lt;/SPAN&gt;wa&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S52"&gt;MODIFY &lt;/SPAN&gt;ITAB &lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;wa &lt;SPAN class="L0S52"&gt;index &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;table&lt;/SPAN&gt;&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;current_line&lt;SPAN class="L0S55"&gt;. &lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;SY&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;SUBRC &amp;lt;&amp;gt; &lt;SPAN class="L0S32"&gt;0&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; &lt;SPAN class="L0S52"&gt;endmodule&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&amp;nbsp; &lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31" style="color: #3366ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 11:39:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292877#M1725342</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T11:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Statement Not Working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292878#M1725343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Askar,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You are using a standard table, when you modify, your work area and internal table key fields should match. People forget this sometimes, In case of standard table Non Numeric fields are the Key fields. check if all non-numeric fields in workarea are same as the entry which you are trying to modify in Itab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 12:12:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292878#M1725343</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T12:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Statement Not Working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292879#M1725344</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;What are the key fields in your table ? Check if you are not entering the same key fields in the table control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tooshar Bendale&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 12:31:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292879#M1725344</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T12:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Statement Not Working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292880#M1725345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt; actually am having only 3 fields (non-numeric) and when i enter values in table control i get those values in work area,&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Am i answering correct? or did i understand wrongly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Askar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 12:42:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292880#M1725345</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T12:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Statement Not Working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292881#M1725346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No am not entering the same values.&lt;/P&gt;&lt;P&gt;i checked some demo programs,there the internal table is intially updated from database table,&lt;/P&gt;&lt;P&gt;here in my code in modify statement i checked the table there are no values since i didnt select any values from data base,&lt;BR /&gt;would that be a problem??&lt;BR /&gt; &lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 12:45:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292881#M1725346</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T12:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Statement Not Working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292882#M1725347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Askar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unles you declare the itab as sorted or hashed and define a key and insert into this table i&lt;/P&gt;&lt;P&gt;simply would append your wa to itab. (You will not be able to control duplicates like this).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is probably the index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards &lt;/P&gt;&lt;P&gt;Jonas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 12:54:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292882#M1725347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T12:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Statement Not Working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292883#M1725348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Imran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In PAI block, you are looping without control and in modify statement you are using index table-current line; which is not align.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you should use LOOP with control in PAI block also and do the according coding to modify the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Ashok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 13:36:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292883#M1725348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T13:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Statement Not Working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292884#M1725349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need Values in Internal Table before Modifying it.&lt;/P&gt;&lt;P&gt;MODIFY works different for Internal Table and Database Table, In Database Table if entry is not present during Modify it inserts it, but in case of Internal Table, It simply returns sy-subrc =4.&lt;/P&gt;&lt;P&gt;I think you didnt understand how Internal table works. As you said, If you are not Entering the same value into Ur Internal Table, that means your Table key is Different. Then It wont get Modified.&lt;/P&gt;&lt;P&gt;As I mentioned Earlier Your Non Numeric fields will be the Key Fields of Table(for Standard Table). So as in your case, You are entering different values, so The key itself becomes different, so how will it get modified?. The only solution is to use hashed table or sorted table with a non unique key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How Modified works in case of Standr table is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i have 3 fields (Name, City,Number) with values ABC,Bangalore,123 here ABC and Bangalore are considered as Key fields. So only if ABC and Bangalore remain the same your Modify statement will work. If any one among those two are changed its treated as a new entry.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:11:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-statement-not-working/m-p/9292884#M1725349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T15:11:50Z</dc:date>
    </item>
  </channel>
</rss>

