<?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 read statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123661#M445475</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;can anyone explain to me why read table statement is not working in the followinf code:&lt;/P&gt;&lt;P&gt;data: begin of it_lfb1 occurs 10,&lt;/P&gt;&lt;P&gt;      lifnr like lfb1-lifnr,&lt;/P&gt;&lt;P&gt;      bukrs like lfb1-bukrs,&lt;/P&gt;&lt;P&gt;      end of it_lfb1.&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt; from lfb1&lt;/P&gt;&lt;P&gt; into corresponding fields of it_lfb1.&lt;/P&gt;&lt;P&gt; append it_lfb1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_lfb1 into wa_lfb1 with key lifnr = '100'.&lt;/P&gt;&lt;P&gt;write:/ wa_lfb1-lifnr,&lt;/P&gt;&lt;P&gt;        wa_lfb1-bukrs.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i am executing the read statement without key, its fetching first record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Apr 2007 06:57:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-18T06:57:36Z</dc:date>
    <item>
      <title>read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123661#M445475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;can anyone explain to me why read table statement is not working in the followinf code:&lt;/P&gt;&lt;P&gt;data: begin of it_lfb1 occurs 10,&lt;/P&gt;&lt;P&gt;      lifnr like lfb1-lifnr,&lt;/P&gt;&lt;P&gt;      bukrs like lfb1-bukrs,&lt;/P&gt;&lt;P&gt;      end of it_lfb1.&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt; from lfb1&lt;/P&gt;&lt;P&gt; into corresponding fields of it_lfb1.&lt;/P&gt;&lt;P&gt; append it_lfb1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_lfb1 into wa_lfb1 with key lifnr = '100'.&lt;/P&gt;&lt;P&gt;write:/ wa_lfb1-lifnr,&lt;/P&gt;&lt;P&gt;        wa_lfb1-bukrs.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i am executing the read statement without key, its fetching first record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 06:57:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123661#M445475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T06:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123662#M445476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;data: begin of it_lfb1 occurs 10,&lt;/P&gt;&lt;P&gt;lifnr like lfb1-lifnr,&lt;/P&gt;&lt;P&gt;bukrs like lfb1-bukrs,&lt;/P&gt;&lt;P&gt;end of it_lfb1.&lt;/P&gt;&lt;P&gt;select lifnr bukrs from lfb1&lt;/P&gt;&lt;P&gt;into table it_lfb1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at it_lfb1.&lt;/P&gt;&lt;P&gt; if it_lfb1-lifnr = '100'.&lt;/P&gt;&lt;P&gt;write:/ it_lfb1-lifnr,&lt;/P&gt;&lt;P&gt;it_lfb1-bukrs.&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;regards,&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Anji Reddy Vangala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 07:00:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123662#M445476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T07:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123663#M445477</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;data: begin of it_lfb1 occurs 10,
lifnr like lfb1-lifnr,
bukrs like lfb1-bukrs,
end of it_lfb1.
select *
from lfb1
into corresponding fields of table it_lfb1.


looat it_lfb1 into wa_lfb1 where lifnr = '100'.
write:/ wa_lfb1-lifnr, wa_lfb1-bukrs.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 07:00:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123663#M445477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T07:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123664#M445478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;LIFNR = '0000000100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suresh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 07:01:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123664#M445478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T07:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123665#M445479</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;check this !! it is working !!..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_lfb1 occurs 10,&lt;/P&gt;&lt;P&gt;lifnr like lfb1-lifnr,&lt;/P&gt;&lt;P&gt;bukrs like lfb1-bukrs,&lt;/P&gt;&lt;P&gt;end of it_lfb1.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from lfb1&lt;/P&gt;&lt;P&gt;into corresponding fields of table it_lfb1.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_lfb1 where lifnr eq '0000000100'.&lt;/P&gt;&lt;P&gt;write:/ it_lfb1-lifnr,&lt;/P&gt;&lt;P&gt;it_lfb1-bukrs.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;The output contains all the records where lifnr = 100.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sai ramesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 07:02:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123665#M445479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T07:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123666#M445480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vivek, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try with this line&lt;/P&gt;&lt;P&gt;read table it_lfb1 into wa_lfb1 with key lifnr = '0000000100'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need to pad zeros as many number according to size of the field.  lifner length of the field is 10.  so you need to pad 7 zeros befor '100'.  It may solve your problem &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 07:05:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123666#M445480</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T07:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123667#M445481</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;Try this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_lfb1 occurs 10,&lt;/P&gt;&lt;P&gt;lifnr like lfb1-lifnr,&lt;/P&gt;&lt;P&gt;bukrs like lfb1-bukrs,&lt;/P&gt;&lt;P&gt;end of it_lfb1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from lfb1&lt;/P&gt;&lt;P&gt;into corresponding fields of it_lfb1.&lt;/P&gt;&lt;P&gt;append it_lfb1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data wa_lfb1 like line of it_lfb1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_lfb1 into wa_lfb1 with key lifnr = &amp;lt;b&amp;gt;'0000000100'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;write:/ wa_lfb1-lifnr,&lt;/P&gt;&lt;P&gt;wa_lfb1-bukrs.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 07:23:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123667#M445481</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T07:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123668#M445482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vivek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As LIFNR as the conversion exit, so pad zeros prior to 100 to get the record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you doesnt specify WITH KEY then it will display the first record only. Dont use READ statements inside your SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_lfb1 occurs 10,&lt;/P&gt;&lt;P&gt;lifnr like lfb1-lifnr,&lt;/P&gt;&lt;P&gt;bukrs like lfb1-bukrs,&lt;/P&gt;&lt;P&gt;end of it_lfb1.&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from lfb1&lt;/P&gt;&lt;P&gt;into corresponding fields of it_lfb1.&lt;/P&gt;&lt;P&gt;append it_lfb1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_lfb1 into wa_lfb1 with key &amp;lt;b&amp;gt;lifnr = '0000000100'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;write:/ wa_lfb1-lifnr,&lt;/P&gt;&lt;P&gt;wa_lfb1-bukrs.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_lfb1 occurs 10,&lt;/P&gt;&lt;P&gt;lifnr like lfb1-lifnr,&lt;/P&gt;&lt;P&gt;bukrs like lfb1-bukrs,&lt;/P&gt;&lt;P&gt;end of it_lfb1.&lt;/P&gt;&lt;P&gt;select lifnr bukrs from lfb1&lt;/P&gt;&lt;P&gt;into table it_lfb1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at it_lfb1 where &amp;lt;b&amp;gt;lifnr = '0000000100'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;write:/ it_lfb1-lifnr,&lt;/P&gt;&lt;P&gt;it_lfb1-bukrs.&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;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 07:25:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123668#M445482</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T07:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123669#M445483</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;try this u include the read statement inside the loop..this is internal table with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from lfb1&lt;/P&gt;&lt;P&gt;into corresponding fields of it_lfb1.&lt;/P&gt;&lt;P&gt;append it_lfb1 to wa_lfb1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_lfb1 into wa_lfb1.&lt;/P&gt;&lt;P&gt;read table it_lfb1 into wa_lfb1 with key lifnr = '100'.&lt;/P&gt;&lt;P&gt;write:/ wa_lfb1-lifnr,&lt;/P&gt;&lt;P&gt;wa_lfb1-bukrs.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 12:38:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2123669#M445483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T12:38:02Z</dc:date>
    </item>
  </channel>
</rss>

