Optimize Performance in getting Quantity of Open PO per Material and Plant

Hi,
Recently I have a project that requires me to get the quantity of the open Purchase Orders (no Goods Reciept yet). The current code I have to get this are as follows (with some alterations):
<b>select MATNR WERKS MENGE
from EKPO into table i_purchase
for all entries in i_tab
where MATNR = i_tab-MATNR
   and WERKS = i_tab-WERKS
   and ELIKZ = space.
loop at i_tab.
       loop at i_purchase where matnr = i_tab-matnr
                                      and werks = i_tab-werks.
           i_tab-menge = i_tab-menge + i_purchase-menge.
       endloop.
modify i_tab.
clear i_tab.
endloop.</b>
Now there is nothing wrong with the program here its just that the user I know would tend to proccess a large number of materials per report and would cause a <b>Time Out</b> because of the data being proccessed. It also needs to be run online so background processing is out of the question.
Question is, is there a better way where I can get the same results with a better performance and possible avoiding the same time out again (i.e. other database tables, improved logic, coding impmlementation, etc.) ?
Hope to hear from you soon.
Take care and good day.

Hi,
Try this:
IN select stmt:
1.  use select statement validating i_tab. like:
if i_tab is not initial.
select MATNR WERKS MENGE
from EKPO into table i_purchase
for all entries in i_tab
where MATNR = i_tab-MATNR
and WERKS = i_tab-WERKS
and ELIKZ = space.
endif.
2. Chk this possiblility:  do not add elikz = space condition into wyhere clause of select stmt and remove unwated entries from i_tab using DELETE i_tab where elikz =ne space. this will surely improve performance of select stmt as elikz is not a key field.  but this chk once.
In LOOP:
1. donot use loop stmt insterasd use read table stmt for that sort itab with fields MATNR WERKS. and then use BINARY SEARCH in thi s clause. using bs will improver ur prg perfromance drastically.
2. instead of loop at itab use field symbol this is also very help ful. but try above oprtion and then go for it... any way loop with fs is better than loop at itab .
Hope this will help u.
Jogdand M B

