<?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: Data transfer Code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-transfer-code/m-p/2053436#M423635</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 don't know if there's a function to transfer the data, but you can create something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES: TAB1, TAB2.

DATA: BEGIN OF T_MAPPING OCCURS 0,
             FROM_FIELD(30),
             TO_FIELD(30),
          END     OF T_MAPPING.

FIELD-SYMBOLS: &amp;lt;FROM&amp;gt; TYPE ANY,
                            &amp;lt;TO&amp;gt;      TYPE ANY.

DATA: ITAB1 LIKE STANDARD TABLE OF TAB1,
           ITAB2 LIKE STANDARD TABLE OF TAB2.



SELECT * FROM TAB1 INTO TABLE ITAB1.

LOOP AT ITAB1 INTO TAB1.
  LOOP AT T_MAPPING.
     ASSIGN COMPONENT T_MAPPING-FROM_FIELD OF STRUCTURE TAB1 TO &amp;lt;FROM&amp;gt;.
    IF SY-SUBRC = 0.
       ASSIGN COMPONENT T_MAPPING-TO_FIELD OF STRUCTURE TAB2 TO &amp;lt;TO&amp;gt;.
      IF SY-SUBRC = 0.
        &amp;lt;TO&amp;gt; = &amp;lt;FROM&amp;gt;
      ENDIF.
    ENDIF.
  ENDLOOP.
  APPEND TAB2 TO ITAB2.
ENDLOOP.

INSERT TAB2 FROM TABLE ITAB2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To transfer the data from two systems, it depends on the systems, in generally the RFC function module has to be in the called system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Mar 2007 20:08:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-20T20:08:34Z</dc:date>
    <item>
      <title>Data transfer Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-transfer-code/m-p/2053435#M423634</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;Could some one help me with a standard code which will have following functionalities.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Move data from one table to other (structures might be same or diff)&lt;/P&gt;&lt;P&gt;      Mapping fields will be stored in a seperate control table&lt;/P&gt;&lt;P&gt;2. Data might be moved between two systems by doing a RFC connection.&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;I would be happy if the point 1 is covered. we can go to point 2 later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Mey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 19:46:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-transfer-code/m-p/2053435#M423634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T19:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Data transfer Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-transfer-code/m-p/2053436#M423635</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 don't know if there's a function to transfer the data, but you can create something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES: TAB1, TAB2.

DATA: BEGIN OF T_MAPPING OCCURS 0,
             FROM_FIELD(30),
             TO_FIELD(30),
          END     OF T_MAPPING.

FIELD-SYMBOLS: &amp;lt;FROM&amp;gt; TYPE ANY,
                            &amp;lt;TO&amp;gt;      TYPE ANY.

DATA: ITAB1 LIKE STANDARD TABLE OF TAB1,
           ITAB2 LIKE STANDARD TABLE OF TAB2.



SELECT * FROM TAB1 INTO TABLE ITAB1.

LOOP AT ITAB1 INTO TAB1.
  LOOP AT T_MAPPING.
     ASSIGN COMPONENT T_MAPPING-FROM_FIELD OF STRUCTURE TAB1 TO &amp;lt;FROM&amp;gt;.
    IF SY-SUBRC = 0.
       ASSIGN COMPONENT T_MAPPING-TO_FIELD OF STRUCTURE TAB2 TO &amp;lt;TO&amp;gt;.
      IF SY-SUBRC = 0.
        &amp;lt;TO&amp;gt; = &amp;lt;FROM&amp;gt;
      ENDIF.
    ENDIF.
  ENDLOOP.
  APPEND TAB2 TO ITAB2.
ENDLOOP.

INSERT TAB2 FROM TABLE ITAB2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To transfer the data from two systems, it depends on the systems, in generally the RFC function module has to be in the called system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 20:08:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-transfer-code/m-p/2053436#M423635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T20:08:34Z</dc:date>
    </item>
  </channel>
</rss>

