<?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 database tabel from internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368858#M808518</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can, but willl not suggest you to modify any standard DB table. You custom table is ok. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But remember to pass all the key fields while modifying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jayant Sahu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Feb 2008 14:26:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-07T14:26:10Z</dc:date>
    <item>
      <title>Modify database tabel from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368856#M808516</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 want to modify a z-table from an internal table. However the z-table has fewer columns hence I only want to write selected columns from my internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;LOOP AT IT_RECORD INTO WA_RECORD.&lt;/P&gt;&lt;P&gt;  MODIFY ZTEST FROM WA_RECORD.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not work the way I want because it writes to the wrong columns. Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 14:24:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368856#M808516</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T14:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Modify database tabel from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368857#M808517</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;use move-corresponding&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 14:25:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368857#M808517</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T14:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Modify database tabel from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368858#M808518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can, but willl not suggest you to modify any standard DB table. You custom table is ok. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But remember to pass all the key fields while modifying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jayant Sahu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 14:26:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368858#M808518</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T14:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Modify database tabel from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368859#M808519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: wa_ztest TYPE ztest.

LOOP AT IT_RECORD INTO WA_RECORD.
  MOVE-CORRESPONDING wa_record TO wa_ztest.
MODIFY ZTEST FROM wa_ztest.
ENDLOOP. &lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 14:27:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368859#M808519</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-02-07T14:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Modify database tabel from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368860#M808520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kulbir Paji&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it wil help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify itab_lcplanning from wa_struct &lt;STRONG&gt;transporting&lt;/STRONG&gt; tasstdate tasenddate&lt;/P&gt;&lt;P&gt;where phcode = wa_struct-phcode and wpcode = ' ' and actcode = ' ' and tascode = ' ' and&lt;/P&gt;&lt;P&gt;fitgapcd = ' ' and subtascd = ' ' and dlcode = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Feb 7, 2008 6:22 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 14:27:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368860#M808520</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T14:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Modify database tabel from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368861#M808521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;move corresponding will more &lt;/P&gt;&lt;P&gt;thnkkx&lt;/P&gt;&lt;P&gt;bhanu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 14:30:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368861#M808521</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T14:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Modify database tabel from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368862#M808522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT it_record INTO wa_record.
  UPDATE ztest
    SET zf1 = wa_record-f1
        zf2 = wa_record-f2
*       etc.
    WHERE key1 = wa_record-key1
      AND key2 = wa_record-key2.
*     AND etc.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 23:33:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368862#M808522</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T23:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Modify database tabel from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368863#M808523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't use update if the table is empty...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2008 08:22:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368863#M808523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-08T08:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Modify database tabel from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368864#M808524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the table is empty, it doesn't go through the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2008 14:40:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368864#M808524</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-08T14:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Modify database tabel from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368865#M808525</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 written a small programm which reads from the local csv&lt;/P&gt;&lt;P&gt;file and writes it first in the internal and then in the database table. I have not tried to write the record directly in the database table because in the db table i have used float datatypes and 'GUI_UPLOAD' function return only string.&lt;/P&gt;&lt;P&gt;The colums in the CSV file should not be separated through ; or , but should separated through &lt;A href="https://community.sap.com/TAB"&gt;&lt;/A&gt;. It can be achieved through macros or simply Replace function in most of the editors. so here is the Code. I hope it will be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CSV STRUCTURE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;...
4711	1	-0.113959745	-0.128854014	0.014869883
4711	2	0.229442479	-0.045338936	0.274622951
4711	3	0.424455196	0.575343255	-0.152001065
4711	4	0.967714968	0.938023954	0.030049754
4711	5	-0.239151217	-0.288232776	0.04890217
4711	6	-0.38852287	-0.390814502	0.00228029
4711	7	-0.64254495	-0.457956474	-0.183518857
4711	8	0.861369672	0.862771555	-0.001417447
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP CODE&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zfash_csvupload.

