<?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 on Read in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641074#M285499</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you insist on using a Read statment, you can do like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V_KEY = 'E'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE I_ITAB WITH KEY STAT(1) =  V_KEY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Oct 2006 15:16:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-19T15:16:23Z</dc:date>
    <item>
      <title>Help on Read</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641066#M285491</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;Need some help on read statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to read the records which starts with some character and need to specify the same in where condition as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table i_itab&lt;/P&gt;&lt;P&gt;     into w_itab&lt;/P&gt;&lt;P&gt;     with key objnr = w_itab-objnr&lt;/P&gt;&lt;P&gt;          stat CS 'E'&lt;/P&gt;&lt;P&gt;          Binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Getting error as should not use CS in the read statement. How to read the records which starts with letter 'E' only in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me out in this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 14:57:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641066#M285491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T14:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Read</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641067#M285492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;U cannot use pattern operators in read statement. The only way is to use Loop instead of read.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at i_itab where objnr = w_itab-objnr&lt;/P&gt;&lt;P&gt;and stat(1)EQ 'E'.&lt;/P&gt;&lt;P&gt;  do your processing&lt;/P&gt;&lt;P&gt;  exit.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;stat(1) would give you the start character and you can check that be E...hence it would give the records with stat starting with E.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Anurag Bankley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Anurag Bankley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 14:58:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641067#M285492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T14:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Read</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641068#M285493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  As there can more than one record which starts with "E", itz better you do a loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  loop at i_itab where objnr = w_itab-objnr
                 and   stat(1) = 'E'.
*** D0 the processing.
  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 15:00:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641068#M285493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T15:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Read</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641069#M285494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's right you can use CS syntax in READ statement but you can with LOOP.  So here is what you do, notice that this loop will only do one read because it has the EXIT statement in the loop, this is just like doing a single READ statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

loop at i_itab into w_itab 
            where objnr = w_itab-objnr  "&amp;lt;--- Not sure about this here
              and stat  cs 'E'.
* Do something
   exit.
              
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 15:02:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641069#M285494</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-10-19T15:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Read</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641070#M285495</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;The thing is i need to get the details through Read statement. Can we do this from the read statement, if so plese send me the code using read statemnt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 15:09:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641070#M285495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T15:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Read</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641071#M285496</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;Read statement always support '=' operator. 'CS' will not support.&lt;/P&gt;&lt;P&gt;Pl use loop endloop the way other Forums mate mentioned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 15:10:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641071#M285496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T15:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Read</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641072#M285497</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;Here my internal table contains OBJNR records. For each OBJNR there will many statuses. And my internal table has many records with OBJNR records. So i am using read statement. And in this i need to pick the OBJNR statues which starts with E.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reagards,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 15:13:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641072#M285497</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T15:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Read</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641073#M285498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  loop at itab where objnr = wa_itab-objnr
               and   estat(1) = 'E'.
       exit.
  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;  The above is same a read statement, you will get only one record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 15:15:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641073#M285498</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T15:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Read</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641074#M285499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you insist on using a Read statment, you can do like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V_KEY = 'E'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE I_ITAB WITH KEY STAT(1) =  V_KEY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 15:16:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641074#M285499</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T15:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Read</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641075#M285500</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;In that case u read the table with key key field. Then use If statement , check if it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg.&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;      lifnr like lfa1-lifnr,&lt;/P&gt;&lt;P&gt;      name  like lfa1-name1,&lt;/P&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lw_itab like line of itab.&lt;/P&gt;&lt;P&gt;     read table itab into lw_itab with &lt;/P&gt;&lt;P&gt;     key = lw_itab-lifnr.&lt;/P&gt;&lt;P&gt;     if lw_itab-name(1) = 'E'.&lt;/P&gt;&lt;P&gt;       Logic&lt;/P&gt;&lt;P&gt;     endif. &lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 15:17:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641075#M285500</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T15:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Read</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641076#M285501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, if you absolutely need to use the READ statement and you want to look for record that STAT starts with "E".  You can do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


read table i_itab into w_itab
             with key objnr = w_itab-objnr
                      &amp;lt;b&amp;gt;stat+0(1) = 'E' Binary search.&amp;lt;/b&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 15:18:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641076#M285501</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-10-19T15:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Read</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641077#M285502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be able to do a binary search to get the first record and then do indexed reads to get subsequent records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA tab_index LIKE sy-tabix.

SORT i_itab BY objnr stat.

IF sy-subrc = 0.
  tab_index = sy-tabix.
ENDIF.

WHILE sy-subrc = 0.
  IF w_itab-stat CS 'E'.
* process record.
  ENDIF.

  tab_index = tab_index + 1.
READ TABLE i_itab INDEX tab_index.
  IF sy-subrc = 0.
  IF i_itab-objnr &amp;lt;&amp;gt; w_itab-objnr.
      sy-subrc = 9.
    ENDIF.
  ENDIF.
ENDWHILE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rob Burbank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 15:21:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-read/m-p/1641077#M285502</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T15:21:40Z</dc:date>
    </item>
  </channel>
</rss>

