<?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: Database Update Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825575#M352290</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subramanian ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried modify but it is not getting modified in the database after save.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any problem with the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jan 2007 03:59:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-29T03:59:15Z</dc:date>
    <item>
      <title>Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825571#M352286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a table control on a screen, I am updating the table control rows and then saving , I want all the rows in the table should get modified in the database table, for this I am using the code below  but it is giving a runtime error 'SAPSQL_ARRAy_INSERT_DUPREC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form update_database.&lt;/P&gt;&lt;P&gt;  data: lt_del_rows type table of ZEXC_REC,&lt;/P&gt;&lt;P&gt;        lt_ins_keys type g_verifier-&amp;gt;zexc_rec_keys,&lt;/P&gt;&lt;P&gt;        l_ins_key type g_verifier-&amp;gt;ZEXC_REC_key,&lt;/P&gt;&lt;P&gt;        ls_ZEXC_REC type ZEXC_REC,&lt;/P&gt;&lt;P&gt;        ls_outtab like line of gt_outtab,&lt;/P&gt;&lt;P&gt;        lt_instab type table of ZEXC_REC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;§8.When all values are valid, use your internal tables&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   to update your table on the database.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;First delete lines in data base according to the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;keys you remembered within 'g_verifier'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Imagine a user deleted a row and then entered one with&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the same key fields like the deleted ones.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Then both tables (deleted_rows, inserted_rows) have got&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;an entry of this row.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;So if you first inserted the new rows in the data base&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and then deleted rows according to 'deleted_rows'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The reentered rows would be lost.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;1.Delete Lines:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method g_verifier-&amp;gt;get_deleted_rows&lt;/P&gt;&lt;P&gt;          importing deleted_rows = lt_del_rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  delete ZEXC_REC from table lt_del_rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;2.Insert Lines:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method g_verifier-&amp;gt;get_inserted_rows&lt;/P&gt;&lt;P&gt;          importing inserted_rows = lt_ins_keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at lt_ins_keys into l_ins_key.&lt;/P&gt;&lt;P&gt;    read table gt_outtab into ls_outtab&lt;/P&gt;&lt;P&gt;     with key LIFNR = l_ins_key-LIFNR&lt;/P&gt;&lt;P&gt;              DOCNO = l_ins_key-DOCNO&lt;/P&gt;&lt;P&gt;              DOCTYP = l_ins_key-DOCTYP&lt;/P&gt;&lt;P&gt;              HIERNO = l_ins_key-HIERNO&lt;/P&gt;&lt;P&gt;              matnr = l_ins_key-matnr.&lt;/P&gt;&lt;P&gt;    if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;      move-corresponding ls_outtab to ls_ZEXC_REC.&lt;/P&gt;&lt;P&gt;      append ls_ZEXC_REC to lt_instab.&lt;/P&gt;&lt;P&gt;    endif.&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;  insert ZEXC_REC from table lt_instab.&lt;/P&gt;&lt;P&gt;  commit work.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Insert first default row for ARE1 document&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;§9.Refresh your internal tables.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method g_verifier-&amp;gt;refresh_delta_tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 03:28:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825571#M352286</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T03:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825572#M352287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i think you are updating key fields with duplicate values. so you can insert like this it may work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;insert ZEXC_REC from table lt_instab accepting duplicate keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it may work and one thing your internal table should be like the database table with all the fields in correct order.&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;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 03:45:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825572#M352287</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T03:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825573#M352288</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 MODIFY statement instead of INSERT because INSERT tries to insert new records,&lt;/P&gt;&lt;P&gt;whereas,&lt;/P&gt;&lt;P&gt;Modify checks if there is a record with the primary keys in your internal table, if there exists an entry, it will update the entry. If does not find it then it would create a new entry, so any time you will never experience the Duplicate entry error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Subramanian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 03:55:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825573#M352288</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T03:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825574#M352289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Shiba for ur reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using ur idea but now it is not inserting only in the database. I want the previous rows to get deleted and new rows with modified values to get inserted in the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 03:55:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825574#M352289</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T03:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825575#M352290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subramanian ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried modify but it is not getting modified in the database after save.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any problem with the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 03:59:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825575#M352290</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T03:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825576#M352291</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 modify statement as I have explained earlier. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Subramanian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 04:01:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825576#M352291</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T04:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825577#M352292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the thing is if you try to duplicate your key values then i think it is not possible because it may leads to database inconsistancies. the key fields must be unique in database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 04:06:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825577#M352292</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T04:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825578#M352293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rahul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your code you are straight away inserting the internal table records into the database table. You need to do two thnigs before inserting the lines into the DB table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Check for SY-SUBRC to confirm if the previous records are deleted successfully.&lt;/P&gt;&lt;P&gt;2. Before inserting records, sort internal table and use statement DELETE ADJACENT DUPLICATE. If there are any numeric fields in the table and you want the total to appear in one entry, use COLLECT statement and get all unique key data in one internal table and then insert the records in the DB table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Susanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 04:07:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825578#M352293</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T04:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825579#M352294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using sy-subrc, its 0, but&amp;lt;b&amp;gt; lt_del_rows&amp;lt;/b&amp;gt; in the following line of code is blank it is not having any data, so it is just deleting blank row i guess, i want to delete all the rows of the table control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete ZEXC_REC from table lt_del_rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rahul Ghan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 04:22:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825579#M352294</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T04:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825580#M352295</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;Do a acheck before delete. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;If NOT lt_del_rows IS INITIAL.
 delete ZEXC_REC from table lt_del_rows.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 04:34:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825580#M352295</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T04:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825581#M352296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anybody please tell , what following statement does,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method g_verifier-&amp;gt;get_deleted_rows&lt;/P&gt;&lt;P&gt;          importing deleted_rows = lt_del_rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and what is g_verifier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 04:35:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825581#M352296</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T04:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825582#M352297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Judith,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried ur code , it is not going inside the if statement , lt_del_rows  is initial, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before that it is calling  the function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method g_verifier-&amp;gt;get_deleted_rows&lt;/P&gt;&lt;P&gt;          importing deleted_rows = lt_del_rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the definition of the function is,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method get_deleted_rows.&lt;/P&gt;&lt;P&gt;                deleteted_rows = me-&amp;gt;deleted_rows.&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u please tell what above function is doing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 04:44:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825582#M352297</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T04:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825583#M352298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rahul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'me' is an instance of a class created in your program. Can you provide all your program code.... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI, the internal table name for deletion should be one you defined while creating the table control.... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Susanth.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 05:00:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825583#M352298</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T05:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825584#M352299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to write like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : o_alvgrid          TYPE REF TO cl_gui_alv_grid,

  METHOD handle_user_command.
