<?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 Summarizing Range Values in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/summarizing-range-values/m-p/3021259#M714286</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assume i  have an internal table with range values on Personnel Area authorizations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:  LI_RANGE LIKE rsrange OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Values are:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SIGN	OPTION	LOW	HIGH
I	EQ	CA01	
I	EQ	CA04
I	BT	CA05	CA10&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am trying to achieve is reduce the number of lines, to something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SIGN	OPTION	LOW	HIGH
I	EQ	CA01
I	BT	CA04	CA10&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There may be a few ways to do this, one way I thought was to first get all the individual values from the above range table, something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: li_persa TYPE TABLE OF WERKS.
SELECT PERSA FROM T500P APPENDING li_persa WHERE PERSA IN LI_RANGE
- this may not be syntactically correct but you get the idea&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have the list of individual Personnel Areas, I need to find sort them and find which ones can be included in a range (BT), and which ones need to be individual values (EQ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT li_persa.
LOOP AT li_persa.
   "Here I need to find out if one personel area is adjaecnt to another,
   "For example, if CA04 is next to CA05, these 2 can be contained in a range
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm not sure about is how to compare 2 char values, like CA04 and CA05, to see if they adjacent to each other. I tried adding 1 to CA04 to see if it equalled CA05 but got a short dump. Thought of using another data type....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Nov 2007 09:42:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-02T09:42:14Z</dc:date>
    <item>
      <title>Summarizing Range Values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/summarizing-range-values/m-p/3021259#M714286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assume i  have an internal table with range values on Personnel Area authorizations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:  LI_RANGE LIKE rsrange OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Values are:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SIGN	OPTION	LOW	HIGH
I	EQ	CA01	
I	EQ	CA04
I	BT	CA05	CA10&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am trying to achieve is reduce the number of lines, to something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SIGN	OPTION	LOW	HIGH
I	EQ	CA01
I	BT	CA04	CA10&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There may be a few ways to do this, one way I thought was to first get all the individual values from the above range table, something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: li_persa TYPE TABLE OF WERKS.
SELECT PERSA FROM T500P APPENDING li_persa WHERE PERSA IN LI_RANGE
- this may not be syntactically correct but you get the idea&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have the list of individual Personnel Areas, I need to find sort them and find which ones can be included in a range (BT), and which ones need to be individual values (EQ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT li_persa.
LOOP AT li_persa.
   "Here I need to find out if one personel area is adjaecnt to another,
   "For example, if CA04 is next to CA05, these 2 can be contained in a range
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm not sure about is how to compare 2 char values, like CA04 and CA05, to see if they adjacent to each other. I tried adding 1 to CA04 to see if it equalled CA05 but got a short dump. Thought of using another data type....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2007 09:42:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/summarizing-range-values/m-p/3021259#M714286</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-02T09:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing Range Values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/summarizing-range-values/m-p/3021260#M714287</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;If you are use that the field length is four...and the last two will always be numeric..Then you can extract the last two digits and increment them..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: v_num(2) type n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;move the last two digits.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;v_num = lt_range-low+(2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;increment the value.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;v_num = v_num + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;assign back the value..&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;lt_range-low+(2) = v_num.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Nov 2007 01:40:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/summarizing-range-values/m-p/3021260#M714287</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-04T01:40:59Z</dc:date>
    </item>
  </channel>
</rss>