"Struktur zum einlesen einzelnen spalten von eine CSV datei.
"Datentyp müssen String sein.
TYPES: BEGIN OF typestr_csv_daten,
    geschfnr TYPE string,
    histotag TYPE string,
    bw_fx_zins TYPE string,
    bw_fx TYPE string,
    bw_zins TYPE string,
    END OF typestr_csv_daten.

"Struktur zum Konvertieren string in enstprechenden datentypen.
TYPES: BEGIN OF type_csv_daten,
    geschfnr TYPE i,
    histotag TYPE i,
    bw_fx_zins TYPE f,
    bw_fx TYPE f,
    bw_zins TYPE f,
    END OF type_csv_daten.


DATA it_csv_str TYPE TABLE OF typestr_csv_daten.
DATA wa_csv_str TYPE typestr_csv_daten.

DATA it_csv TYPE TABLE OF type_csv_daten.
DATA wa_csv TYPE type_csv_daten.

DATA wa_bw_fx_zins LIKE zfash_bw_fx_zins.




START-OF-SELECTION.
  " GUI_UPLOAD zum hochladen einer Datei. GUI_Download zum downloaden einer Datei.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
     filename                      = 'C:Testdaten2.csv' "CSV-datei kann auch .txt endung haben
     filetype                      = 'ASC'
     has_field_separator           = 'X' "Wenn X dann Separator in CSV muss vorhanden sein. Separator ist TABULAOR
*     HEADER_LENGTH                 = 50
*     READ_BY_LINE                  = 'X'
*     DAT_MODE                      = ' '
*     CODEPAGE                      = ' '
*     IGNORE_CERR                   = ABAP_TRUE
*     REPLACEMENT                   = '#'
*     CHECK_BOM                     = ' '
*     VIRUS_SCAN_PROFILE            =
*     NO_AUTH_CHECK                 = ' '
*   IMPORTING
*     FILELENGTH                    =
*     HEADER                        =
    TABLES
      data_tab                      = it_csv_str "interne tabelle wo csv daten geladen werden.
   EXCEPTIONS
     file_open_error               = 1
     file_read_error               = 2
     no_batch                      = 3
     gui_refuse_filetransfer       = 4
     invalid_type                  = 5
     no_authority                  = 6
     unknown_error                 = 7
     bad_data_format               = 8
     header_not_allowed            = 9
     separator_not_allowed         = 10
     header_too_long               = 11
     unknown_dp_error              = 12
     access_denied                 = 13
     dp_out_of_memory              = 14
     disk_full                     = 15
     dp_timeout                    = 16
     OTHERS                        = 17
            .
  "Prüfen ob alles gut gelaufen ist.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ELSE.

    LOOP AT it_csv_str INTO wa_csv_str.
      "Konvertierung lassen wir ABAP handeln :)
      wa_csv-geschfnr = wa_csv_str-geschfnr.
      wa_csv-histotag = wa_csv_str-histotag.
      wa_csv-bw_fx_zins = wa_csv_str-bw_fx_zins.
      wa_csv-bw_fx = wa_csv_str-bw_fx.
      wa_csv-bw_zins = wa_csv_str-bw_zins.
      "Working Area in interne Tabelle hinfügen.
      INSERT wa_csv INTO TABLE it_csv.
      MOVE-CORRESPONDING wa_csv TO wa_bw_fx_zins.
      MODIFY zfash_bw_fx_zins FROM wa_bw_fx_zins.
      WRITE: / wa_csv-geschfnr, ' ', wa_csv-histotag, ' ',
       wa_csv-bw_fx_zins, ' ', wa_csv-bw_fx, ' ', wa_csv-bw_zins.
    ENDLOOP.
  ENDIF.

END-OF-SELECTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2008 08:45:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-tabel-from-internal-table/m-p/3368865#M808525</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-26T08:45:58Z</dc:date>
    </item>
  </channel>
</rss>