Similar Messages

  • No inspection lot can be opened for this material and vendor -QA228

    Hi every one !
    Iam  getting  Error while doing Migo -"No inspection lot can be opened for this material and vendor-QA228"
    we analyze the issue asfollow -
    1.checked Quality Lot-Available
    2.Quality info record- Availble
    3. Quality plan is exist.
    But stil throwing  above Error.

    Hi,
    Check the below threads,
    [No inspection lot can be opened for this material and vendor;
    [No inspection lot can be opened for this material and vendor;

  • No inspection lot can be opened for this material and vendor

    dear sir
    i m facing this error while  doing gr. also how to confirm certificate
    plz guide me
    No inspection lot can be opened for this material and vendor

    Sujit/Raj
    I got th similar error. I closed the issue as Raj said because there was an open inspection lot. Im still nto able to figure out the background or root cause for thi.
    The QIno record doe not have release Qty active and release date is 12/31/9999. Then why we have to close the previous inspection lot before recieving another. It seems like there is a condition or something that tells Inspection are to be done in stages and hence previous or pending inspection lot needs to be closed. But where i this condition coming from, where should i check.
    I created PO and performed GR. I noticed if i perform GR and if the Inpection lot has status REL SPCO SPRQ IRCH then this happens. If the status is just REL SPCO SPRQ  then I'm able to do multiple reciepts and this error does not show up.
    Any idea or suggestions?

  • How to get material and plant by providing control key as input ?

    How to get the material and plant info based on control key values using a function module?
    kindly help..

    Hi,
    Check the FM
    K_VALID_PLANTS_OF_MATERIAL.
    Sandeep Kaushik

  • How to get STPOV structure values using BOM number and Plant number

    hello All,
    could you please help me out
    'How to get  STPOV structure values using BOM number and Plant number'
    is there any function module where can i give input as bom and plant number .
    waiting for your response.
    regards
    srinivas

    I did a quick where-used lookup in SE11 on the structure STPOV in function module interfaces and came up with the following:
    Function Module                             Short Description                                          
    CK_F_TOTALCOST_COMPUTE                                                                      
    CS_ALT_SELECT_COUPLED_PRODUCT                                                               
    CS_WHERE_USED_CLA                Bills of material; class use                               
    CS_WHERE_USED_CLA_ANY        Bills of material; direct class use or via other class     
    CS_WHERE_USED_CLA_VIA_CLA        Bills of material; class use via classes                   
    CS_WHERE_USED_COP                                                                           
    CS_WHERE_USED_DOC                Bills of material; document use                            
    CS_WHERE_USED_DOC_ANY:Bills of material; direct and (indirectly) document use via
    CS_WHERE_USED_DOC_VIA_CLA        Bills of material; document use via classes                
    CS_WHERE_USED_KNO                Bills of material; use object dependency                   
    CS_WHERE_USED_MAT                Bills of material; where-used list                         
    CS_WHERE_USED_MAT_ANY:Bills of material; where-used list as article or class item
    CS_WHERE_USED_MAT_VIA_CLA        Bills of material; where-used list via classes             
    EXIT_SAPMC29M_001                BOM; Article Where-Used List   
    It appears that this structure is primarily used for where-used look-ups for components within the BOM.  I don't know if any of these are what you're in need of.
    Hope this helps,
    Mark Schwendinger

  • Open quantity remains open even when delivery and goods issue is completed

    Hi gurus,
    We have so many deliveries in system where open quantity  in outbound delivery document  shows the quantity as open even though the goods issue is completed and invoice has been created and accounting documents are also cleared.
    I am not getting why it is happening. can someone please advise or throw some light on this.
    Vice versa they are showing up in MRP run as requirements.
    Thanks in advance gurus,
    Kind regards,
    Gopio.

    Hi Amol,
    I think i got the correct one which is RVV05IVB, and i had selected the shipping due date index, but it did not clear the open quantity, still it remained as open quantity.
    And the message i got after running the report is pasted below.
    Reorganization of SD Document Indices
    Reorganization sales document indexes with the following selection criteria:
    I EQ 80015593
    Delivery due Index
    How does that open quantity gets updated, or is there any control that we can deactivate as these are showing up in MD04 as sales requirements.
    Thanks,
    Regards,
    Gopio.

  • Since updating to the latest Itunes I cant get it to open. It downloaded and installed ok. It just wont open

    Since I updated itunes to the latest version it wont open. I have tried uninstalling and reinstalling but that didn't work either.
    Has anyone else had this problem. It was working on Windows 7 fine before

    http://support.apple.com/kb/HT1923

  • How to get number of open cursors per connection?

    I am trying to make sure my connection pool handles all
    situations where I need to close and reopen a Connection
    object.
    The last criteria I am trying to check is, how many open cursors
    are there on a connection that is supposedly no longer in use?
    If my application tells my Connection pool class that a
    Connection is not in use anymore, the Connection can be
    reused unless there are too many open cursors. I'm closing all my
    statments, but I want to make sure that I've got this check in
    place.
    TIA,
    Mike
    null

    I am trying to make sure my connection pool handles all
    situations where I need to close and reopen a Connection
    object.
    The last criteria I am trying to check is, how many open cursors
    are there on a connection that is supposedly no longer in use?
    If my application tells my Connection pool class that a
    Connection is not in use anymore, the Connection can be
    reused unless there are too many open cursors. I'm closing all my
    statments, but I want to make sure that I've got this check in
    place.
    TIA,
    Mike
    null

  • How do I get Safari to open in Preview?

    I am using Safari 5.0.5; have downloaded Adobe latest version; checked on Adobe preferences/internet to use Adobe. But from Safari PDF files will not open. Get a black screen with no content. How do I get Preview to open PDFs from Safari and thereby avoid this problem. Interesting issue -- this only occurs on iMac with Snow Leopard; my MacBook Air, not using Snow Leopard, opens Adobe from Safari.
    Cheers,
    Dubai09

    Hi
    If you want pdf's opening in Safari, using the built-in support (not Adobe) then quit open browsers, go to HD/Library/Internet Plug-Ins/ & remove any 'pdf' plugins. Occasionally, they're in Home/Library/Internet Plug-Ins/
    If you really want Adobe to do it in browser, and the plugin is in place already - try opening Safari in 32 bit mode. Command-click it in the dock, then File-Get Info, & check the 32 bit box. Takes effect the next time Safari is started up.

  • HT5581 Why cant i get ITunes to open up on my windows 7/ 64bit I have tryed all kinds of stuff and still no luck?

    Look on my desk top HP running windows 7/ 64bit. I can not for the world of me get ITunes to open up at all and have tried all .??

    Many thanks for your post. I've been trying for days to get this sorted and was getting well fed up with I-Tunes. Really thought i'd never get it working again. Tried un-installing it, loading older versions and they still wouldn't work.
    Came across your suggestion by chance and top man - it worked..!!!!
    How you even knew what to do is beyond me - but thanks so much. I really was pulling my hair out.
    You need to put your post over the Web as there seem to be loads of people having the same trouble.
    Thanks again.

  • Help! I can preview the presentation in Finder however, when I click on "Open with Keynote" it says, "presentation can't be open". How can i get it to open?

    Help! I can preview the presentation in Finder however, when I click on "Open with Keynote" it says, "presentation can't be open". How can i get it to open?

    Select one and hit the Space bar to view it in QuickLook. Use the forward arrow keys to move from file to file.   If the file can't be viewed in the QuickLook mode then the file is damaged and probably can't be copied or moved.
    You could try a photo file recovery application like  MediaRECOVER which can scan the memory card and tell you what files, if any, can be recovered before you have to purchase it.
    OT

  • Z report for opening qty of material date wise

    I have to develop a zreport which will calculate date wise opening  stock of material   and closing stock of that material at particular
    location ( not to use standard reports)
    I have to display sale qty and stock transfer qty  date wise.
    Similarly receipt qty  date wise.
    For sale qty, stock transfer qty and receipt calculation are date wise ok. But problem is to get date wise opening and closing stock of particular material.
    is it possible to get location wise material wise date wise opening stock list  in z report.
    Thanks

    Hi Ravikumar,
    Hope you are an ABAPer. If not also, you can achieve this through an ABAPer. As mentioned by others, you need to check whether your requirement is met by the standard transaction MB5B. You need to check whether this transaction gives you the exact opening and closing balance for a material. If this gives what you want, then you need to make some small enhancement in the MB5B report program so that you will be getting the result of the opening and closing stock. In this enhancement you will use EXPORT to export the result to your program where you can IMPORT it. This procedure is explained in detail in a document created in SCN dated 30th November, 2012 by Sijin Siji. Have a look in that.
    That document is descriptive and it will be helping you in solving this issue. If you have any doubts, please revert back.
    Regards,
    Abijith

  • "Can't open file; skipping it and continuing" Part2

    I am also having a problem with iMovie 3 not being able to import my dv clip. The clip in it's entirety is about 15 minutes long, way past the 9 minute minimum. When I open the move project containing that clip it only imports the first 1.5 minutes, when I import it I get and error of -40, and knowing that it plays the entire 15+ minutes as qt movie I try to drag the clip into the time frame and get "Can't open file; skipping it and continuing". The clip works fine in iMovie HD at my computer at work. Can I try to splice the clip into smaller clips and exporting to use it at home?

    http://www.danslagle.com/mac/iMovie/tips_tricks/6003.shtml

  • No inspection lot can be opened for this material error is coming during GR

    dear friends,
    no inspection lot can be opened for this material error is coming during GR. what is the cause for this and how to solve it. please suggest me
    regards,
    Krishna

    Hi,
    i think you have maintained the quality view and activated the inspection. but you have not created any inspection lot task list for the material and plant. thsi you can create through QP01 there maintain the material and plant. then enter in inspection plan give usage 5 and status 4. save it and try to check it with QA32 and see the lot. it should be released then only you can give usage decision.
    regards,
    Adwait Bachuwar

  • Optimize performance mac mini server

    What is the best way to optimize performance on my Mac Mini Sever?  I recently completed mutiple video editing projects that filled both my 1tb drives (with less than 5% space remaining on each). I copy/pasted the files to an external drive after the project but my computer is now running very slow (i see the swirly lollipop thing almost every time i click a new function). Suggestions?  Is there something native to the Mac OS that I can use for cleanup?  I would rather not use 3rd party software if i can help it.
    Thanks!

    First, back up all data immediately, as your boot drive might be failing.
    There are a few other possible causes of generalized slow performance that you can rule out easily.
    Reset the System Management Controller.
    If you have many image or video files on the Desktop with preview icons, move them to another folder.
    If applicable, uncheck all boxes in the iCloud preference pane.
    Disconnect all non-essential wired peripherals and remove aftermarket expansion cards, if any.
    Check your keychains in Keychain Access for excessively duplicated items.
    Boot into Recovery mode, launch Disk Utility, and run Repair Disk.
    Otherwise, take the steps below when you notice the problem.
    Step 1
    Launch the Activity Monitor application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Activity Monitor in the icon grid.
    Select the CPU tab of the Activity Monitor window.
    Select All Processes from the menu in the toolbar, if not already selected.
    Click the heading of the % CPU column in the process table to sort the entries by CPU usage. You may have to click it twice to get the highest value at the top. What is it, and what is the process? Also post the values for % User, % System, and % Idle at the bottom of the window.
    Select the System Memory tab. What values are shown in the bottom part of the window for Page outs and Swap used?
    Next, select the Disk Activity tab. Post the approximate values shown for Reads in/sec and Writes out/sec (not Reads in and Writes out.)
    Step 2
    If you have more than one user account, you must be logged in as an administrator to carry out this step.
    Launch the Console application in the same way you launched Activity Monitor. Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Select the 50 or so most recent entries in the log. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V). You're looking for entries at the end of the log, not at the beginning.
    When posting a log extract, be selective. Don't post more than is requested.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some personal information, such as your name, may appear in the log. Anonymize before posting. That should be easy to do if your extract is not too long.

Maybe you are looking for

  • Java Not Working, And Still No Answers. What Gives?

    Okay, decided to start this topic anew, since the only response I got to the other one was a post calling me "rude and impatient" (I guess that's what they're calling "persistence" nowadays..) , instead of...well...ignoring my admittedly pushy and ha

  • How to run Microsoft Office on MacBook Pro

    I need to run Microsoft Office on MacBook Pro. What are my available options?

  • Oracle Workflow

    Hello, We are planning to build workflow capability to our product. This product is written in C++ and uses Oracle 8i enterprise edition as database. One of the option is to use oracles existing workflow engine as the base and build over that. I had

  • Java.lang.RuntimeException: No route to host in Work Flow

    Dear All, Workflow containers are not starting up due to follwing errorin log file. "{oracle.apps.fnd.profiles.ExtendedProfileStore@1a80aea}],mUniqueId=SVC-GSM-WFMLRSVC-2201985,mLevel=4 }, oracle.jdbc.driver.T4CConnection@1e2670b, 10006, STOPPED_ERRO

  • DPM 2010 as a virtual server

    We're deciding to run DPM 2012 on as a virtual server (running on Windows Server 2012 and as a VMware 5.5 VM) My question is: When presenting storage to DPM 2012, is it better to use a VFS datastore or a RDM (Raw Device Mapping)? I can't seem to find