<?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: [ECC6] Inserting data from internal table (deep structure) into db table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/ecc6-inserting-data-from-internal-table-deep-structure-into-db-table/m-p/5555793#M1268058</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;Check the below code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF t_screen OCCURS 0,
        rec_count(3) TYPE n,
        col1 LIKE ZTest-col1,
        col2 LIKE ZTest-col2.
DATA: ct TYPE lvc_t_scol.
DATA: END   OF t_screen.
 
DATA  it_ct TYPE lvc_t_scol,
           ct_line LIKE LINE OF it_ct.

ct_line-FNAME = 'FNAME1'.
ct_line-color  = 'COLOR1'.
APPEND CT_linE to IT_CT.

ct_line-FNAME = 'FNAME2'.
ct_line-color  = 'COLOR2'.
APPEND CT_linE to IT_CT.

t_screen-col1 = 'test1'.
t_screen-col2 = 'test1'.
t_screen-ct[] = IT_CT[].
APPEND t_screen.

REFRESH IT_CT.

ct_line-FNAME = 'FNAME3'.
ct_line-color  = 'COLOR3'.
APPEND CT_linE to IT_CT.

ct_line-FNAME = 'FNAME4'.
ct_line-color  = 'COLOR4'.
APPEND CT_linE to IT_CT.
 
t_screen-col1 = 'test2'.
t_screen-col2 = 'test2'.
t_screen-ct[] = IT_CT[].
APPEND t_screen.
 
INSERT ZTest FROM TABLE t_screen ACCEPTING DUPLICATE KEYS.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 May 2009 09:58:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-13T09:58:25Z</dc:date>
    <item>
      <title>[ECC6] Inserting data from internal table (deep structure) into db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ecc6-inserting-data-from-internal-table-deep-structure-into-db-table/m-p/5555792#M1268057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem when inserting data from IT using deep structure into a database table. Please help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one database table with 2 columns &lt;STRONG&gt;ZTest (col1, col2)&lt;/STRONG&gt;. Col1 is key.&lt;/P&gt;&lt;P&gt;In my program I have a deep structure &lt;STRONG&gt;t_screen&lt;/STRONG&gt; using table type &lt;STRONG&gt;lvc_t_scol&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;In 4.6c systems, the INSERT statement works well but it does not work in ECC6 systems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: BEGIN OF t_screen OCCURS 0,
        rec_count(3) TYPE n,
        col1 LIKE ZTest-col1,
        col2 LIKE ZTest-col2.
DATA: ct TYPE lvc_t_scol.
DATA: END   OF t_screen.
&amp;nbsp;
t_screen-col1 = 'test1'.
t_screen-col2 = 'test1'.
APPEND t_screen.
&amp;nbsp;
t_screen-col1 = 'test2'.
t_screen-col2 = 'test2'.
APPEND t_screen.
&amp;nbsp;
INSERT ZTest FROM TABLE t_screen ACCEPTING DUPLICATE KEYS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I have an idea using a temporary internal table with the same structure as ZTest. Use MOVE-CORRESPONDING statement to move data from t_screen table to temporary table before inserting --&amp;gt; It worked. But do you have any ideas without using temporary table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 09:49:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ecc6-inserting-data-from-internal-table-deep-structure-into-db-table/m-p/5555792#M1268057</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T09:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: [ECC6] Inserting data from internal table (deep structure) into db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ecc6-inserting-data-from-internal-table-deep-structure-into-db-table/m-p/5555793#M1268058</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;Check the below code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF t_screen OCCURS 0,
        rec_count(3) TYPE n,
        col1 LIKE ZTest-col1,
        col2 LIKE ZTest-col2.
DATA: ct TYPE lvc_t_scol.
DATA: END   OF t_screen.
 
DATA  it_ct TYPE lvc_t_scol,
           ct_line LIKE LINE OF it_ct.

ct_line-FNAME = 'FNAME1'.
ct_line-color  = 'COLOR1'.
APPEND CT_linE to IT_CT.

ct_line-FNAME = 'FNAME2'.
ct_line-color  = 'COLOR2'.
APPEND CT_linE to IT_CT.

t_screen-col1 = 'test1'.
t_screen-col2 = 'test1'.
t_screen-ct[] = IT_CT[].
APPEND t_screen.

REFRESH IT_CT.

ct_line-FNAME = 'FNAME3'.
ct_line-color  = 'COLOR3'.
APPEND CT_linE to IT_CT.

ct_line-FNAME = 'FNAME4'.
ct_line-color  = 'COLOR4'.
APPEND CT_linE to IT_CT.
 
t_screen-col1 = 'test2'.
t_screen-col2 = 'test2'.
t_screen-ct[] = IT_CT[].
APPEND t_screen.
 
INSERT ZTest FROM TABLE t_screen ACCEPTING DUPLICATE KEYS.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 09:58:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ecc6-inserting-data-from-internal-table-deep-structure-into-db-table/m-p/5555793#M1268058</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T09:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: [ECC6] Inserting data from internal table (deep structure) into db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ecc6-inserting-data-from-internal-table-deep-structure-into-db-table/m-p/5555794#M1268059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kodarapu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is not because of lacking sample data.&lt;/P&gt;&lt;P&gt;The problem is syntax error when I compile the following code in ECC6 system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INSERT ZTest FROM TABLE t_screen ACCEPTING DUPLICATE KEYS.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message as follow:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The work area (or internal table) "T_SCREEN" is not flat, or contains reference or internal tables as components. components. components. components. components.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for my unclear description.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Khanh Nguyen on May 13, 2009 12:14 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 10:08:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ecc6-inserting-data-from-internal-table-deep-structure-into-db-table/m-p/5555794#M1268059</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T10:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: [ECC6] Inserting data from internal table (deep structure) into db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ecc6-inserting-data-from-internal-table-deep-structure-into-db-table/m-p/5555795#M1268060</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;There are a large number of stataments couldn't be supported in unicode system and so it doesn't allow to do it in ECC 6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U need to delete the deep structure from your defination:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF t_screen OCCURS 0,
        rec_count(3) TYPE n,
        col1 LIKE ZTest-col1,
        col2 LIKE ZTest-col2.
DATA: ct TYPE lvc_t_scol. "&amp;lt;-------- Error is here
DATA: END   OF t_screen.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So u need to use a structure like this to update your table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF T_ZTEST OCCURS 0,
        rec_count(3) TYPE n,
        col1 LIKE ZTest-col1,
        col2 LIKE ZTest-col2.
DATA: END   OFT_ZTEST.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 10:20:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ecc6-inserting-data-from-internal-table-deep-structure-into-db-table/m-p/5555795#M1268060</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T10:20:57Z</dc:date>
    </item>
  </channel>
</rss>

