<?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: Insert or Modify statement from internal table to database table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011841#M958538</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The BAPI is documented. You should check that first. If you still have questions, get back to the forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jun 2008 18:34:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-17T18:34:03Z</dc:date>
    <item>
      <title>Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011829#M958526</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 have three tables wakh, wrf and wakp. I have an internal table with 5 columns col1, col2, col3, col4 and col5. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value in Col1 is my article no and the articleno. is in the table wakh. The value in col2 is my ccode and it is in the table wrf. The rest three columns col3, col4 and col5 are unit, qty and price and they are in the wakp table. Now when my articleno is equal to ccode I need to update the col3, col4 and col5 values  in the wakp. wakp has around 20 columns. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone of you guys please give me the code for this issue. Your help is highly appreciated and thanks for all for your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Cheng&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 16:50:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011829#M958526</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T16:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011830#M958527</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 this way  ... assuming that the col3, col4, col5 are being written to &lt;/P&gt;&lt;P&gt;it_wakh table with all the fields present in it ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at it_wakh.
  lv_tabix = sy-tabix.
  read table it_wrf with key col2 = it_wakh-col1.
  if sy-subrc = 0.
   modify wakp from it_wakh transporting  col3 col4 col5 index lv_tabix .
 endif.
endloop.  &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 16:56:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011830#M958527</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T16:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011831#M958528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for replying to me.  I forget to tell in my last thread that my internal table is wa_datatab. And also just to tell you that I am currently uploading excel to internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_datatab INTO wa_datatab.&lt;/P&gt;&lt;P&gt;WRITE:/ wa_datatab-col1,&lt;/P&gt;&lt;P&gt; wa_datatab-col2,&lt;/P&gt;&lt;P&gt;wa_datatab-col3,&lt;/P&gt;&lt;P&gt;wa_datatab-col4,&lt;/P&gt;&lt;P&gt; wa_datatab-col5.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I am displaying the internal table. So now instead of displaying I have to send the values into the database table. I hope this will give you some idea what I am doing. Can you please give me the code accordingly. Thanks for your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheng.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 17:09:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011831#M958528</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T17:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011832#M958529</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;&lt;/P&gt;&lt;P&gt;do this way ..Here i  have assumed that you are trying to modify AKTNR&lt;/P&gt;&lt;P&gt;ARTNR&lt;/P&gt;&lt;P&gt;MEBME fields of WAKP table ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : wa_wakp type wakp.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT it_datatab INTO wa_datatab.
  if wa_datatab-col1 = wa_datatab-col2.
    wa_wakp-AKTNR = wa_datatab-col3.
    wa_wakp-ARTNR = wa_datatab-col4.
    wa_wakp-MEBME = wa_datatab-col5.
    modify wakp from wa_wakp.
  endif.
