<?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: Help to update fields in local structure in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219517#M1378858</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are several approaches. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: wa_mara_old     TYPE mara,
      wa_mara_new     TYPE mara.
 
 
FIELD-SYMBOLS: &amp;lt;fs_old&amp;gt; TYPE any,
               &amp;lt;fs_new&amp;gt; TYPE any.
 
 
clear: wa_mara_old, wa_mara_new.
wa_mara_new-ersda = sy-datum.

SELECT * INTO wa_mara_old
  FROM mara
    UP TO 1 ROWS.
ENDSELECT.

  
DO.
 
  ASSIGN COMPONENT sy-index OF STRUCTURE wa_mara_old TO &amp;lt;fs_old&amp;gt;.
  IF sy-subrc NE 0.
    EXIT.
  ENDIF.
 
  ASSIGN COMPONENT sy-index OF STRUCTURE wa_mara_new TO &amp;lt;fs_new&amp;gt;.
if not &amp;lt;fs_new&amp;gt; is initial.
  IF &amp;lt;fs_old&amp;gt; NE &amp;lt;fs_new&amp;gt;.
    &amp;lt;fs_old&amp;gt; = &amp;lt;fs_new&amp;gt;.
  ENDIF.
endif.
 
ENDDO.

wa_mara_new = wa_mara_old.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Sep 2009 13:51:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-21T13:51:35Z</dc:date>
    <item>
      <title>Help to update fields in local structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219516#M1378857</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 need to update stru new with   new and old fieds .&lt;/P&gt;&lt;P&gt;the stru_new is coming with new fields before the select and can have just 2 or 3 fields to update what i want that stru new be like stru old but with the new fields in it .&lt;/P&gt;&lt;P&gt;i.e. if stru new is like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CARRID
CONNID	        0000
FLDATE	        00000000
PRICE	        1.00
CURRENCY
PLANETYPE	newvalue
SEATSMAX	0
SEATSOCC	0
PAYMENTSUM	0.00
SEATSMAX_B	0
SEATSOCC_B	0
SEATSMAX_F	0
SEATSOCC_F	0

and sutu old is like  



CARRID	        AC
CONNID	        0820
FLDATE	        20021220
PRICE	        1222.00
CURRENCY	CAD
PLANETYPE	A330-300
SEATSMAX	320
SEATSOCC	12
PAYMENTSUM	0.00
SEATSMAX_B	20
SEATSOCC_B	1
SEATSMAX_F	0
SEATSOCC_F	0

"i want in the end the stru new be like 



CARRID	         AC
CONNID	        0820
FLDATE	        20021220
PRICE	        1.00"update
CURRENCY	CAD
PLANETYPE	newvalue"update
SEATSMAX	320
SEATSOCC	12
PAYMENTSUM	0.00
SEATSMAX_B	20
SEATSOCC_B	1
SEATSMAX_F	0
SEATSOCC_F	0&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the placing on the code is just an example ,&lt;/P&gt;&lt;P&gt;it can be any fields taht change sometims it can be planetype and other time it can be 3 fields &lt;/P&gt;&lt;P&gt;like price seatmax etc &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is sample of the code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: sflight.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs_old&amp;gt;, &amp;lt;fs_new&amp;gt;.&lt;/P&gt;&lt;P&gt;DATA: stru_old TYPE sflight.&lt;/P&gt;&lt;P&gt;DATA: stru_new TYPE sflight.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;stru_new-planetype = 'newvaulue'.&lt;/P&gt;&lt;P&gt;stru_new-price = 1.&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM sflight INTO stru_old.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2009 13:44:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219516#M1378857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-21T13:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help to update fields in local structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219517#M1378858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are several approaches. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: wa_mara_old     TYPE mara,
      wa_mara_new     TYPE mara.
 
 
FIELD-SYMBOLS: &amp;lt;fs_old&amp;gt; TYPE any,
               &amp;lt;fs_new&amp;gt; TYPE any.
 
 
clear: wa_mara_old, wa_mara_new.
wa_mara_new-ersda = sy-datum.

SELECT * INTO wa_mara_old
  FROM mara
    UP TO 1 ROWS.
