<?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: Lazy Copy in String Assignment/Move in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974216#M1801086</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lazy copy is not applied when a substring is assigned.&lt;/P&gt;&lt;P&gt;ABAP Debugger has memory inspector tool, that can be used to verify it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Dec 2013 09:48:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-12-04T09:48:33Z</dc:date>
    <item>
      <title>Lazy Copy in String Assignment/Move</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974211#M1801081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know from reading the help that a string assignment via the move statement or = operator will do a lazy copy operation, i.e. both resulting variables will point to the same memory space until a change is made via one of the two variables.&amp;nbsp; Only then is an actual copy of the memory made.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is: does this still apply when assigning a portion of a string to another variable like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data lv_string1 type string.&lt;/P&gt;&lt;P&gt;data lv_string2 type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_string1 = 'This is a string'.&lt;/P&gt;&lt;P&gt;lv_string2 = lv_string1+5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or does the previous code immediately make a copy of the memory starting at an offset of 5 in lv_string1 and assign the copy to lv_string2?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 19:31:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974211#M1801081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-12-03T19:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lazy Copy in String Assignment/Move</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974212#M1801082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm pretty sure it is immediate.&amp;nbsp; I suppose that someone could prove me wrong however.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To clarify, I'd always assumed that it was immediate.&amp;nbsp; What would be the worry if it weren't?&amp;nbsp; I'm quite interested in your concern...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 19:40:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974212#M1801082</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-12-03T19:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Lazy Copy in String Assignment/Move</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974213#M1801083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My concern is performance.&amp;nbsp; If it is doing a lazy copy, then I can assign lv_string2 = lv_string1+5 with no concern about performance impact as long as I never alter the contents of lv_string2.&amp;nbsp; However, if the copy is immediate in this case, then there can be a performance impact for very large strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also suspect that it is immediate, because the syntax will not allow you to pass lv_string1+5 as a parameter, at least not by reference.&amp;nbsp; It also does not allow you to assign lv_string1+5 to a field-symbol.&amp;nbsp; Both of these facts lead me to suspect that ABAP can't handle a reference to anything but the beginning of a string.&amp;nbsp; The documenation does not seem to address this scenario, though.&lt;/P&gt;&lt;P&gt;Thanks for your input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 21:18:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974213#M1801083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-12-03T21:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Lazy Copy in String Assignment/Move</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974214#M1801084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I have done large numbers of string manipulations, I have noticed more impact than I was expecting, so I would have to agree with you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 21:53:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974214#M1801084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-12-03T21:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Lazy Copy in String Assignment/Move</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974215#M1801085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If kernel has task to do then there would no any other best option available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avirat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2013 05:06:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974215#M1801085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-12-04T05:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Lazy Copy in String Assignment/Move</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974216#M1801086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lazy copy is not applied when a substring is assigned.&lt;/P&gt;&lt;P&gt;ABAP Debugger has memory inspector tool, that can be used to verify it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2013 09:48:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974216#M1801086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-12-04T09:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Lazy Copy in String Assignment/Move</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974217#M1801087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Over a year later, I finally had the chace to follow up on this.&amp;nbsp; I learned how to use the memory inspector and can see that, yes, assignment of a substring makes an immediate copy, even though assignment of the full string does a lazy copy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The memory inspector is a very valuable tool.&amp;nbsp; Thanks, Manish!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 20:49:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lazy-copy-in-string-assignment-move/m-p/9974217#M1801087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-12T20:49:22Z</dc:date>
    </item>
  </channel>
</rss>

