<?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 Insert data from Standard  DBtable  to another DBTtable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185079#M1980164</link>
    <description>&lt;P&gt;Hello All,&lt;/P&gt;
  &lt;P&gt;I need to insert data from 2 Standards Tables (KNA1 &amp;amp; adrc) to a ZDBTable.&lt;/P&gt;
  &lt;P&gt;zdbtable has just 4 columns (3 from kna1 and 1 from adrc).&lt;/P&gt;
  &lt;P&gt;I need to know what is the recommended way. Using Internal tables with or without header...&lt;/P&gt;
  &lt;P&gt;PS: I'm a beginner on ABAP.&lt;/P&gt;
  &lt;P&gt;thanks all.&lt;/P&gt;</description>
    <pubDate>Sat, 11 Apr 2020 10:58:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2020-04-11T10:58:59Z</dc:date>
    <item>
      <title>Insert data from Standard  DBtable  to another DBTtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185079#M1980164</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;
  &lt;P&gt;I need to insert data from 2 Standards Tables (KNA1 &amp;amp; adrc) to a ZDBTable.&lt;/P&gt;
  &lt;P&gt;zdbtable has just 4 columns (3 from kna1 and 1 from adrc).&lt;/P&gt;
  &lt;P&gt;I need to know what is the recommended way. Using Internal tables with or without header...&lt;/P&gt;
  &lt;P&gt;PS: I'm a beginner on ABAP.&lt;/P&gt;
  &lt;P&gt;thanks all.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 10:58:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185079#M1980164</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-04-11T10:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Insert data from Standard  DBtable  to another DBTtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185080#M1980165</link>
      <description>&lt;P&gt;Header lines are obsolete (anyway, you should code using ABAP Objects, header lines are not permitted in classes)&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 11:09:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185080#M1980165</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-04-11T11:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Insert data from Standard  DBtable  to another DBTtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185081#M1980166</link>
      <description>&lt;P&gt;Thanks Rossi, Can you plz show me the steps ?&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 11:13:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185081#M1980166</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-04-11T11:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Insert data from Standard  DBtable  to another DBTtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185082#M1980167</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You could use a selection like this (adapt to your own needs):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT c~kunnr, c~name1, a~country
  FROM kna1 as c
  INNER JOIN adrc AS a ON a~addrnumber = c~adrnr
  INTO TABLE @DATA(lt_customer_data)
  WHERE a~date_from &amp;lt;= @sy-datum
  AND a~date_to &amp;gt;= @sy-datum.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I wouldn't suggest to copy this data to a new z-table, because you'll be storing data twice (and you'll probably run into discrepancies between the actual data and your z-table.&lt;/P&gt;&lt;P&gt;If the only reason you're creating the separate z-table is ease of access to the data, I would suggest to create either a database view or a CDS-view (if you have CDS available, this is the best way). In this way you'll not be storing the data twice, you won't have to worry about discrepancies and you can easily access the data you need. (you can use the selection above to create the view)&lt;/P&gt;&lt;P&gt;If you're going to read data into internal tables, you shouldn't be using header lines anymore since those are obsolete.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Geert-Jan Klaps&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 11:24:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185082#M1980167</guid>
      <dc:creator>geert-janklaps</dc:creator>
      <dc:date>2020-04-11T11:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Insert data from Standard  DBtable  to another DBTtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185083#M1980168</link>
      <description>&lt;P&gt;Hi Jan,&lt;/P&gt;&lt;P&gt;What I should put in "@DATA(lt_customer_data)" ?&lt;/P&gt;&lt;P&gt;it is a line type of ztable ? like this :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;types:  begin of line_type,
          client      like ztclient99-client,
          client_id   like ztclient99-client_id,
          name_last   like ztclient99-name_last,
          name_first  like ztclient99-name_first,
          addrnumber  like ztclient99-addrnumber,
        end of line_type.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Apr 2020 12:13:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185083#M1980168</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-04-11T12:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Insert data from Standard  DBtable  to another DBTtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185084#M1980169</link>
      <description>&lt;P&gt;If your system doesn't support the inline data declarations you'll have to do something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;types: begin of line_type,
  kunnr like kna1-kunnr,
  name1 like kna1-name1,
  country like adrc-country,
end of line_type.

DATA: lt_customer_data TYPE TABLE OF line_type.

SELECT c~kunnr c~name1 a~country
  FROM kna1 as c
  INNER JOIN adrc AS a ON a~addrnumber = c~adrnr
  INTO TABLE lt_customer_data
  WHERE a~date_from &amp;lt;= sy-datum
  AND a~date_to &amp;gt;= sy-datum.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Apr 2020 12:34:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185084#M1980169</guid>
      <dc:creator>geert-janklaps</dc:creator>
      <dc:date>2020-04-11T12:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Insert data from Standard  DBtable  to another DBTtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185085#M1980170</link>
      <description>&lt;P&gt;Dear Khalil&lt;/P&gt;&lt;P&gt;I assume your table is Ztclient99.  And I assume you copy records based on selection criteria of Customer code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;types:  begin of line_type,
          client      like ztclient99-client,
          client_id   like ztclient99-client_id,
          name_last   like ztclient99-name_last,
          name_first  like ztclient99-name_first,
          addrnumber  like ztclient99-addrnumber,
        end of line_type.

DATA : it_data type stndard table of ztclient99,
       wa_data type ztclient99.

"get range of customers from the selection screen in s_kunnr.

SELECT A~KUNNR AS 'CLIENT_ID', A~NAME1 AS 'NAME_LAST', A~NAME2 AS 'NAME_FIRST', B~ADRNR AS 'ADDRNUMBER'
FROM KNA1 AS A 
INNER JOIN ADRC AS B ON a~addrnumber = B~adrnr
INTO CORRESPONDING FIELDS OF TABLE IT_DATA
WHERE A~KUNNR IN S_KUNNR.

"SAVE DATA IN TABLE
IF IT_DATA[] IS NOT INITIAL.
MODIFY ztclient99 FROM TABLE IT_DATA.
ENDIF.
 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Apr 2020 12:37:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185085#M1980170</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2020-04-11T12:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Insert data from Standard  DBtable  to another DBTtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185086#M1980171</link>
      <description>&lt;P&gt;This is my code, It works but i get a warning :&lt;/P&gt;&lt;P&gt;The work area "LT_CLIENT99" has more fields than selected.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:  lt_client99 type table of ztclient99.

select k~kunnr as client_id k~name1 as name_last k~name2 as name_first a~addrnumber as addrnumber
  up to 220 rows
  from kna1 as k
  inner join adrc as a
  on a~addrnumber = k~adrnr
  into corresponding fields of table lt_client99
  where a~addrnumber = k~adrnr.

if sy-subrc = 0.
  insert ztclient99 from table lt_client99.
endif.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Apr 2020 12:50:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185086#M1980171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-04-11T12:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Insert data from Standard  DBtable  to another DBTtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185087#M1980172</link>
      <description>&lt;P&gt;Guess why you get the warning:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;The work area "LT_CLIENT99" has more fields than selected.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Look at the number of columns of database table ZTCLIENT99, and compare with the 4 columns you indicate after "select". &lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 13:43:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185087#M1980172</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-04-11T13:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Insert data from Standard  DBtable  to another DBTtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185088#M1980173</link>
      <description>&lt;P&gt;Solution 1: SELECT and INSERT.&lt;/P&gt;&lt;P&gt;Solution 2 from ABAP 7.50: INSERT ... FROM ( SELECT ... )&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 13:45:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185088#M1980173</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-04-11T13:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Insert data from Standard  DBtable  to another DBTtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185089#M1980174</link>
      <description>&lt;P&gt;The only column is mandt.&lt;/P&gt;&lt;P&gt;Should add it in the "select" ?&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 13:48:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185089#M1980174</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-04-11T13:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Insert data from Standard  DBtable  to another DBTtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185090#M1980175</link>
      <description>&lt;P&gt;Use a view. Why replicated the data? You only have to keep it up to date. A view is always up to date.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 14:30:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-data-from-standard-dbtable-to-another-dbttable/m-p/12185090#M1980175</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2020-04-11T14:30:10Z</dc:date>
    </item>
  </channel>
</rss>

