<?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: Problem while getting the base price for materials in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331954#M1032072</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Valter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used select statement inside loop also,but still its taking more time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any other table tog et the condition record number(KNUMH ) other than A004.&lt;/P&gt;&lt;P&gt;I have Application,Condition type,material number,sale organization,distribution channel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;peddi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Aug 2008 11:10:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-25T11:10:38Z</dc:date>
    <item>
      <title>Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331952#M1032070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now we are getting base price from A004 &amp;amp;KONP tables.&lt;/P&gt;&lt;P&gt;Please see the code below.&lt;/P&gt;&lt;P&gt;problem is : We have around 2 lacs materials in production ,while hitting A004 table for all materials its taking around 2 days to get the values, since it is a &lt;STRONG&gt;Pooled table&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Is there any other way to get the base price for materials.&lt;/P&gt;&lt;P&gt; if not it_mvke is initial.&lt;/P&gt;&lt;P&gt;      select kappl&lt;/P&gt;&lt;P&gt;             kschl&lt;/P&gt;&lt;P&gt;             vkorg&lt;/P&gt;&lt;P&gt;             vtweg&lt;/P&gt;&lt;P&gt;             matnr&lt;/P&gt;&lt;P&gt;             datbi&lt;/P&gt;&lt;P&gt;             datab&lt;/P&gt;&lt;P&gt;             knumh&lt;/P&gt;&lt;P&gt;             from a004&lt;/P&gt;&lt;P&gt;             into table it_a004&lt;/P&gt;&lt;P&gt;             for all entries in it_mvke&lt;/P&gt;&lt;P&gt;             where kappl = &lt;STRONG&gt;c_v&lt;/STRONG&gt; and&lt;/P&gt;&lt;P&gt;             kschl = &lt;STRONG&gt;c_zmbp&lt;/STRONG&gt; and&lt;/P&gt;&lt;P&gt;             vkorg in rng_vkorg and&lt;/P&gt;&lt;P&gt;             ( vtweg in &lt;STRONG&gt;'30'&lt;/STRONG&gt; or&lt;/P&gt;&lt;P&gt;             &lt;STRONG&gt;'32'&lt;/STRONG&gt; ) and&lt;/P&gt;&lt;P&gt;             matnr = &lt;STRONG&gt;it_mvke-matnr&lt;/STRONG&gt; and&lt;/P&gt;&lt;P&gt;             datbi &lt;STRONG&gt;ge gv_datum&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        select knumh&lt;/P&gt;&lt;P&gt;               kopos&lt;/P&gt;&lt;P&gt;               kbetr&lt;/P&gt;&lt;P&gt;               from konp&lt;/P&gt;&lt;P&gt;               into table it_konp&lt;/P&gt;&lt;P&gt;               for all entries in it_a004 where knumh = &lt;STRONG&gt;it_a004-knumh.&lt;/STRONG&gt;      endif.&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;STRONG&gt;&amp;lt;removed_by_moderator&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Peddi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Julius Bussche on Aug 29, 2008 12:41 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 10:09:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331952#M1032070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-25T10:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331953#M1032071</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;I personally never use FOR ALL ENTRIES when the internal table is very big. It has a poor performance. Also, I would change your restriction of vtweg field and wouldn't get field that I have the value, like matnr ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT matnr vkorg vtweg FROM mvke ... WHERE vkorg in rng_vkorg AND vtweg in ('30','32').

  SELECT vkorg vtweg datbi datab knumh
    FROM a004
    APPENDING table it_a004
   WHERE kappl = c_v 
     AND kschl = c_zmbp 
     AND vkorg = mvke-vkorh
     AND vtweg in ('30','32') "OR vtweg = mvke-vtweg
     AND matnr = mvke-matnr 
     AND datbi ge gv_datum
     AND datab le gv_datum.

ENDSELECT. "mvke