ENDSELECT.

  
DO.
 
  ASSIGN COMPONENT sy-index OF STRUCTURE wa_mara_old TO &amp;lt;fs_old&amp;gt;.
  IF sy-subrc NE 0.
    EXIT.
  ENDIF.
 
  ASSIGN COMPONENT sy-index OF STRUCTURE wa_mara_new TO &amp;lt;fs_new&amp;gt;.
if not &amp;lt;fs_new&amp;gt; is initial.
  IF &amp;lt;fs_old&amp;gt; NE &amp;lt;fs_new&amp;gt;.
    &amp;lt;fs_old&amp;gt; = &amp;lt;fs_new&amp;gt;.
  ENDIF.
endif.
 
ENDDO.

wa_mara_new = wa_mara_old.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2009 13:51:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219517#M1378858</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-21T13:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help to update fields in local structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219518#M1378859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alternatively:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DO.
 
  ASSIGN COMPONENT sy-index OF STRUCTURE wa_mara_old TO &amp;lt;fs_old&amp;gt;.
  IF sy-subrc NE 0.
    EXIT.
  ENDIF.
 
  ASSIGN COMPONENT sy-index OF STRUCTURE wa_mara_new TO &amp;lt;fs_new&amp;gt;.
  if &amp;lt;fs_new&amp;gt; is initial.
    &amp;lt;fs_new&amp;gt; = &amp;lt;fs_old&amp;gt;.
  endif.
 
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2009 13:55:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219518#M1378859</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-21T13:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help to update fields in local structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219519#M1378860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use inital like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 1000 TIMES.&lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT sy-index OF STRUCTURE stru_old TO &amp;lt;fs_old&amp;gt;.&lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT sy-index OF STRUCTURE stru_new TO &amp;lt;fs_new&amp;gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;IF &amp;lt;fs_new&amp;gt; is initial.&lt;/P&gt;&lt;P&gt;&amp;lt;fs_new&amp;gt; = &amp;lt;fs_old&amp;gt;.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2009 14:06:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219519#M1378860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-21T14:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help to update fields in local structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219520#M1378861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I followed your previous query and I have one question. Let us say I declare a UPD_STRUC and move OLD_STRUC to it and then move NEW_STRUC to it, will it(UPD_STRUC) look like the way you want it to look like? Why are trying to figure out individual field changes, when all you want is the old structure take the new values for whatever fields that changed? If I have fields 1, 2, 3, 4 and 5 on this structure and only 2 and 5 changed, how does it matter if I move just those two fields to the UPD_STRUC or all 5 fields to UPD_STRUC. End result will be the way wanted isn't it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2009 14:13:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219520#M1378861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-21T14:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help to update fields in local structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219521#M1378862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Maen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is the use for&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if &amp;lt;fs_new&amp;gt; is initial. ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;nina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2009 14:14:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219521#M1378862</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-21T14:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help to update fields in local structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219522#M1378863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi nina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first press F1 on initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2009 14:22:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219522#M1378863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-21T14:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help to update fields in local structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219523#M1378864</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 know what is doing in general &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; but why i need it in the code ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Nina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2009 14:24:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219523#M1378864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-21T14:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help to update fields in local structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219524#M1378865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think the problem is which fields of stru_new shell be update by stru_old and which fields of stru_new&lt;/P&gt;&lt;P&gt;shell not be ubdated by stru_old because they have some values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To identify this you can use initial, or is there another way to check if some fields of stru_new&lt;/P&gt;&lt;P&gt;shell NOT be updated?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2009 14:35:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219524#M1378865</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-21T14:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help to update fields in local structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219525#M1378866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If ASSIGN statement doesn't assign any value to &amp;lt;fs_new&amp;gt; then you want to retrieve the old value for that field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF &amp;lt;FS_NEW&amp;gt; IS INITIAL checks the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Aabhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2009 14:37:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-update-fields-in-local-structure/m-p/6219525#M1378866</guid>
      <dc:creator>aabhas_wilmar</dc:creator>
      <dc:date>2009-09-21T14:37:46Z</dc:date>
    </item>
  </channel>
</rss>

