<?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: copy data from dynamic internal table to another dynamic internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-data-from-dynamic-internal-table-to-another-dynamic-internal-table/m-p/1854963#M361628</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priya,&lt;/P&gt;&lt;P&gt; U need to create a line type of second internal table. Check this program. Check the code in bold.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  YDYNAMIC                                .&lt;/P&gt;&lt;P&gt;data : it_fcat type lvc_t_fcat.&lt;/P&gt;&lt;P&gt;data : new_table type ref to data.&lt;/P&gt;&lt;P&gt;field-symbols : &amp;lt;i_tab&amp;gt; type standard table,&lt;/P&gt;&lt;P&gt;                &amp;lt;i_tab1&amp;gt; type standard table,&lt;/P&gt;&lt;P&gt;                &amp;lt;i_line&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                &amp;lt;i_line1&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                &amp;lt;fs&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                &amp;lt;fs1&amp;gt; type any.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   I_STRUCTURE_NAME             = 'VBAK'&lt;/P&gt;&lt;P&gt;  CHANGING&lt;/P&gt;&lt;P&gt;    ct_fieldcat                  = it_fcat&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   INCONSISTENT_INTERFACE       = 1&lt;/P&gt;&lt;P&gt;   PROGRAM_ERROR                = 2&lt;/P&gt;&lt;P&gt;   OTHERS                       = 3&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    it_fieldcatalog           = it_fcat[]&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    EP_TABLE                  = new_table&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    GENERATE_SUBPOOL_DIR_FULL = 1&lt;/P&gt;&lt;P&gt;    others                    = 2&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign new_table-&amp;gt;* to &amp;lt;i_tab&amp;gt;.&lt;/P&gt;&lt;P&gt;clear new_table.&lt;/P&gt;&lt;P&gt;CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    it_fieldcatalog           = it_fcat[]&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    EP_TABLE                  = new_table&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    GENERATE_SUBPOOL_DIR_FULL = 1&lt;/P&gt;&lt;P&gt;    others                    = 2&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;assign new_table-&amp;gt;* to &amp;lt;i_tab1&amp;gt;.&lt;/P&gt;&lt;P&gt;select * from vbak into table &amp;lt;i_tab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;data : tdref TYPE REF TO data.&lt;/P&gt;&lt;P&gt;CREATE DATA tdref LIKE LINE OF &amp;lt;i_tab1&amp;gt;.&lt;/P&gt;&lt;P&gt;assign tdref-&amp;gt;* to &amp;lt;i_line1&amp;gt;.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;loop at &amp;lt;i_tab&amp;gt; assigning &amp;lt;i_line&amp;gt;.&lt;/P&gt;&lt;P&gt; assign component 'VBELN' of structure &amp;lt;i_line&amp;gt; to &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt; assign component 'VBELN' of structure &amp;lt;i_line1&amp;gt; to &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt; &amp;lt;fs1&amp;gt; = &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt; append &amp;lt;i_line1&amp;gt; to &amp;lt;i_tab1&amp;gt;.&lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-SatyaPriya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Feb 2007 04:31:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-01T04:31:24Z</dc:date>
    <item>
      <title>copy data from dynamic internal table to another dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-data-from-dynamic-internal-table-to-another-dynamic-internal-table/m-p/1854961#M361626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi! can some one help me how i move data from one dynamic internal table to another dynamic internal table. structures are different. dyn_table1 has only one field and dyn_table2 has 3 fields but both have one field in common. i  want to populate that common field in dyn_itab2 from dyn_itab1.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt; dyn_itab1                             dyn_ itab2&lt;/P&gt;&lt;P&gt; field3                              field1 field2 field3 field4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i did  assign component 1 of structure &amp;lt;dyn_table0&amp;gt; to &amp;lt;dyn_table&amp;gt;. &lt;/P&gt;&lt;P&gt;got sy-subrc '4'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2007 01:55:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copy-data-from-dynamic-internal-table-to-another-dynamic-internal-table/m-p/1854961#M361626</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-01T01:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: copy data from dynamic internal table to another dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-data-from-dynamic-internal-table-to-another-dynamic-internal-table/m-p/1854962#M361627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;       You need to loop through one table and then populate the other table as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;dyn_table0&amp;gt; ASSIGNING &amp;lt;dyn_table_line&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;dyn_table1&amp;gt; INDEX sy-tabix ASSIGNING &amp;lt;dyn_table1_line&amp;gt;.&lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT 1 OF STRUCTURE &amp;lt;dyn_table_line&amp;gt; to &amp;lt;fs_1&amp;gt;.&lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT 1 OF STRUCTURE &amp;lt;dyn_table1_line&amp;gt; to &amp;lt;fs_2&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;lt;fs_1&amp;gt; = &amp;lt;fs_2&amp;gt;.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2007 04:00:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copy-data-from-dynamic-internal-table-to-another-dynamic-internal-table/m-p/1854962#M361627</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-02-01T04:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: copy data from dynamic internal table to another dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-data-from-dynamic-internal-table-to-another-dynamic-internal-table/m-p/1854963#M361628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priya,&lt;/P&gt;&lt;P&gt; U need to create a line type of second internal table. Check this program. Check the code in bold.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  YDYNAMIC                                .&lt;/P&gt;&lt;P&gt;data : it_fcat type lvc_t_fcat.&lt;/P&gt;&lt;P&gt;data : new_table type ref to data.&lt;/P&gt;&lt;P&gt;field-symbols : &amp;lt;i_tab&amp;gt; type standard table,&lt;/P&gt;&lt;P&gt;                &amp;lt;i_tab1&amp;gt; type standard table,&lt;/P&gt;&lt;P&gt;                &amp;lt;i_line&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                &amp;lt;i_line1&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                &amp;lt;fs&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                &amp;lt;fs1&amp;gt; type any.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   I_STRUCTURE_NAME             = 'VBAK'&lt;/P&gt;&lt;P&gt;  CHANGING&lt;/P&gt;&lt;P&gt;    ct_fieldcat                  = it_fcat&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   INCONSISTENT_INTERFACE       = 1&lt;/P&gt;&lt;P&gt;   PROGRAM_ERROR                = 2&lt;/P&gt;&lt;P&gt;   OTHERS                       = 3&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    it_fieldcatalog           = it_fcat[]&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    EP_TABLE                  = new_table&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    GENERATE_SUBPOOL_DIR_FULL = 1&lt;/P&gt;&lt;P&gt;    others                    = 2&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign new_table-&amp;gt;* to &amp;lt;i_tab&amp;gt;.&lt;/P&gt;&lt;P&gt;clear new_table.&lt;/P&gt;&lt;P&gt;CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    it_fieldcatalog           = it_fcat[]&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    EP_TABLE                  = new_table&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    GENERATE_SUBPOOL_DIR_FULL = 1&lt;/P&gt;&lt;P&gt;    others                    = 2&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;assign new_table-&amp;gt;* to &amp;lt;i_tab1&amp;gt;.&lt;/P&gt;&lt;P&gt;select * from vbak into table &amp;lt;i_tab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;data : tdref TYPE REF TO data.&lt;/P&gt;&lt;P&gt;CREATE DATA tdref LIKE LINE OF &amp;lt;i_tab1&amp;gt;.&lt;/P&gt;&lt;P&gt;assign tdref-&amp;gt;* to &amp;lt;i_line1&amp;gt;.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;loop at &amp;lt;i_tab&amp;gt; assigning &amp;lt;i_line&amp;gt;.&lt;/P&gt;&lt;P&gt; assign component 'VBELN' of structure &amp;lt;i_line&amp;gt; to &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt; assign component 'VBELN' of structure &amp;lt;i_line1&amp;gt; to &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt; &amp;lt;fs1&amp;gt; = &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt; append &amp;lt;i_line1&amp;gt; to &amp;lt;i_tab1&amp;gt;.&lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-SatyaPriya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2007 04:31:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copy-data-from-dynamic-internal-table-to-another-dynamic-internal-table/m-p/1854963#M361628</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-01T04:31:24Z</dc:date>
    </item>
  </channel>
</rss>

