<?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: Updating only Changed Fields in Db table from table control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-only-changed-fields-in-db-table-from-table-control/m-p/5753406#M1303604</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i think you cannot write the updation of the Ztable fields in a single row for only some fields,you have to write for updating the whole row.&lt;/P&gt;&lt;P&gt;For an internal table you can write by using TRANSPORTING..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Jun 2009 05:34:14 GMT</pubDate>
    <dc:creator>former_member242255</dc:creator>
    <dc:date>2009-06-05T05:34:14Z</dc:date>
    <item>
      <title>Updating only Changed Fields in Db table from table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-only-changed-fields-in-db-table-from-table-control/m-p/5753405#M1303603</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 have an table control displayed on module pool screen, and an Internal table which holds table control's &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When a person changes anything in table control, after pressing Save button only &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the "CHANGED/EDITED FIELDS" should get updated in my Z table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which will ensure good performance (i.e system doesn't have to overwrite UNCHANGED FIELDS as well &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in Z table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I achive this ? Please provide sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tulip&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2009 05:31:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/updating-only-changed-fields-in-db-table-from-table-control/m-p/5753405#M1303603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-05T05:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Updating only Changed Fields in Db table from table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-only-changed-fields-in-db-table-from-table-control/m-p/5753406#M1303604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i think you cannot write the updation of the Ztable fields in a single row for only some fields,you have to write for updating the whole row.&lt;/P&gt;&lt;P&gt;For an internal table you can write by using TRANSPORTING..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2009 05:34:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/updating-only-changed-fields-in-db-table-from-table-control/m-p/5753406#M1303604</guid>
      <dc:creator>former_member242255</dc:creator>
      <dc:date>2009-06-05T05:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Updating only Changed Fields in Db table from table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-only-changed-fields-in-db-table-from-table-control/m-p/5753407#M1303605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tulip,&lt;/P&gt;&lt;P&gt;    By default bring all the Data's in the table control in display mode,&lt;/P&gt;&lt;P&gt;    have a button called  EDIT in PF-status whenever you wants to change anything , cselect the rows and click edit button and after editing the by pressing save button you can update to the DB table,&lt;/P&gt;&lt;P&gt;check below code,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  DISABLE_ENABLE_FIELDS_100  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      To enable and diable fields n Edit click&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE disable_enable_fields_100 OUTPUT.&lt;/P&gt;&lt;P&gt;  DATA : v_line_sel TYPE i,&lt;/P&gt;&lt;P&gt;        v_dummy,&lt;/P&gt;&lt;P&gt;        v_line_no(6) VALUE 'LINENO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CHECK ok_code = 'EDIT'.&lt;/P&gt;&lt;P&gt;*GET CURSOR FIELD V_LINE_NO LINE v_line_sel.&lt;/P&gt;&lt;P&gt;  IF  x_assignment-lineno = 'X'.&lt;/P&gt;&lt;P&gt;    LOOP AT SCREEN .&lt;/P&gt;&lt;P&gt;      IF  screen-name = 'X_ASSIGNMENT-EMPLOYEE_ID'    OR&lt;/P&gt;&lt;P&gt;       screen-name    = 'X_ASSIGNMENT-ACTIVITY'       OR&lt;/P&gt;&lt;P&gt;       screen-name    = 'X_ASSIGNMENT-MATERIAL'       OR&lt;/P&gt;&lt;P&gt;       screen-name    = 'X_ASSIGNMENT-ADATE'.&lt;/P&gt;&lt;P&gt;        screen-input = 1.&lt;/P&gt;&lt;P&gt;        MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;        CLEAR x_assignment-lineno .&lt;/P&gt;&lt;P&gt;        MODIFY t_assignment FROM x_assignment INDEX tablecontrol-current_line TRANSPORTING lineno.&lt;/P&gt;&lt;P&gt;        CLEAR v_line_sel.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2009 05:41:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/updating-only-changed-fields-in-db-table-from-table-control/m-p/5753407#M1303605</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-05T05:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Updating only Changed Fields in Db table from table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-only-changed-fields-in-db-table-from-table-control/m-p/5753408#M1303606</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 check out the link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/abap-code-samples/table%20control%20in%20abap.pdf" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/abap-code-samples/table%20control%20in%20abap.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer the sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO demo_conn WHERE mark = 'X'.&lt;/P&gt;&lt;P&gt;insert into table from itab.&lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_dynpro_tabcont_loop_at.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.&lt;/P&gt;&lt;P&gt;DATA cols LIKE LINE OF flights-cols.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ok_code TYPE sy-ucomm,&lt;/P&gt;&lt;P&gt;save_ok TYPE sy-ucomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: itab TYPE TABLE OF demo_conn.&lt;/P&gt;&lt;P&gt;TABLES demo_conn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM spfli INTO TABLE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT flights-cols INTO cols WHERE index GT 2.&lt;/P&gt;&lt;P&gt;cols-screen-input = '0'.&lt;/P&gt;&lt;P&gt;MODIFY flights-cols FROM cols INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL SCREEN 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;P&gt;SET PF-STATUS 'SCREEN_100'.&lt;/P&gt;&lt;P&gt;ENDMODULE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE cancel INPUT.&lt;/P&gt;&lt;P&gt;LEAVE PROGRAM.&lt;/P&gt;&lt;P&gt;ENDMODULE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE read_table_control INPUT.&lt;/P&gt;&lt;P&gt;MODIFY itab FROM demo_conn INDEX flights-current_line.&lt;/P&gt;&lt;P&gt;ENDMODULE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;save_ok = ok_code.&lt;/P&gt;&lt;P&gt;CLEAR ok_code.&lt;/P&gt;&lt;P&gt;CASE save_ok.&lt;/P&gt;&lt;P&gt;WHEN 'TOGGLE'.&lt;/P&gt;&lt;P&gt;LOOP AT flights-cols INTO cols WHERE index GT 2.&lt;/P&gt;&lt;P&gt;IF cols-screen-input = '0'.&lt;/P&gt;&lt;P&gt;cols-screen-input = '1'.&lt;/P&gt;&lt;P&gt;ELSEIF cols-screen-input = '1'.&lt;/P&gt;&lt;P&gt;cols-screen-input = '0'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;MODIFY flights-cols FROM cols INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;WHEN 'SORT_UP'.&lt;/P&gt;&lt;P&gt;READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;SORT itab STABLE BY (cols-screen-name+10) ASCENDING.&lt;/P&gt;&lt;P&gt;cols-selected = ' '.&lt;/P&gt;&lt;P&gt;MODIFY flights-cols FROM cols INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;WHEN 'SORT_DOWN'.&lt;/P&gt;&lt;P&gt;READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;SORT itab STABLE BY (cols-screen-name+10) DESCENDING.&lt;/P&gt;&lt;P&gt;cols-selected = ' '.&lt;/P&gt;&lt;P&gt;MODIFY flights-cols FROM cols INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;WHEN 'DELETE'.&lt;/P&gt;&lt;P&gt;READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO demo_conn WHERE mark = 'X'.&lt;/P&gt;&lt;P&gt;DELETE itab.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;WHEN 'INSERT'.&lt;/P&gt;&lt;P&gt;READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO demo_conn WHERE mark = 'X'.&lt;/P&gt;&lt;P&gt;itab1 = itab.&lt;/P&gt;&lt;P&gt;modify itab1.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;if not itab1 is initial.&lt;/P&gt;&lt;P&gt;INSERT dbtab FROM TABLE itab1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;ENDMODULE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sumana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2009 05:43:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/updating-only-changed-fields-in-db-table-from-table-control/m-p/5753408#M1303606</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-05T05:43:48Z</dc:date>
    </item>
  </channel>
</rss>

