<?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: Move Corresponding Fields in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188344#M1374237</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the answers Vikranth and Venkat...  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Venkat,&lt;/P&gt;&lt;P&gt;This will not work out for me as i cannot declare a structure inside another structure in my case and that too i want field values to move into fields starting with 'ZZ_', this cannot happen in the case you have suggested&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 19 Sep 2009 13:17:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-19T13:17:46Z</dc:date>
    <item>
      <title>Move Corresponding Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188340#M1374233</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 would like to move fields from a structure that has the following fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Struc1 type table1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields:&lt;/P&gt;&lt;P&gt;BUKRS&lt;/P&gt;&lt;P&gt;WAERS&lt;/P&gt;&lt;P&gt;MENGE....&lt;/P&gt;&lt;P&gt;(similarly another 50 such fields)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;into another structure that has following fields,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Struc2 type table2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields:&lt;/P&gt;&lt;P&gt;ZZ_WAERS&lt;/P&gt;&lt;P&gt;ZZ_MENGE&lt;/P&gt;&lt;P&gt;ZZ_BUKRS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data elements linked to the fields in both the structures would be the same. Move-Corresponding will not work as the field names do not match... also the order of the fields in both the structures do not match&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the easiest way to do this task other than moving each field one at a time? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I apply any field symbols concept here... please let me know&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Sep 2009 06:22:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188340#M1374233</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-19T06:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Move Corresponding Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188341#M1374234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well i was wrong i just tested and even i was not successfull with different field names but same type. Thanks for correcting me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vikranth.Reddy on Sep 19, 2009 2:39 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Sep 2009 06:54:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188341#M1374234</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-19T06:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Move Corresponding Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188342#M1374235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;Hi Grame, 
&amp;lt;li&amp;gt;You are right. Data is not passed between those structures until you find similar fields not data elements for the fields. If you use &lt;STRONG&gt;MOVE-CORRESPONDING&lt;/STRONG&gt; fields must be matched to pass data between the structure fields
&amp;lt;li&amp;gt; I tried with the below example. Unsuccessful. 
&lt;PRE&gt;&lt;CODE&gt;REPORT ZTEST_NOTEPAD.
DATA: BEGIN OF IT_T100 OCCURS 0,
        SPRSL TYPE T100-SPRSL,
        ARBGB TYPE T100-ARBGB,
        MSGNR TYPE T100-MSGNR,
        TEXT  TYPE T100-TEXT,
      END OF IT_T100.

DATA: BEGIN OF IT_ZT100 OCCURS 0,
        ZZ_SPRSL TYPE T100-SPRSL,
        ZZ_ARBGB TYPE T100-ARBGB,
        ZZ_MSGNR TYPE T100-MSGNR,
        ZZ_TEXT  TYPE T100-TEXT,
      END OF IT_ZT100.

START-OF-SELECTION.
  SELECT * FROM T100 INTO TABLE IT_T100 UP TO 20 ROWS WHERE SPRSL = SY-LANGU.
  LOOP AT IT_T100.
    MOVE-CORRESPONDING IT_T100 TO IT_ZT100.
    APPEND IT_ZT100.
    CLEAR  IT_ZT100.
  ENDLOOP.
  LOOP AT IT_ZT100.
    WRITE:/  IT_ZT100-ZZ_SPRSL,
             IT_ZT100-ZZ_ARBGB,
             IT_ZT100-ZZ_MSGNR,
             IT_ZT100-ZZ_TEXT.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;
&amp;lt;li&amp;gt;The best is to pass field by field like below
&lt;PRE&gt;&lt;CODE&gt;
  LOOP AT IT_T100.
    IT_ZT100-ZZ_SPRSL = IT_T100-SPRSL.
    IT_ZT100-ZZ_ARBGB = IT_T100-ARBGB.
    IT_ZT100-ZZ_MSGNR = IT_T100-MSGNR.
    IT_ZT100-ZZ_TEXT  = IT_T100-TEXT.
    APPEND IT_ZT100.
    CLEAR  IT_ZT100.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;

Thanks
Venkat.O&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Sep 2009 09:00:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188342#M1374235</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2009-09-19T09:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Move Corresponding Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188343#M1374236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;Hi Grame, 
&amp;lt;li&amp;gt;I got an idea of having deep structure so that you can use move-corresponding more effectively.
&amp;lt;li&amp;gt;Try this way.
&lt;PRE&gt;&lt;CODE&gt;
REPORT ZTEST_NOTEPAD.
TYPES: BEGIN OF TY_T100,
        SPRSL TYPE T100-SPRSL,
        ARBGB TYPE T100-ARBGB,
        MSGNR TYPE T100-MSGNR,
        TEXT  TYPE T100-TEXT,
      END OF TY_T100.
TYPES: BEGIN OF TY_ZT100.
TYPES:  TY_T100 TYPE TY_T100,
        MATNR   TYPE MARC-MATNR,
        WERKS   TYPE MARC-WERKS,
        MINBE   TYPE MARC-MINBE,
        EISBE   TYPE MARC-EISBE,
      END OF TY_ZT100.

DATA:WA_T100  TYPE TY_T100,
     WA_ZT100 TYPE TY_ZT100.