READ TABLE it_a004 TRANSPORTING NO FIELDS INDEX 1.
IF sy_subrc EQ 0.
  select knumh kopos kbetr
    from konp
    into table it_konp for all entries in it_a004 
  where knumh = it_a004-knumh. endif.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 11:03:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331953#M1032071</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-08-25T11:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331954#M1032072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Valter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used select statement inside loop also,but still its taking more time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any other table tog et the condition record number(KNUMH ) other than A004.&lt;/P&gt;&lt;P&gt;I have Application,Condition type,material number,sale organization,distribution channel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;peddi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 11:10:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331954#M1032072</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-25T11:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331955#M1032073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How much records do you have? Since you have almost all the key of A004 is strange that you are taking so much time. Sometimes it's not good to have so much intermediary internal tables. Why not, just get the data once, like:&lt;/P&gt;&lt;P&gt;SELECT matnr FROM mvke ...&lt;/P&gt;&lt;P&gt;  SELECT knumh FROM a004 UP TO 1 ROWS (because of date field)&lt;/P&gt;&lt;P&gt;    WHERE ...&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDSELECT.&lt;/P&gt;&lt;P&gt;  SELECT kbetr FROM konp UP TO 1 ROWS&lt;/P&gt;&lt;P&gt;    WHERE ...&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDSELECT.&lt;/P&gt;&lt;P&gt;  APPEND work area with matnr kbetr INTO itab (1st itab).&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;This souldn't take more than 5 minutes ... and i'm considering some thowsand records ... &lt;/P&gt;&lt;P&gt;However there is an FM to calculate price I think ... I'll search and post here ...&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 11:27:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331955#M1032073</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-08-25T11:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331956#M1032074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Valter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have around 2,00,000 records in MVKE internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date field also i am giving like greater than or equal to current date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 11:34:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331956#M1032074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-25T11:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331957#M1032075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peddi Reddy .,&lt;/P&gt;&lt;P&gt; You can Use KONH Table to get Condition Number instead if A004 .&lt;/P&gt;&lt;P&gt;  Please let me know Your exact Requirement  if you are not able to get data from KONH and KONP .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt; Sreenivas Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 12:05:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331957#M1032075</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-25T12:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331958#M1032076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another idea. Go to A004 only once, like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: BEGIN OF ty_a004,
         vkorg TYPE vkorg,
         vtweg TYPE vtweg,
         matnr TYPE matnr,
         knumh TYPE knumh,
       END OF ty_a004.

DATA: it_a004 TYPE HASHED TABLE OF ty_a004 WITH UNIQUE KEY vkorg vtweg matnr,
      wa_a004 TYPE ty_a004.

SELECT vkorg vtweg matnr knumh
  FROM a004
  INTO TABLE it_a004
 WHERE kappl = c_v
   AND kschl = c_kschl
   AND vkorg IN r_vkorg
   AND vtweg IN ('30','32')
   AND datbi GE gv_datum
   AND datab LE gv datum.

Then READ this table (hashed table).
SELECT vkorg vtweg matnr FROM mvke WHERE ...
  READ TABLE it_a004 INTO wa_a004 TRANSPORTING knumh
        WITH TABLE KEY vkorg = mvke-vkorg 
                  vtweg = mvke-vtweg 
                  matnr = mvke-matnr.
  IF sy-subrc EQ 0.
* KONP SELECT
  ENDIF.
ENDSELECT.

FREE it_a004.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 12:06:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331958#M1032076</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-08-25T12:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331959#M1032077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried A004 and KONP tables inside loop also&lt;/P&gt;&lt;P&gt;belwo is the loop we have ,in that we have 2,00,000 records. &lt;/P&gt;&lt;P&gt; loop at it_mvke into wa_mvke.&lt;/P&gt;&lt;P&gt;select     knumh&lt;/P&gt;&lt;P&gt;             from a004&lt;/P&gt;&lt;P&gt;             into  wa_a004&lt;/P&gt;&lt;P&gt;             where kappl = c_v and&lt;/P&gt;&lt;P&gt;             kschl = c_zmbp and&lt;/P&gt;&lt;P&gt;             vkorg = wa_mvke-vkorg and&lt;/P&gt;&lt;P&gt;             vtweg = wa_mvke-vtweg and&lt;/P&gt;&lt;P&gt;             matnr = wa_mvke-matnr and&lt;/P&gt;&lt;P&gt;             ( datab &amp;lt;= gv_datum and&lt;/P&gt;&lt;P&gt;               datbi &amp;gt;= gv_datum ).&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        select&lt;/P&gt;&lt;P&gt;               kbetr up to 1 rows&lt;/P&gt;&lt;P&gt;               from konp&lt;/P&gt;&lt;P&gt;               into wa_konp&lt;/P&gt;&lt;P&gt;                where knumh = wa_a004-knumh.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;*then doing some calculations.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Srinivas reddy,&lt;/P&gt;&lt;P&gt;I have sale organization ,distribuiton channel ,material,applcation,conditon type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked with KONH table,in taht table we don't have the material,sale organization etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to get the base price for materials from KONP table (KBETR) for this first we need KNUMH,This we will get from A004 table (Material)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone have ideas please share with me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all your support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Peddi Reddy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 11:55:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331959#M1032077</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-26T11:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331960#M1032078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try the only one select to A004 into an hashed table? It will work ... (tryied here).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 12:06:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331960#M1032078</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-08-26T12:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331961#M1032079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Valter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am trying with hashed table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your input&lt;/P&gt;&lt;P&gt;i will inform you with the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;peddireddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 11:55:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331961#M1032079</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T11:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331962#M1032080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the program i made for testing. 5 seconds for 100.000 records.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES: mvke.