ENDLOOP. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 17:17:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011832#M958529</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T17:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011833#M958530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mmm, have you seen if there is a bapi to update those tables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is not recomended to update or insert in standard tables just like that. It's likely that you will end up breaking something&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 17:23:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011833#M958530</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T17:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011834#M958531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the code what you have given in the second line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if wa_datatab-col1 = wa_datatab-col2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here col1 value is articleno and it is in table wakh&lt;/P&gt;&lt;P&gt;and col2 value is ccode and it is inthe table wrf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we should compare the values which in these columns with the corresponding article and ccode and then update rest of the three fields. sorry for my ignorance if I am not on the same page with you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheng.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 17:28:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011834#M958531</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T17:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011835#M958532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ramiro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to ABAP and also I am not sure of any bapi whether exists for my requirement. If you know can you please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheng&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 17:29:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011835#M958532</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T17:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011836#M958533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you could make a bdc to transaction wak2 but I don't have data here to check if you can modify the header fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 17:42:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011836#M958533</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T17:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011837#M958534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are new to ABAP, then you should definitely be looking for a standard way to do this (BAPI or BDC).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What transaction would you functional person use to update this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 17:45:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011837#M958534</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T17:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011838#M958535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We will use wak2. Can you please guide me properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Cheng.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Cheng Wan on Jun 17, 2008 8:15 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 18:12:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011838#M958535</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T18:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011839#M958536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try &lt;STRONG&gt;BAPI_PROMO_CHANGE&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 18:16:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011839#M958536</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T18:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011840#M958537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let me explain you the whole process what i am trying to do. I have a screen where there are 3 fields. In my first field I have a promoiton no. As soon as the user enters the promotion no. its description will be populated in my second field. If the promotion is not maintained then it will throw an error. In my third field User will upload an excel sheet which has 5 columns articleno, colorcode, salesunit, qty, mdprice. Here articleno is coming from wakh and colorcode is in wrf_charval table and the rest three fields are coming from wakp table. So for the article no. which is in col1. and for its corresponding colorcode which is in col3 i need to update col3, col4, col5 values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With my below code I am able to upload the excel into internal table and display it. So instead of displaying I need to update in the database. Can you please let me know how I need to attach the function module within my code and update accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZTest.&lt;/P&gt;&lt;P&gt;tables : wakh, wakt.&lt;/P&gt;&lt;P&gt;Parameter: PromoID type wakh-aktnr, PromoDec type wakt-aktkt, p_file LIKE rlgrap-filename&lt;/P&gt;&lt;P&gt;               DEFAULT 'c:\test.xls' OBLIGATORY.   " File Name&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*FileName type string.&lt;/P&gt;&lt;P&gt;*file_nm type localfile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:   BEGIN OF t_datatab,&lt;/P&gt;&lt;P&gt;         col1(25)  TYPE c,&lt;/P&gt;&lt;P&gt;         col2(30)  TYPE c,&lt;/P&gt;&lt;P&gt;         col3(30)  TYPE c,&lt;/P&gt;&lt;P&gt;         col4(30)  TYPE c,&lt;/P&gt;&lt;P&gt;         col5(30)  TYPE c,&lt;/P&gt;&lt;P&gt;         END OF t_datatab.&lt;/P&gt;&lt;P&gt;DATA: it_datatab TYPE STANDARD TABLE OF t_datatab INITIAL SIZE 0,&lt;/P&gt;&lt;P&gt;      wa_datatab TYPE t_datatab.&lt;/P&gt;&lt;P&gt;Data : p_table type t_datatab occurs 0 with header line.&lt;/P&gt;&lt;P&gt;DATA : gd_scol   TYPE i VALUE '1',&lt;/P&gt;&lt;P&gt;       gd_srow   TYPE i VALUE '2',&lt;/P&gt;&lt;P&gt;       gd_ecol   TYPE i VALUE '5',&lt;/P&gt;&lt;P&gt;       gd_erow   TYPE i VALUE '65536'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_tab TYPE filetable,&lt;/P&gt;&lt;P&gt;      gd_subrc TYPE i.&lt;/P&gt;&lt;P&gt;field-symbols : &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT selection-screen on PromoID.&lt;/P&gt;&lt;P&gt;select single * from wakh where aktnr = PromoID.&lt;/P&gt;&lt;P&gt;  if sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;select aktkt from wakt into PromoDec where aktnr eq PromoID.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;message A000(ZI) with 'Promotion ID is not Maintained.'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Title : Excel Uploading&lt;/P&gt;&lt;P&gt;***************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;P&gt;*Selection screen definition&lt;/P&gt;&lt;P&gt;*SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.&lt;/P&gt;&lt;P&gt;*PARAMETERS:  p_file LIKE rlgrap-filename&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              DEFAULT 'c:\test.xls' OBLIGATORY.   " File Name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*SELECTION-SCREEN END OF BLOCK b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.&lt;/P&gt;&lt;P&gt;  REFRESH: it_tab.&lt;/P&gt;&lt;P&gt;  CALL METHOD cl_gui_frontend_services=&amp;gt;file_open_dialog&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      window_title     = 'Select File'&lt;/P&gt;&lt;P&gt;      default_filename = '*.xls'&lt;/P&gt;&lt;P&gt;      multiselection   = ' '&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      file_table       = it_tab&lt;/P&gt;&lt;P&gt;      rc               = gd_subrc.&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;  LOOP AT it_tab INTO p_file.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   so_fpath-sign = 'I'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   so_fpath-option = 'EQ'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   append so_fpath.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  PERFORM upload_excel_file TABLES   it_datatab&lt;/P&gt;&lt;P&gt;                             USING   p_file&lt;/P&gt;&lt;P&gt;                                     gd_scol&lt;/P&gt;&lt;P&gt;                                     gd_srow&lt;/P&gt;&lt;P&gt;                                     gd_ecol&lt;/P&gt;&lt;P&gt;                                     gd_erow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  LOOP AT it_datatab INTO wa_datatab.&lt;/P&gt;&lt;P&gt;    WRITE:/ wa_datatab-col1,&lt;/P&gt;&lt;P&gt;            wa_datatab-col2,&lt;/P&gt;&lt;P&gt;            wa_datatab-col3,&lt;/P&gt;&lt;P&gt;            wa_datatab-col4,&lt;/P&gt;&lt;P&gt;            wa_datatab-col5.&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;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;      Form  UPLOAD_EXCEL_FILE&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;      upload excel spreadsheet into internal table&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_TABLE    Table to return excel data into&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_FILE     file name and path&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_SCOL     start column&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_SROW     start row&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_ECOL     end column&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_EROW     end row&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;FORM upload_excel_file TABLES   p_table&lt;/P&gt;&lt;P&gt;                       USING    p_file&lt;/P&gt;&lt;P&gt;                                p_scol&lt;/P&gt;&lt;P&gt;                                p_srow&lt;/P&gt;&lt;P&gt;                                p_ecol&lt;/P&gt;&lt;P&gt;                                p_erow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : lt_intern TYPE  kcde_cells OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Has the following format:&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            Row number   | Colum Number   |   Value&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            ---------------------------------------&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     i.e.     1                 1             Name1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              2                 1             Joe&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : ld_index TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Note: Alternative function module - 'ALSM_EXCEL_TO_INTERNAL_TABLE'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                = p_file&lt;/P&gt;&lt;P&gt;      i_begin_col             = p_scol&lt;/P&gt;&lt;P&gt;      i_begin_row             = p_srow&lt;/P&gt;&lt;P&gt;      i_end_col               = p_ecol&lt;/P&gt;&lt;P&gt;      i_end_row               = p_erow&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      intern                  = LT_INTERN&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      inconsistent_parameters = 1&lt;/P&gt;&lt;P&gt;      upload_ole              = 2&lt;/P&gt;&lt;P&gt;      OTHERS                  = 3.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    FORMAT COLOR COL_BACKGROUND INTENSIFIED.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'Error Uploading file'.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF lt_intern[] IS INITIAL.&lt;/P&gt;&lt;P&gt;    FORMAT COLOR COL_BACKGROUND INTENSIFIED.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'No Data Uploaded'.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    SORT lt_intern BY row col.&lt;/P&gt;&lt;P&gt;    LOOP AT lt_intern.&lt;/P&gt;&lt;P&gt;     MOVE lt_intern-col TO ld_index.&lt;/P&gt;&lt;P&gt;     assign component ld_index of structure&lt;/P&gt;&lt;P&gt;     p_table to &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt; move : lt_intern-value to &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    MOVE lt_intern-value TO p_table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      AT END OF row.&lt;/P&gt;&lt;P&gt;        APPEND p_table.&lt;/P&gt;&lt;P&gt;        CLEAR p_table.&lt;/P&gt;&lt;P&gt;      ENDAT.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your valuable time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheng&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 18:29:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011840#M958537</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T18:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011841#M958538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The BAPI is documented. You should check that first. If you still have questions, get back to the forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 18:34:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011841#M958538</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T18:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011842#M958539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I understand from you and documentation is I need to pass the parameters (values from my internal table) to the function module. Then the function module will call and executes and updates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i am not sure whether it updates with the article no. and color code or not. I know you guys are master in this and would have done similiar kind of dev earlier. Since I am not sure of how to pass my internal table data to the funciton module can you please shed some light on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheng.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 18:44:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011842#M958539</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T18:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Insert or Modify statement from internal table to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011843#M958540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've never used this BAPI. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general, what I would do though, is to play around with it and see what it does. If you don't do a COMMIT afterwards, things tend not to be updated, so you can't do much damage. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 20:30:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-or-modify-statement-from-internal-table-to-database-table/m-p/4011843#M958540</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T20:30:03Z</dc:date>
    </item>
  </channel>
</rss>