* In event handler method for event USER_COMMAND: Query your
*   function codes defined in step 2 and react accordingly.

    CASE e_ucomm.

      WHEN 'FCODE'.
        CALL METHOD o_alvgrid-&amp;gt;get_selected_rows
          IMPORTING
            et_index_rows = i_selected_rows&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried similar to this.&lt;/P&gt;&lt;P&gt;Check for the parameters in get_deleted_rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function should retrieve teh deleted rows when you press a delete button.&lt;/P&gt;&lt;P&gt;So write the code in the user_command for delete functioanlity.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 05:03:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825584#M352299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T05:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825585#M352300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Susanth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already posted the code above,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a grid in the screen declared using the statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;g_custom_container type ref to cl_gui_custom_container,&lt;/P&gt;&lt;P&gt;g_grid  type ref to cl_gui_alv_grid,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having more than one row in this grid and I want to save  changes to all these rows in the database at the click of save button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using object based programming here for inserting and deleting rows,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 05:10:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825585#M352300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T05:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825586#M352301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to write like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
************************************************************************
INCLUDE &amp;lt;icon&amp;gt;.

* Predefine a local class for event handling to allow the
* declaration of a reference variable before the class is defined.
CLASS lcl_event_receiver DEFINITION DEFERRED.
CLASS cl_gui_container DEFINITION LOAD.

DATA : o_alvgrid          TYPE REF TO cl_gui_alv_grid,
       i_selected_rows TYPE lvc_t_row.


CLASS lcl_event_receiver DEFINITION.

*   event receiver definitions for ALV actions
  PUBLIC SECTION.
    CLASS-METHODS:
* Status bar
       handle_user_command
        FOR EVENT user_command OF cl_gui_alv_grid
            IMPORTING e_ucomm,
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION.

  METHOD handle_user_command.
* In event handler method for event USER_COMMAND: Query your
*   function codes defined in step 2 and react accordingly.

    CASE e_ucomm.

      WHEN 'FCODE'.
        CALL METHOD o_alvgrid-&amp;gt;get_selected_rows
          IMPORTING
            et_index_rows = i_selected_rows

        IF i_selected_rows[] IS INITIAL.
          MESSAGE i153 WITH text-009.
          LEAVE LIST-PROCESSING.
        ENDIF.

  WHEN OTHERS.

    ENDCASE.
  ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried similar to this.&lt;/P&gt;&lt;P&gt;Check for the parameters in get_deleted_rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function should retrieve teh deleted rows when you press a delete button.&lt;/P&gt;&lt;P&gt;So write the code in the user_command for delete functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure all these are there in ur program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also SET HANDLER FOR user command should be there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Verify whether get_deleted_rows is available in the method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 05:21:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825586#M352301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T05:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825587#M352302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Judith,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to update the changes done in the grid into the database by any way, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying the way to first delete all the rows and then insert all the rows from the grid into the database with updated values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to update the contents of the batabase table from the contents of the grid, if yes  please tell the way to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for ur help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 05:39:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825587#M352302</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T05:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Database Update Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825588#M352303</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 can update dbase table from grid.&lt;/P&gt;&lt;P&gt;You can do the coding here &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; IF NOT  i_selected_rows[] IS INITIAL.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;  Then depending upon ur requirement u can do the coding here, for updation and deletion.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway u can do the processing after selecting rows from the grid.&lt;/P&gt;&lt;P&gt;Now the i_selected_rows table will be having some values.&lt;/P&gt;&lt;P&gt;If you like to update table then do that here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 07:20:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-update-problem/m-p/1825588#M352303</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T07:20:03Z</dc:date>
    </item>
  </channel>
</rss>

