<?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: Using for all entries in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982781#M401741</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For ALL ENTRIES would be one trip to the DB,  which is better than the LOOP and SELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want to award points to your other thread for any helpful answers and mark as closed.&lt;/P&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>Tue, 13 Feb 2007 20:39:22 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2007-02-13T20:39:22Z</dc:date>
    <item>
      <title>Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982780#M401740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this okay to use?  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following code and could do it either way but I don't know what is the best&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT BELNR KOKRS BUZEI GJAHR EBELN EBELP&lt;/P&gt;&lt;P&gt;         INTO TABLE T_COEP&lt;/P&gt;&lt;P&gt;         FROM COEP&lt;/P&gt;&lt;P&gt;          FOR ALL ENTRIES IN T_ICORDCSTA1&lt;/P&gt;&lt;P&gt;         WHERE BELNR = T_ICORDCSTA1-BELNR&lt;/P&gt;&lt;P&gt;          AND KOKRS = T_ICORDCSTA1-KOKRS&lt;/P&gt;&lt;P&gt;          AND BUZEI = T_ICORDCSTA1-BUZEI&lt;/P&gt;&lt;P&gt;          AND GJAHR = T_ICORDCSTA1-FISCPER+0(4).&lt;/P&gt;&lt;P&gt;&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 wa_icordcsta1 type icordcsta1.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;LOOP AT t_icordcsta1 INTO wa_icordcsta1.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;  SELECT belnr kokrs buzei gjahr ebeln ebelp&lt;/P&gt;&lt;P&gt;    APPENDING TABLE t_coep&lt;/P&gt;&lt;P&gt;    FROM coep&lt;/P&gt;&lt;P&gt;    WHERE belnr = wa_icordcsta1-belnr&lt;/P&gt;&lt;P&gt;      AND kokrs = wa_icordcsta1-kokrs&lt;/P&gt;&lt;P&gt;      AND buzei = wa_icordcsta1-buzei&lt;/P&gt;&lt;P&gt;      AND gjahr = wa_icordcsta1-fiscper+0(4).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 20:33:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982780#M401740</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T20:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982781#M401741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For ALL ENTRIES would be one trip to the DB,  which is better than the LOOP and SELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want to award points to your other thread for any helpful answers and mark as closed.&lt;/P&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>Tue, 13 Feb 2007 20:39:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982781#M401741</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-02-13T20:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982782#M401742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well I thought that would be the case but  i keep getting this message.    I did a translation on it  and it says  When using FOR ALL ENTRIES becomes the length specification for "FISCPER" in this condition ignores.  So it doens't like this statement but I don't really know why&lt;/P&gt;&lt;P&gt;   AND GJAHR = T_ICORDCSTA1-FISCPER+0(4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bei der Verwendung von FOR ALL ENTRIES wird die Längenangabe für&lt;/P&gt;&lt;P&gt;"FISCPER" in dieser Bedingung ignoriert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 20:43:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982782#M401742</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T20:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982783#M401743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think we went through this on your other thread. You can't use the offset when using FOR ALL ENTRIES. So you're left with the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An alternative would be to loop through t_icordcsta1 and create an additional field (say GJAHR) with just the first four characters of FISCPER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 21:04:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982783#M401743</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T21:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982784#M401744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mick!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The translation is correct; the message is in general correct and should be followed - still there is one very small exception: all characters of T_ICORDCSTA1-FISCPER+4(n) will be ignored, too - only the same length of GJAHR will be taken for the compare. &lt;/P&gt;&lt;P&gt;So a select with AND GJAHR = T_ICORDCSTA1-FISCPER should work. Only selects with AND GJAHR = T_ICORDCSTA1-FISCPER+n(m) with n &amp;gt; 0 will not work with FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 21:15:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982784#M401744</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2007-02-13T21:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982785#M401745</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;Declare one more field in the internal table T_ICORDCSTA1 which will hold the value T_ICORDCSTA1-FISCPER&lt;EM&gt;0(4) for every entry and then during FOR ALL ENTRIES, use that field instead of using offset length i.e T_ICORDCSTA1-FISCPER&lt;/EM&gt;0(4).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES : BEGIN OF X_ICORDCSTA1,
                .
                .
                .
              year(4)  TYPE  N,
              END    OF X_ICORDCSTA1.

