<?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 Logic correction in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1963677#M395945</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am struck in the following logic. I have a set of GL Accounts whose values are getting populated&lt;/P&gt;&lt;P&gt;in table gt_glaccnts. These values are read from table gt_glaccnts and popultaed in the form of range&lt;/P&gt;&lt;P&gt;gr_glrange_set. Now, the selection screen has a GL account field. If this field is populated at run time,&lt;/P&gt;&lt;P&gt;I need to consider only that range from gt_glaccnts which has this GL, deleting all other ranges. The logic&lt;/P&gt;&lt;P&gt;written below is same. But this is not working. Please suggest where it is going wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;M A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT so_saknr[] IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT gt_glaccnts.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-sign = 'I'.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-option = 'EQ'.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-low = gt_glaccnts-from.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-high = gt_glaccnts-to.&lt;/P&gt;&lt;P&gt;      loop at so_saknr.&lt;/P&gt;&lt;P&gt;        if so_saknr-low in gr_glrange_set.&lt;/P&gt;&lt;P&gt;        APPEND gr_glrange_set.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT gt_glaccnts.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-sign = 'I'.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-option = 'EQ'.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-low = gt_glaccnts-from.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-high = gt_glaccnts-to.&lt;/P&gt;&lt;P&gt;    APPEND gr_glrange_set.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&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;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Mar 2007 11:43:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-02T11:43:26Z</dc:date>
    <item>
      <title>Logic correction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1963677#M395945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am struck in the following logic. I have a set of GL Accounts whose values are getting populated&lt;/P&gt;&lt;P&gt;in table gt_glaccnts. These values are read from table gt_glaccnts and popultaed in the form of range&lt;/P&gt;&lt;P&gt;gr_glrange_set. Now, the selection screen has a GL account field. If this field is populated at run time,&lt;/P&gt;&lt;P&gt;I need to consider only that range from gt_glaccnts which has this GL, deleting all other ranges. The logic&lt;/P&gt;&lt;P&gt;written below is same. But this is not working. Please suggest where it is going wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;M A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT so_saknr[] IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT gt_glaccnts.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-sign = 'I'.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-option = 'EQ'.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-low = gt_glaccnts-from.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-high = gt_glaccnts-to.&lt;/P&gt;&lt;P&gt;      loop at so_saknr.&lt;/P&gt;&lt;P&gt;        if so_saknr-low in gr_glrange_set.&lt;/P&gt;&lt;P&gt;        APPEND gr_glrange_set.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT gt_glaccnts.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-sign = 'I'.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-option = 'EQ'.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-low = gt_glaccnts-from.&lt;/P&gt;&lt;P&gt;    gr_glrange_set-high = gt_glaccnts-to.&lt;/P&gt;&lt;P&gt;    APPEND gr_glrange_set.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&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;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2007 11:43:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1963677#M395945</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-02T11:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Logic correction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1963678#M395946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if so_saknr-low in gr_glrange_set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;may this line is wrong try giving if so_saknr-low in gr_glrange_set-low. or try using eq&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or use a local variable inside the first loop...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2007 11:53:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1963678#M395946</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-02T11:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Logic correction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1963679#M395947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like this:&lt;/P&gt;&lt;P&gt;LOOP AT gt_glaccnts.&lt;/P&gt;&lt;P&gt;gr_glrange_set-sign = 'I'.&lt;/P&gt;&lt;P&gt;gr_glrange_set-option = 'EQ'.&lt;/P&gt;&lt;P&gt;gr_glrange_set-low = gt_glaccnts-from.&lt;/P&gt;&lt;P&gt;gr_glrange_set-high = gt_glaccnts-to.&lt;/P&gt;&lt;P&gt;loop at so_saknr.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;if so_saknr-low &amp;lt;= gt_glaccnts-to and so_saknr-low &amp;gt;= gt_glaccnts-from.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;APPEND gr_glrange_set.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2007 11:59:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1963679#M395947</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-02T11:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Logic correction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1963680#M395948</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;PRE&gt;&lt;CODE&gt;IF NOT so_saknr[] IS INITIAL.

LOOP AT gt_glaccnts.
gr_glrange_set-sign = 'I'.
gr_glrange_set-option = 'EQ'.
gr_glrange_set-low = gt_glaccnts-from.
gr_glrange_set-high = gt_glaccnts-to.
read table so_saknr with key so_saknr-low in gr_glrange_set.
if sy-subrc = 0.
APPEND gr_glrange_set.
endif.
ENDLOOP.

else.

LOOP AT gt_glaccnts.
gr_glrange_set-sign = 'I'.
gr_glrange_set-option = 'EQ'.
gr_glrange_set-low = gt_glaccnts-from.
gr_glrange_set-high = gt_glaccnts-to.
APPEND gr_glrange_set.
ENDLOOP.

endif.&lt;/CODE&gt;&lt;/PRE&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; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2007 12:00:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1963680#M395948</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-02T12:00:20Z</dc:date>
    </item>
  </channel>
</rss>

