<?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 Set bit in a xString ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-bit-in-a-xstring/m-p/8789603#M1679103</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 store bits in a xstring. Notice that the xstring has a variable length. The length can not be predefined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To set the bit "1" at position "100" for example, I wrote the following code : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;DATA : lw_x&amp;nbsp; &lt;SPAN class="L1S52"&gt;TYPE&lt;/SPAN&gt; xstring.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;set &lt;SPAN class="L1S52"&gt;bit&lt;/SPAN&gt; 100&amp;nbsp; &lt;SPAN class="L1S52"&gt;of&lt;/SPAN&gt; lw_x.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;It does not work :after execution, my xstring has a length "0" and the 100th bit is not set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;Could you please advise ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;G.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jun 2012 08:36:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-06-14T08:36:07Z</dc:date>
    <item>
      <title>Set bit in a xString ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-bit-in-a-xstring/m-p/8789603#M1679103</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 store bits in a xstring. Notice that the xstring has a variable length. The length can not be predefined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To set the bit "1" at position "100" for example, I wrote the following code : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;DATA : lw_x&amp;nbsp; &lt;SPAN class="L1S52"&gt;TYPE&lt;/SPAN&gt; xstring.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;set &lt;SPAN class="L1S52"&gt;bit&lt;/SPAN&gt; 100&amp;nbsp; &lt;SPAN class="L1S52"&gt;of&lt;/SPAN&gt; lw_x.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;It does not work :after execution, my xstring has a length "0" and the 100th bit is not set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;Could you please advise ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;G.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 08:36:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-bit-in-a-xstring/m-p/8789603#M1679103</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-14T08:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Set bit in a xString ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-bit-in-a-xstring/m-p/8789604#M1679104</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;DATA lw_x(200) TYPE x.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;set &lt;/SPAN&gt;&lt;SPAN class="L1S52" style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;bit&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt; 100&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="L1S52" style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;of&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt; lw_x.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;Then you can assign that to the XSTRING variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Not tested it though.&lt;/P&gt;&lt;P&gt;Please check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shambu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 09:58:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-bit-in-a-xstring/m-p/8789604#M1679104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-14T09:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Set bit in a xString ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-bit-in-a-xstring/m-p/8789605#M1679105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Shambu for your anwer. Your solution works but it does not match my need : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to avoid to initiate my variables with a "Max fixed size" (I will deal with huge amount of data and I would like my program to be as performant as possible in term of memory comsumption).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your suggestion, I allocate 200 bits in memory but only the first 100 bits are relevant. &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;G.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 11:24:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-bit-in-a-xstring/m-p/8789605#M1679105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-14T11:24:09Z</dc:date>
    </item>
  </channel>
</rss>