DATA:IT_T100  TYPE STANDARD TABLE OF TY_T100,
     IT_ZT100 TYPE STANDARD TABLE OF TY_ZT100.

START-OF-SELECTION.
  SELECT * FROM T100 INTO TABLE IT_T100 UP TO 20 ROWS WHERE SPRSL = SY-LANGU.
  LOOP AT IT_T100 INTO WA_T100.
    MOVE-CORRESPONDING WA_T100 TO WA_ZT100-TY_T100.
    APPEND WA_ZT100 TO IT_ZT100.
    CLEAR  WA_ZT100.
  ENDLOOP.

  LOOP AT IT_ZT100 INTO WA_ZT100.
    WRITE:/  WA_ZT100-TY_T100-SPRSL,
             WA_ZT100-TY_T100-ARBGB,
             WA_ZT100-TY_T100-MSGNR,
             WA_ZT100-TY_T100-TEXT.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;
Thanks
Venkat.O&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Sep 2009 09:21:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188343#M1374236</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2009-09-19T09:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Move Corresponding Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188344#M1374237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the answers Vikranth and Venkat...  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Venkat,&lt;/P&gt;&lt;P&gt;This will not work out for me as i cannot declare a structure inside another structure in my case and that too i want field values to move into fields starting with 'ZZ_', this cannot happen in the case you have suggested&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Sep 2009 13:17:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188344#M1374237</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-19T13:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Move Corresponding Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188345#M1374238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Grame,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want to create a generic solution, you can use RTTI Runtime Type Information to determine the datatype of the components in both structures. Then you could create assignments for equal types in source and target structure.&lt;/P&gt;&lt;P&gt;This could work as long as you do not have more than one component of the same data type (data element) in the structures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FIELD-SYMBOLS:
    &amp;lt;data1&amp;gt; TYPE ANY,
    &amp;lt;data2&amp;gt; TYPE ANY.
  DATA:
    lo_typedescr1 TYPE REF TO cl_abap_typedescr,
    lo_typedescr2 TYPE REF TO cl_abap_typedescr.

  DO.
    ASSIGN COMPONENT sy-index OF STRUCTURE itab1 TO &amp;lt;data1&amp;gt;.
    IF sy-subrc NE 0.
      EXIT.
    ELSE.
      DO.
        ASSIGN COMPONENT sy-index OF STRUCTURE itab2 TO &amp;lt;data2&amp;gt;.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          lo_typedescr1 = cl_abap_typedescr=&amp;gt;describe_by_data( &amp;lt;data1&amp;gt; ).
          lo_typedescr2 = cl_abap_typedescr=&amp;gt;describe_by_data( &amp;lt;data2&amp;gt; ).
          IF lo_typedescr1 =  lo_typedescr2.
            &amp;lt;data2&amp;gt; = &amp;lt;data1&amp;gt;.
          ENDIF.
        ENDDO.
      ENDIF.
    ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some doubts about performance if you do this for every table line. It will be better to do it once, keep the results in some kind of internal assignment table and use it in the loop. For this I don't write the code, thats your homework &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Sep 2009 13:55:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188345#M1374238</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2009-09-19T13:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Move Corresponding Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188346#M1374239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's cool dude, that worked&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Sep 2009 15:47:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188346#M1374239</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-19T15:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Move Corresponding Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188347#M1374240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Grame, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;even this thread is solved by Clemens' pretty nice solution, there are not only doubts regarding the performance (as he mentioned) but also regarding the correctness!! When you are using n different fields (in a structure) with exactly n different field types, then Clemens' method works. Let us assume your structure has some fields with the SAME type (e.g. CHAR(4)) then all these target fields will be populated by the same source field. My recommendation: For a 100% accuracy you have to adjust the field names in the source and target structure or you have to move field by field. In the case the are no type-duplicates you can use Clemens. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck, &lt;/P&gt;&lt;P&gt;Heinz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Sep 2009 22:45:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188347#M1374240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-19T22:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Move Corresponding Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188348#M1374241</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;Our project also has some requiremtn like this  and we have developed our own piece of code to achieve this.&lt;/P&gt;&lt;P&gt;In our project we call SD condition technique to determine Rate and Final Commission in fields like KWERT and then finally we move the results back to Application Specific fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To achieve this we use a concept termed as 'Copy Services', in this we maintain following set of customizing -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) Source Structure - Target Structure&lt;/P&gt;&lt;P&gt;b) Fields to Map from Source Structure to Target Structure &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then at runtime we read this customizing and move data from SD  fields to our application fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this idea can help you achieve ur desired functionality in more generic way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Manas Dua&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Sep 2009 06:25:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188348#M1374241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-20T06:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Move Corresponding Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188349#M1374242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helo Heinz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for repeating and elaborating on what I said:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"This could work as long as you do not have more than one component of the same data type (data element) in the structures."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Sep 2009 08:04:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188349#M1374242</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2009-09-20T08:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Move Corresponding Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188350#M1374243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Heinz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right, perfomance wise the approach is not right and also in cases where two fields have the same description the approach may create anomalies&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 13:57:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding-fields/m-p/6188350#M1374243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-25T13:57:45Z</dc:date>
    </item>
  </channel>
</rss>