DATA : T_ICORDCSTA1 TYPE TABLE OF X_ICORDCSTA1.
.
.
.
LOOP AT T_ICORDCSTA1 INTO X_ICORDCSTA1.
X_ICORDCSTA1-year = T_ICORDCSTA1-FISCPER+0(4).
MODIFY TABLE T_ICORDCSTA1 FROM X_ICORDCSTA1 TRANSPORTING year.
ENDLOOP.

SELECT BELNR KOKRS BUZEI GJAHR EBELN EBELP
INTO TABLE T_COEP
FROM COEP
FOR ALL ENTRIES IN T_ICORDCSTA1
WHERE BELNR = T_ICORDCSTA1-BELNR
AND KOKRS = T_ICORDCSTA1-KOKRS
AND BUZEI = T_ICORDCSTA1-BUZEI
AND GJAHR = T_ICORDCSTA1-year.

IF sy-subrc &amp;lt;&amp;gt; 0.

ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Reward points if the answer is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Mukul&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Mukul R. Kulkarni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 21:28:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982785#M401745</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T21:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982786#M401746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well it lets me and returns the right entries.  so this seems to be better for performance than just doing 1 at a time right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 21:44:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982786#M401746</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T21:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982787#M401747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see it's a warning and not a hard error. Still, I'd get rid of it. Warnings sometimes become errors in higher releases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next programmer to have to change the program won't appreciate getting a warning every time he or she has to do a syntax check either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 21:55:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982787#M401747</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T21:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982788#M401748</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;Go for FOR ALL ENTRIES. It will have good performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the second case a database access will happen for each and every row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regs,&lt;/P&gt;&lt;P&gt;Venkat Ramanan N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 10:40:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982788#M401748</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T10:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982789#M401749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well problem with tath approach is then it hits the DB everytime versus just once.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 13:56:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982789#M401749</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T13:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982790#M401750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes I do agree.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 13:56:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982790#M401750</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T13:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982791#M401751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not if you create the extra field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 14:48:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982791#M401751</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T14:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982792#M401752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guesss i don't follow becuase I would have to do a loop which is 1 at a time.  Do you have a smaple of what you mean?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 14:50:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982792#M401752</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T14:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982793#M401753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes - try:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ztest MESSAGE-ID 00.

DATA: BEGIN OF t_coep OCCURS 0.
        INCLUDE STRUCTURE coep.
DATA: END   OF t_coep.

DATA: BEGIN OF t_icordcsta1 OCCURS 0.
        INCLUDE STRUCTURE icordcsta1.
DATA: END   OF t_icordcsta1.

DATA: BEGIN OF itab OCCURS 0.
        INCLUDE STRUCTURE icordcsta1.
DATA:   gjahr LIKE coep-gjahr,
      END   OF itab.

LOOP AT t_icordcsta1 INTO itab.
  itab-gjahr = t_icordcsta1-fiscper(4).
  APPEND itab.
ENDLOOP.

SORT itab BY kokrs belnr buzei gjahr.
DELETE ADJACENT DUPLICATES FROM itab COMPARING kokrs belnr buzei gjahr.

SELECT belnr kokrs buzei gjahr ebeln ebelp
  INTO TABLE t_coep
  FROM coep
  FOR ALL ENTRIES IN itab
  WHERE kokrs = itab-kokrs
  AND   belnr = itab-belnr
  AND   buzei = itab-buzei
  AND   gjahr = itab-gjahr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 15:15:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982793#M401753</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T15:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982794#M401754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had the same problem used COVP which is a innner join between COBK and COEP  on KOKRS &amp;amp; BELNR and it gave me  very good results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*--Get the Complete COEP Details
  CLEAR : it_covp,
                it_covp[].

  SELECT *
  FROM covp
  INTO TABLE it_covp
  WHERE    lednr      EQ  '00'
       AND    objnr      EQ  wa_caufv_s-objnr. "Order Number in OBJNR format

&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;&amp;lt;b&amp;gt;AS&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Feb 2007 03:59:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-for-all-entries/m-p/1982794#M401754</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-17T03:59:00Z</dc:date>
    </item>
  </channel>
</rss>

