<?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: Update a Z table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-a-z-table/m-p/3530621#M849340</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dhruv,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIRST TEST IN SANDBOX or DEV REGION/SERVER.&lt;/P&gt;&lt;P&gt;THIS METHOD IS NOT TESTED BUT MIGHT JUST WORK , TRY ONLY  IF NO OTHER SOLUTION AVAILABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TAKE THE BACKUP OF THE TABLE BEFORE DOING ANY CHANGES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider a following example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZT00_EMP has employee data and the PK of this constituted by MANDT, EMP_NO  and ACC_NO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you want to change the values in say ACC_NO column for all the entries.i.e. you want to update records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add a new column (in SE11 )  in the table say - ACC_NO_1&lt;/P&gt;&lt;P&gt;and update the new/changed values in this column in the table. After this , in SE11 change the table defination by removing the ACC_NO from key and adding ACC_NO_1 in the key. So the new key will be MANDT, EMP_NO and ACC_NO_1.  You can either delete column ACC_NO and rename column ACC_NO_1 to ACC_NO or leave it as it is but then you will have to change all programs for name from ACC_NO to ACC_NO_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can always do this in INTERNAL TABLE first and then UPDATE ZTABLE from ITAB..... (FOR DATA PART)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this works.&lt;/P&gt;&lt;P&gt;PLEASE TAKE BACKUP FIRST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gaurav P Fadnis on Mar 7, 2008 11:05 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Mar 2008 09:59:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-07T09:59:38Z</dc:date>
    <item>
      <title>Update a Z table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-a-z-table/m-p/3530620#M849339</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 need to update a Z table.. ( update is a primary key .. this table has 7 P. keys )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bcoz of performance reasons, I can not go line by line and use SET command..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IS there any other way i can upadte the records of this table in one shot.. like.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE &amp;lt;ztable? from &amp;lt;internal table&amp;gt; but I think this can not update the P. key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify will not work as it would insert a new entry in the table.... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ways to handle this issue.. apart from looping it through...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2008 09:40:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-a-z-table/m-p/3530620#M849339</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-07T09:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Update a Z table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-a-z-table/m-p/3530621#M849340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dhruv,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIRST TEST IN SANDBOX or DEV REGION/SERVER.&lt;/P&gt;&lt;P&gt;THIS METHOD IS NOT TESTED BUT MIGHT JUST WORK , TRY ONLY  IF NO OTHER SOLUTION AVAILABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TAKE THE BACKUP OF THE TABLE BEFORE DOING ANY CHANGES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider a following example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZT00_EMP has employee data and the PK of this constituted by MANDT, EMP_NO  and ACC_NO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you want to change the values in say ACC_NO column for all the entries.i.e. you want to update records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add a new column (in SE11 )  in the table say - ACC_NO_1&lt;/P&gt;&lt;P&gt;and update the new/changed values in this column in the table. After this , in SE11 change the table defination by removing the ACC_NO from key and adding ACC_NO_1 in the key. So the new key will be MANDT, EMP_NO and ACC_NO_1.  You can either delete column ACC_NO and rename column ACC_NO_1 to ACC_NO or leave it as it is but then you will have to change all programs for name from ACC_NO to ACC_NO_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can always do this in INTERNAL TABLE first and then UPDATE ZTABLE from ITAB..... (FOR DATA PART)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this works.&lt;/P&gt;&lt;P&gt;PLEASE TAKE BACKUP FIRST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gaurav P Fadnis on Mar 7, 2008 11:05 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2008 09:59:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-a-z-table/m-p/3530621#M849340</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-07T09:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Update a Z table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-a-z-table/m-p/3530622#M849341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Check this out (a sample code).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:it_spfli TYPE TABLE OF spfli,&lt;/P&gt;&lt;P&gt;     wa_sp    LIKE LINE  OF it_spfli.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;  FROM spfli&lt;/P&gt;&lt;P&gt;  INTO table it_spfli&lt;/P&gt;&lt;P&gt; WHERE carrid = 'UA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT it_spfli INTO wa_sp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    wa_sp-fltime = '800'.&lt;/P&gt;&lt;P&gt;    MODIFY it_spfli FROM wa_sp INDEX sy-tabix TRANSPORTING fltime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  UPDATE spfli FROM TABLE it_spfli.&lt;/P&gt;&lt;P&gt;&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;  write :'updated'.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solve ur issue.Be sure that u have all the fields with data in the  internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neeraj.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2008 10:05:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-a-z-table/m-p/3530622#M849341</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-07T10:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Update a Z table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-a-z-table/m-p/3530623#M849342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;  try to use &lt;/P&gt;&lt;P&gt;  INSERT into &amp;lt;db table name &amp;gt; VALUES  &amp;lt;WA name&amp;gt;.&lt;/P&gt;&lt;P&gt;OR &lt;/P&gt;&lt;P&gt;INSERT dbtab FROM TABLE itab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 06:45:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-a-z-table/m-p/3530623#M849342</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T06:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Update a Z table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-a-z-table/m-p/3530624#M849343</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.&lt;/P&gt;&lt;P&gt;update &lt;STRONG&gt;target source&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;This changes the content of one or more lines of the dbtable specified  in TARGET .The entries in &lt;STRONG&gt;source&lt;/STRONG&gt; determine which columns of which lines are changed, and how they are changed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The changes are definitively copied to the database with the next database commit. Until that point, they can still be undone using a database rollback .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;sandhya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 05:15:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-a-z-table/m-p/3530624#M849343</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-14T05:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Update a Z table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-a-z-table/m-p/3530625#M849344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think to update primary key only way is Using SET&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 12:15:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-a-z-table/m-p/3530625#M849344</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-14T12:15:17Z</dc:date>
    </item>
  </channel>
</rss>