TYPES: BEGIN OF ty_a004,
         vkorg TYPE vkorg,
         vtweg TYPE vtweg,
         matnr TYPE matnr,
         knumh TYPE knumh,
       END OF ty_a004.

DATA: it_a004 TYPE HASHED TABLE OF ty_a004 WITH UNIQUE KEY vkorg vtweg matnr,
      wa_a004 TYPE ty_a004,
      count(10) TYPE n.

START-OF-SELECTION.

  SELECT vkorg vtweg matnr knumh
    FROM a004
    INTO TABLE it_a004
   WHERE kappl = 'V'
     AND kschl = 'ZPR0'
     AND vkorg EQ 'INCM'
     AND vtweg IN ('L1','S1')
     AND datbi GE sy-datum
     AND datab LE sy-datum.

  CLEAR count.

  SELECT vkorg vtweg matnr FROM mvke
    INTO (mvke-vkorg, mvke-vtweg, mvke-matnr)
   WHERE vkorg EQ 'INCM'
     AND vtweg IN ('L1','S1').

    READ TABLE it_a004 INTO wa_a004
          WITH TABLE KEY vkorg = mvke-vkorg
                    vtweg = mvke-vtweg
                    matnr = mvke-matnr.

    CHECK sy-subrc EQ 0.
    ADD 1 TO count.
    WRITE: /1 mvke-vkorg, mvke-vtweg, mvke-matnr, wa_a004-knumh.

  ENDSELECT.

  SKIP.
  WRITE /1 count.

  FREE it_a004.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 13:38:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331962#M1032080</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-08-27T13:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331963#M1032081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Valter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have treid with hased table removing for all entries.&lt;/P&gt;&lt;P&gt;I have created background job 28.08.2008,still it is running.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please go thorugh the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select kappl&lt;/P&gt;&lt;P&gt;             kschl&lt;/P&gt;&lt;P&gt;             vkorg&lt;/P&gt;&lt;P&gt;             vtweg&lt;/P&gt;&lt;P&gt;             matnr&lt;/P&gt;&lt;P&gt;             datbi&lt;/P&gt;&lt;P&gt;             datab&lt;/P&gt;&lt;P&gt;             knumh&lt;/P&gt;&lt;P&gt;             from a004&lt;/P&gt;&lt;P&gt;             into table it_a004&lt;/P&gt;&lt;P&gt;             where kappl = c_v and&lt;/P&gt;&lt;P&gt;             kschl = c_zmbp and&lt;/P&gt;&lt;P&gt;             vkorg = '6501' and&lt;/P&gt;&lt;P&gt;             vtweg in ('30','32') and&lt;/P&gt;&lt;P&gt;             datbi ge gv_datum     and&lt;/P&gt;&lt;P&gt;             datab le gv_datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        select knumh&lt;/P&gt;&lt;P&gt;               kopos&lt;/P&gt;&lt;P&gt;               kbetr&lt;/P&gt;&lt;P&gt;               from konp&lt;/P&gt;&lt;P&gt;               into table it_konp&lt;/P&gt;&lt;P&gt;               for all entries in it_a004&lt;/P&gt;&lt;P&gt;               where knumh = it_a004-knumh and&lt;/P&gt;&lt;P&gt;               kopos = '01'.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then we have a loop after this select stament.&lt;/P&gt;&lt;P&gt;in the below loop we have around 185.000 records.&lt;/P&gt;&lt;P&gt;now loop has to run 185.000 times .&lt;/P&gt;&lt;P&gt;Do you think taht loop is taking more time?.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   loop at it_mvke into wa_mvke.&lt;/P&gt;&lt;P&gt;read table it_a004 into wa_a004 with table key&lt;/P&gt;&lt;P&gt;                                               vkorg = wa_mvke-vkorg&lt;/P&gt;&lt;P&gt;                                               vtweg = wa_mvke-vtweg&lt;/P&gt;&lt;P&gt;                                               matnr = wa_mvke-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     if sy-subrc = 0.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      read table it_konp into wa_konp with key knumh = wa_a004-knumh&lt;/P&gt;&lt;P&gt;                                               kopos = '01'&lt;/P&gt;&lt;P&gt;                                               binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doing some other calcaulations &lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and after that we haveto send all these records to application layer file.&lt;/P&gt;&lt;P&gt;then used opendataset for file for output&lt;/P&gt;&lt;P&gt;loop&lt;/P&gt;&lt;P&gt; transfer the data&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will Loop also effect the performance?&lt;/P&gt;&lt;P&gt;Please give me your valable inputs?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Peddi reddy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Aug 2008 06:16:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331963#M1032081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-29T06:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331964#M1032082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Valteir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now A004 table hitting is taking 4 minutes only after removing for all entries.thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But after that loop is there (with 170.000 records)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here contunously runnign the loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any idea to do loop fast ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cn you pelase give me inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Aug 2008 11:58:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331964#M1032082</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-29T11:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while getting the base price for materials</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331965#M1032083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What were the fields that you got from A004 and defined as the unique key in hashed table? I don't think you need kappl and kschl into your itab, but remember that if you do, you should include them in the unique key declaration in hashed table. And datab I wouldn't get too ... you don't need it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would do like program i made for testing:&lt;/P&gt;&lt;P&gt;select vkorg vtweg matnr knumh&lt;/P&gt;&lt;P&gt;   from a004&lt;/P&gt;&lt;P&gt;   into table it_a004 "table with only those 4 fields&lt;/P&gt;&lt;P&gt;  where kappl = c_v and&lt;/P&gt;&lt;P&gt;            kschl = c_zmbp and&lt;/P&gt;&lt;P&gt;            vkorg = '6501' and&lt;/P&gt;&lt;P&gt;            vtweg in ('30','32') and&lt;/P&gt;&lt;P&gt;            datbi ge gv_datum and&lt;/P&gt;&lt;P&gt;            datab le gv_datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_a004 into wa_a004 &lt;/P&gt;&lt;P&gt;       with table key vkorg = wa_mvke-vkorg&lt;/P&gt;&lt;P&gt;                            vtweg = wa_mvke-vtweg&lt;/P&gt;&lt;P&gt;                            matnr = wa_mvke-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if you want kappl and kschl in your itab, remember to use it in the read statement and unique key defintion, like:&lt;/P&gt;&lt;P&gt;read table it_a004 into wa_a004 &lt;/P&gt;&lt;P&gt;       with table key &lt;STRONG&gt;kappl = c_v&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;                            &lt;STRONG&gt;kschl = c_zmbp&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;                            vkorg = wa_mvke-vkorg&lt;/P&gt;&lt;P&gt;                            vtweg = wa_mvke-vtweg&lt;/P&gt;&lt;P&gt;                            matnr = wa_mvke-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thing. ti_konp can be a hashed table too with key knumh kopos and then .&lt;/P&gt;&lt;P&gt;read table it_konp into wa_konp &lt;/P&gt;&lt;P&gt;     with &lt;STRONG&gt;table&lt;/STRONG&gt; key knumh = wa_a004-knumh&lt;/P&gt;&lt;P&gt;                          kopos = '01'.&lt;/P&gt;&lt;P&gt;                    &lt;/P&gt;&lt;P&gt;I don't think OPEN DATASET will be a performance problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Aug 2008 12:11:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-getting-the-base-price-for-materials/m-p/4331965#M1032083</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-08-29T12:11:59Z</dc:date>
    </item>
  </channel>
</rss>

