<?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: is this code correct ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495701#M230189</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have check the other ways n return to reward the answers...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Aug 2006 17:07:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-08T17:07:31Z</dc:date>
    <item>
      <title>is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495677#M230165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this performance wise correct,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

LOOP BSEG INTO WA.

  AT NEW BUZEI.

   SELECT SINGLE * FROM TABLE INTO VARIABLE WHERE ....

   SELECT SINGLE * FROM TABLE INTO VARIABLE WHERE ....

   SELECT SINGLE * FROM TABLE INTO VARIABLE WHERE ....
 
   WRITE:/ value, wa-value.

  ENDAT.

ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: shehryar dahar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:45:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495677#M230165</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T15:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495678#M230166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Dahar,&lt;/P&gt;&lt;P&gt; Use read table statement before select single statement ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:46:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495678#M230166</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T15:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495679#M230167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi the code should be like this:: and in where condition which fields you are using... if these fileds after buzei in internaltable then u have to use &amp;lt;b&amp;gt;Read statement&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;AT NEW table-BUZEI.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;read table itab with key buzei = some value.&lt;/P&gt;&lt;P&gt; SELECT SINGLE * FROM TABLE INTO VARIABLE WHERE ....&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; SELECT SINGLE * FROM TABLE INTO VARIABLE WHERE ....&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; SELECT SINGLE * FROM TABLE INTO VARIABLE WHERE ....&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; WRITE:/ value.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ENDAT.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Ashok Parupalli&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Ashok Parupalli&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:46:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495679#M230167</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T15:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495680#M230168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi shehryar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use READ stmts..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check if u have sorted the table...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:47:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495680#M230168</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T15:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495681#M230169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, first off, if you are selecting * you need to select into a table structure; or &lt;/P&gt;&lt;P&gt;Select Single Fieldname From Table Into Variable Where&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:47:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495681#M230169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T15:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495682#M230170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unless unaviodable it is preferable not to use SELECTs inside a loop.. you would be better off dumping the required data into itabs &amp;amp; reading them inside the loop instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~ Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:47:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495682#M230170</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-08-08T15:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495683#M230171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Santosh, can u demonstrate with an example,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:48:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495683#M230171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T15:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495684#M230172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Avoid using selects within a loop.&lt;/P&gt;&lt;P&gt;it affects ur performance.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;keerthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:48:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495684#M230172</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T15:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495685#M230173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;here is an example of that..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    READ TABLE it_owners WITH KEY ba_ba_no  =  it_detail-own_no
                                 ba_seq_no =  it_detail-own_seq_no.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; also make sure that your internal table in whicb you are collecting have in an order as they are in DB table ...&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Please close all your previous threads even this once if it answered by marking all the helpful answers...&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:49:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495685#M230173</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T15:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495686#M230174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;NOt correct.&lt;/P&gt;&lt;P&gt;Get the selects outside the loop and use for all entries instead.&lt;/P&gt;&lt;P&gt;inside the loop, you have to use read statements&lt;/P&gt;&lt;P&gt; SELECT  * FROM TABLE INTO table it_table1 &lt;/P&gt;&lt;P&gt;for all entries in it_bseg&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt; ERE ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; LOOP at it_BSEG INTO WA.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt;   AT NEW BUZEI.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; read table it_table1 with key ere =&lt;/P&gt;&lt;P&gt;&amp;gt; read table it_table1 with key ere =&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; read table it_table1 with key ere =&lt;/P&gt;&lt;P&gt;&amp;gt;  &lt;/P&gt;&lt;P&gt;&amp;gt;    WRITE:/ value, wa-value.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt;   ENDAT.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; ENDLOOP.&lt;/P&gt;&lt;P&gt;&amp;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;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:50:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495686#M230174</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T15:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495687#M230175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;priya.. yes, i have sorted the bseg with belnr and koart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suresh.. can you demonstrate with an example ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:50:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495687#M230175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T15:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495688#M230176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Performance cannot be measured like this. You have to give the exact code. If your table is a small table and you are hitting an index all the time, then I don't see why it will be a problem. But if your table has a lot of data and your WHERE clause is resulting in a sequential search, then yes, performance will be hit badly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give us the exact code, without which this discussion will be with a lot suppositions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:51:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495688#M230176</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T15:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495689#M230177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i have to read from different tables inside the ' AT NEW BUZEI'  ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:53:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495689#M230177</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T15:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495690#M230178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi use &lt;/P&gt;&lt;P&gt;Read table xyz with some key value...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;sony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 15:59:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495690#M230178</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T15:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495691#M230179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Advani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am writing this from home. Its sumthing like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code]&lt;/P&gt;&lt;P&gt;select * from bkpf into t_bkpf where bldat in s_bldat and blart = 'KZ'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select * from bseg into wa_bseg where belnr = t_bkpf-belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  append wa_bseg into t_bseg.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort t_bseg belnr koart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_bseg into waa_bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  AT NEW BUZEI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF waa_bseg-koart EQ 'K'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        SELECT SINGLE * FROM LFA1 into t_lfa1 where lifnr =  waa_bseg-lifnr.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    ELSEIF waa_bseg-koart EQ 'D'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        SELECT SINGLE * FROM KNA1 into t_kna1 where kunnr = waa_bseg-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WRITE:/ t_lfa1-name1.&lt;/P&gt;&lt;P&gt;    WRITE:/ t_kna1-name1.&lt;/P&gt;&lt;P&gt;    WRITE:/ waa_bseg-belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDAT.&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;&lt;/P&gt;&lt;P&gt;itz approximately the same code snippet.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 16:02:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495691#M230179</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T16:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495692#M230180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how do i get/display values after using the READ statements. ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 16:04:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495692#M230180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T16:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495693#M230181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just as I thought!!. There will not be any performance issue with the LOOP itself as you are hitting the tables with the primary key. Your performance will be bad because of the select statements before that (from BKPF and BSEG). Change that. See if you can pass BUKRS to BKPF select and then change the code as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: BEGIN OF t_bseg OCCURS 0.
        INCLUDE STRUCTURE bseg.
DATA: END OF t_bseg.

DATA: BEGIN OF t_bkpf OCCURS 0,
        bukrs LIKE bkpf-bukrs,
        belnr LIKE bkpf-belnr,
        gjahr LIKE bkpf-gjahr,
        bldat LIKE bkpf-bldat.
DATA: END OF t_bkpf.

SELECT-OPTIONS: s_bldat FOR t_bkpf-bldat.

SELECT bukrs belnr
       gjahr bldat FROM bkpf
                   INTO TABLE t_bkpf
                  WHERE blart EQ 'KZ'.
CHECK sy-subrc = 0.
DELETE t_bkpf WHERE NOT bldat IN s_bldat.

SELECT * FROM bseg
         INTO TABLE t_bseg FOR ALL ENTRIES IN t_bkpf
        WHERE belnr = t_bkpf-belnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 16:16:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495693#M230181</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T16:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495694#M230182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can add BUKRS in the WHERE clause for BKPF and BSEG selects in my previous code, it will be even more faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also consider going to BSIK, BSAK and BSID and BSAD tables if you are interested only in customer and vendor accounts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 16:20:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495694#M230182</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T16:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495695#M230183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Santosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to get the value after using the read statement and secondly i was told to use read statements instead of select single ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 16:20:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495695#M230183</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T16:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: is this code correct ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495696#M230184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Adavi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the correction. So, the 'AT NEW BUZEI' part is correct ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 16:23:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-this-code-correct/m-p/1495696#M230184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T16:23:08Z</dc:date>
    </item>
  </channel>
</rss>

