Increase the requested quantity

Hello Experts,
how can I add new items to purchase requisitions or increase the requested quantity ?
Regards
ertas

goto your requisition with TA VA02 and well then add new items or increase the amount.
if that is not working on your system you may have customer based enhancements which forbid it.
arrrgh sry i thought you meant sales req, tho you wrote purchase...
Edited by: Florian Kemmer on May 26, 2009 9:52 AM

Similar Messages

  • How to increase the request timeout value in Oracle 10g web container

    Hi,
    Iam using Oracle10g Application server .
    For long running backend process my JSP page is getting re-submitted after 3 mins.
    How do i avoid this ?
    Is there a way to increase the http request timeout interval.
    If so where do i change the timeout interval.
    In IIS web server I can change the timeout interval.
    Thanks
    Sridhar.

    Hi,
    If you mean to increase the request timeout i.e the time when a request is submitted to the server and the response is sent by the server it can be done in httpd.conf file located in $OracleHome/Apache/Apache/conf directory.
    The attribute to be used for setting timeout is "Timeout". By default teh value is 600 seconds i.e 5 minutes.
    After making these changes , run command dcmctl updateConfig -ct OHS and restart the HTTP Server. Please note these commands need to be run only if the httpd.conf changes are done through text editor.
    Hope this helps.
    Smita

  • How do I update the requested quantity on an approved move order?

    Hi,
    can anybody tell me what would be the normal process if I want do update the quantity of an approved, but not transacted move order? Looks like I cannot do any chances if move order is approved, right?
    Would I create an additional line in case of increase and cancel the existing line in case of decrease of quantity?
    Which actions are possible on an approved move order besides transact?
    Thanks.

    This isn't somthing you have to worry about. The virus defs havn't been updated. This question comes up frequently, this is the last good answer, but if you want more detail you can search back further for a marcable answer.
    http://forum.cisco.com/eforum/servlet/NetProf?page=netprof&forum=Security&topic=Intrusion%20Prevention%20Systems/IDS&topicID=.ee6e1fc&CommCmd=MB%3Fcmd%3Dpass_through%26location%3Doutline%40%5E1%40%40.2cd2e515/0#selected_message

  • Tcode Lp10 requested quantity calculation.

    Hi Friends,
    I want to know logic for requested quantity calculation in LP10 as I see that there is stock available for the material but qty is not calcualted in requested quantity field.
    Thanks,
    Kiran

    Hi
    Requested quantity gets calculated based on how much left over stock you have in production supply area. Suppose in PSA available qty is 100pc and if you consumed only 70pc in the production order fow which you have staged it. SO left over stock will be will reduce the requested quantity by 30pc for next production order.
    In your that may have happened, at first instance there might be some leftover stock was available, while next if might have consumed by someone
    BR
    Kamal

  • Increase decimal places in the PO quantity and Price

    Hi All,
    Can the decimal places in the PO( ME21N) creation be increased more than 3 decimal places in quantity and price?
    I did changes in UOM's in CUNI, I increased the decimal places upto 14 but still it does not take more than three i-e., 0.001 maximum.
    Is there any other way to handle this?
    Request inputs on this.
    Note 569326 - ME9F: Customized decimal places are not taken into account........ found this OSS but this correction instruction is not for our pack level ECC 6.0
    Best regards,
    Sridhar

    hi
    In case if you are already working in production remember that decimal places should not change. It will affect all previous data.
    For your problem best solution is make order unit as 1000. So that your problem will solve
    e.g. instead of 2.009 inr for 1 Unit use 2009 inr for 1000 unit.

  • Increase the DB size in Azure gives the Error " Msg 40197, Level 16, State 1, Line 1 The service has encountered an error processing your request. Please try again. Error code 40671."

    Increase the DB size in Azure gives the following error
    Msg 40197, Level 16, State 1, Line 1 The service has encountered an error processing your request. Please try again. Error code 40671.
    i have used following ALTER query,
    ALTER DATABASE database_name MODIFY (EDITION='Business', MAXSIZE=10GB);
    Regards
    Vel

    Hi Taiye,
    According to your description, in theory, we can modify the size of database, and the T-SQL statement in your post is right. So we need to verify if there is no problem with network when you execute the modification statement, in addition, you must be connected
    to the master database when executing the ALTER DATABASE statement. As the error message, I recommend you login again and connect to the master database then run the statement again.
     For more information, see: ALTER DATABASE (Windows Azure SQL Database)
    If the error is still exist, the Microsoft support engineer will help to solve the problem from backend. Sometime delay might be expected. Your patience is greatly appreciated.
    Thanks,
    Sofiya Li
    If you have any feedback on our support, please click here.
    Sofiya Li
    TechNet Community Support

  • Unhandled Exception: System.TimeoutException: The request channel timed out while waiting for a reply after 00:01:59.9139778.Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding.

    Hi, 
    I created a simple plugin and since i wanted to use Early Binding i added Xrm.cs file to my solution.After i tried registering the plugin (using the Plugin Registration Tool) the plugin does not gets registered and i get the below mentioned Exception.
    Unhandled Exception: System.TimeoutException: The request channel timed out while waiting for a reply after 00:01:59.9139778. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this
    operation may have been a portion of a longer timeout.
    Server stack trace: 
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.Xrm.Sdk.IOrganizationService.Update(Entity entity)
       at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.UpdateCore(Entity entity)
       at Microsoft.Crm.Tools.PluginRegistration.RegistrationHelper.UpdateAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly, PluginType[] type)
       at Microsoft.Crm.Tools.PluginRegistration.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e)
    Inner Exception: System.TimeoutException: The HTTP request to 'https://demoorg172.api.crm.dynamics.com/XRMServices/2011/Organization.svc' has exceeded the allotted timeout of 00:01:59.9430000. The time allotted to this operation may have been a portion of a
    longer timeout.
       at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
    Inner Exception: System.Net.WebException: The operation has timed out
       at System.Net.HttpWebRequest.GetResponse()
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
    And to my Surprise after i remove the Xrm.cs file from my solution the Plugin got registered!
    Not understanding what exactly is the issue.
    Any Suggestions are highly appreciated.
    Thanks,
    Shradha
      

    Hello Shardha,
                            I really appreciate that you have faced this issue.This is really very strange issue and basically it occurs because of big size of your early bound class and slow internet
    connection.
                            I would strictly recommend you to reduce the file size of your early bound class and then register.By default early bound class is created for all the entities which are
    present in CRM(System entities as well custom entities).Such kind of early bound classes takes lots of time to register on server and hence timeout exception comes.
                            There is some standard define to reduce the size of early bound class.Please follow the link to get rid from big size of early bound class.
    Create a new C# class library project in Visual Studio called SvcUtilFilter.
    In the project, add references to the following:
    CrmSvcUtil.exe(from sdk)   This exe has the interface we will implement.
    Microsoft.Xrm.Sdk.dll  (found in the CRM SDK).
    System.Runtime.Serialization.
      Add the following class to the project:
    using System;
    using System.Collections.Generic;
    using System.Xml.Linq;
    using Microsoft.Crm.Services.Utility;
    using Microsoft.Xrm.Sdk.Metadata;
    namespace SvcUtilFilter
        /// <summary>
        /// CodeWriterFilter for CrmSvcUtil that reads list of entities from an xml file to
        /// determine whether or not the entity class should be generated.
        /// </summary>
        public class CodeWriterFilter : ICodeWriterFilterService
            //list of entity names to generate classes for.
            private HashSet<string> _validEntities = new HashSet<string>();
            //reference to the default service.
            private ICodeWriterFilterService _defaultService = null;
            /// <summary>
            /// constructor
            /// </summary>
            /// <param name="defaultService">default
    implementation</param>
            public CodeWriterFilter( ICodeWriterFilterService defaultService )
                this._defaultService = defaultService;
                LoadFilterData();
            /// <summary>
            /// loads the entity filter data from the filter.xml file
            /// </summary>
            private void LoadFilterData()
                XElement xml = XElement.Load("filter.xml");
                XElement entitiesElement = xml.Element("entities");
                foreach (XElement entityElement in entitiesElement.Elements("entity"))
                    _validEntities.Add(entityElement.Value.ToLowerInvariant());
            /// <summary>
            /// /Use filter entity list to determine if the entity class should be generated.
            /// </summary>
            public bool GenerateEntity(EntityMetadata entityMetadata, IServiceProvider services)
                return (_validEntities.Contains(entityMetadata.LogicalName.ToLowerInvariant()));
            //All other methods just use default implementation:
            public bool GenerateAttribute(AttributeMetadata attributeMetadata, IServiceProvider services)
                return _defaultService.GenerateAttribute(attributeMetadata, services);
            public bool GenerateOption(OptionMetadata optionMetadata, IServiceProvider services)
                return _defaultService.GenerateOption(optionMetadata, services);
            public bool GenerateOptionSet(OptionSetMetadataBase optionSetMetadata, IServiceProvider services)
                return _defaultService.GenerateOptionSet(optionSetMetadata, services);
            public bool GenerateRelationship(RelationshipMetadataBase relationshipMetadata, EntityMetadata otherEntityMetadata, IServiceProviderservices)
                return _defaultService.GenerateRelationship(relationshipMetadata, otherEntityMetadata, services);
            public bool GenerateServiceContext(IServiceProvider services)
                return _defaultService.GenerateServiceContext(services);
    This class implements the ICodeWriterFilterService interface.  This interface is used by the class generation
    utility to determine which entities, attrributes, etc. should actually be generated.  The interface is very simple and just has seven methods that are passed metadata info and return a boolean indicating whether or not the metadata should be included
    in the generated code file.   
    For now I just want to be able to determine which entities are generated, so in the constructor I read from an XML
    file (filter.xml) that holds the list of entities to generate and put the list in a Hashset.  The format of the xml is this:
    <filter>
      <entities>
        <entity>systemuser</entity>
        <entity>team</entity>
        <entity>role</entity>
        <entity>businessunit</entity>
      </entities>
    </filter>
    Take a look at the methods in the class. In the GenerateEntity method, we can simply check the EntityMetadata parameter
    against our list of valid entities and return true if it's an entity that we want to generate.
    For all of the other methods we want to just do whatever the default implementation of the utility is.  Notice
    how the constructor of the class accepts a defaultService parameter.  We can just save a reference to this default service and use it whenever we want to stick with the default behavior.  All of the other methods in the class just call the default
    service.
    To use our extension when running the utility, we just have to make sure the compiled DLL and the filter.xml file
    are in the same folder as CrmSvcUtil.exe, and set the /codewriterfilter command-line argument when running the utility (as described in the SDK):
    crmsvcutil.exe /url:http://<server>/<org>/XrmServices/2011/Organization.svc /out:sdk.cs  /namespace:<namespace> /codewriterfilter:SvcUtilFilter.CodeWriterFilter,SvcUtilFilter
    /username:[email protected] /password:xxxx
    That's it! You now have a generated sdk.cs file that is only a few hundred kilobytes instead of 5MB. 
    One final note:  There is actually a lot more you can do with extensions to the code generation utility. 
    For example: if you return true in the GenerateOptionSet method, it will actually generated Enums for each CRM picklist (which it doesn't normally do by default).
    Also, the source code for this SvcUtilFilter example can be found here. 
    Use at your own risk, no warranties, etc. etc. 
    Please mark as a answer if this post is useful to you.

  • How could increase the number of waiting request queue?

    how could increase the number of waiting request queue?
    thanks,

    I assume you're asking because you're getting connection refused exceptions? Set the AcceptBacklog parameter in the config.xml/via the console. Here's a description of the parameter:
    http://e-docs.bea.com/wls/docs81/config_xml/Server.html#AcceptBacklog

  • How to increase the quantity in KANBAN bin via BAPI or user exit?

    Hi everyone,
    Currently my interface is posting MIGO movement type 201 (Goods Issue with ref to Cost Centre).Stock in SLOC will decrese. Then my program will use BAPI (BAPI_KANBANCC_WITHDRAWQUANTITY) to update the qty in the KANBAN to reduce the qty. I'm using 9011 replenishment strategy with Reservation. Once KANBIN bin is EMPTY and the FULL button is clicked, a Reservation will be created for fulfillment.
    Now there is a new requirement to cater for 202 movement. Interface will post the 202 movement via the Gooods Movement Create BAPI. Stock in SLOC will increase.
    Question :
    For the KANBAN portion, which KANBAN BAPI or function can I use to increase the qty in the KANBAN bin to be in line with the 202 movement at the IM level?
    Eg if there is a 202 movement of 2 qty in the SLOC, the KANBAN bin will need to be increase by 2 qty as well.
    Thanks in advance
    LIM
    Singapore

    Hi gurus,
    In this case, can I use the KANBAN correction to increase the KANBAN bin qty?
    Thanks
    Lim
    Singapore

  • I cancelled the request of increasing the size of gmail in safari and it reloading continuously without entering the page, need help?

    I want to know how to increase the size again?

    Oh, thank you, I'm sorry, I hadn't understood what to do.
    Everything about the animated image is now fixed brilliantly - the size, the alignment, and the bottom isn't cut off. Thank you.
    The only thing I don't know what to do about now is how to have the static image load on ipad and iphone (because I understand that .swf files don't work on these devices). Currently the image doesn't load at all, it's blank space. Could you please advise how I should adapt the code to insert the static image if the device isn't flash compatible. The path of the static image is http://www.n2mediation.com/Fotolia_43355604_XL.jpg
    Thank you
    trix44

  • How do increase the font when requesting a print

    When I find it necessary to print a thread of question/answers the printed font size if incredibly small and for MR MAGOO a waste of ink and paper.
    Any tricks to increase the font size of the page(s) i want to print so that it is closer to 12 points ?
    There are some forums that have a print version of their forum web pages.

    Don Archibald wrote:
    Hi, mac midiguy -
    In many browsers, Command-+ (that's the + key on the keypad set) will increase the font size for text displayed on a page. That should carry through when you print the page.
    +I can increase the web page but it will not print the same size +
    >
    You can also select the text, across many entries in a thread including the entire thread if needed, then click on the selected text and drag it off onto the desktop where it should turn into a text document. You can then open that in a text app or word processor, change the text to a size that suits you, and then print it. This has the advantage that you can remove any elements/portions of the thread that don't contribute to the solution, or that you don't otherwise want.
    +Good hint: I'll try this when get to a computer with attached printer+

  • How to calculate the OPEN QUANTITY in delivery Duelist Report

    Hi Everybody,
       I have a query for finding out the OPEN QUANTITY for schedulines for a delivery.
    If for example the report is run for 2nd of February, it is necessary to
    determine whether there are delivery relevant schedule lines before the
    2nd.
    If yes, we need to know whether there is an open quantity to this line
    item.
    If yes, this open quantity is a negative deviation (we delivered not
    enough).
    If there is no open quantity it is necessary to determine whether for the
    earliest future to be deleviered schedule line, the open quantity equals
    the ordered quantity (VBEP-WMENG),
    if No the the difference between both values equals the positive deviation
    (we delivered more than requested)
    If the open quantity equals the ordered quantity there is no deviation.
    The problem is to calculate the open quantity and the SAP standard there is function
    builder used in SAP standard include MV45AF0O_OFFENE_WERTE_ERMITTEL, the
    function builder is called RV_SCHEDULE_CHECK_DELIVERIES'. But how could we use in this formulae in a Custom delivery report.
    Looking for your helpful suggestions.
    Many thanks in Advance,
    Mira Saikrishna

    Krishna....have a look in the below threads where there was a similar requirement..
    error while using BAPI_OUTB_DELIVERY_CHANGE
    change outbound delivery

  • WM-production order-need change the open quantity in Transfer order

    Hi,
       I created the production order (order quantity 1000).  i did material staging and generated TR. .
       But i need to change the open quantity in transfer order . i need to create the partial Transfer order
        against TR..
       KINDLY SUGGEST ME
       WITH REGARDS
       Dinesh

    Hi Dinesh,
    TO for partial qty is possible.
    When you are doing material staging with 319 mov.type, you create a transfer order for partial quantity as follows:
    You first create a manual transfer order using transaction LT04.
    You specify the TR number in the intial screen and navigate to the detail screen, system shows the Open TR quantity and the proposed TO quantity. By default, both these quantities are equal to the TR quantity.
    However, when you create by clicing the "Create TO button" (the icon with a plus sign in the tool bar of LT04 screen), system takes you to another screen where it asks for the "Requested Qty" on the top of the screen.  Here you can modify the qty as per your requirement; then you can check and confirm the storage type and storage bin for source and destination stocks & save.
    It is important that you give the correct source storage type & storage bin that is having stock or otherwise system might give error message.
    System will create a TO line item with the entered qty and propose the balance TR qty as the 2nd TO line item. You can skip this 2nd TO item or delete it from the TO.
    Once again, if you click the Save button, system will save the TO with the partial quantity.
    The balance quantity will be available in the TR as open quantity and this can be seen in the header data of transaction LB03.
    Regards
    Prabhu

  • Urgent: regarding the increasing the performance of report

    Hi,
    I had a report which is displaying the correct data but i execute on PRD Server,it gets Request Time Out.So i want to increase the performance of it.Plzz help me out in doing this.
    REPORT  ZWIP_STOCK NO STANDARD PAGE HEADING LINE-SIZE 150.
    TABLES: AFPO, AFRU, MARA, MAKT.
    DATA: BEGIN OF ITAB OCCURS 0,
          AUFNR LIKE AFPO-AUFNR,
          MATNR LIKE AFPO-MATNR,
          LGORT LIKE AFPO-LGORT,
          MEINS LIKE MARA-MEINS,
          NTGEW LIKE MARA-NTGEW,
          MTART LIKE MARA-MTART,
          STOCK TYPE P LENGTH 10 DECIMALS 3,
          END OF ITAB.
    DATA : ITAB2 LIKE ITAB OCCURS 0 WITH HEADER LINE.
    DATA : DESC LIKE MAKT-MAKTX.
    SELECT-OPTIONS : MAT_TYPE FOR MARA-MTART.
    SELECT-OPTIONS : P_MATNR FOR AFPO-MATNR.
    DATA : V_MINOPR LIKE AFRU-VORNR,
           V_MAXOPR LIKE AFRU-VORNR,
           V_QTYMIN LIKE AFRU-GMNGA,
           V_QTYMAX LIKE AFRU-GMNGA,
           V_QTY TYPE P LENGTH 10 DECIMALS 3.
            SELECT AAUFNR AMATNR ALGORT BMEINS BNTGEW BMTART FROM AFPO AS A
              INNER JOIN MARA AS B ON AMATNR = BMATNR
                INTO TABLE ITAB WHERE ELIKZ <> 'X' AND MTART IN MAT_TYPE AND A~MATNR IN P_MATNR.
        ITAB2[] = ITAB[].
        SORT ITAB2 BY MATNR MEINS MTART NTGEW.
        DELETE ADJACENT DUPLICATES FROM ITAB2 COMPARING MATNR MEINS MTART NTGEW.
       LOOP AT ITAB2.
        V_QTY = 0.
          LOOP AT ITAB WHERE MATNR = ITAB2-MATNR.
            SELECT MIN( VORNR ) INTO V_MINOPR FROM AFRU WHERE AUFNR = ITAB-AUFNR.
            SELECT MAX( VORNR ) INTO V_MAXOPR FROM AFRU WHERE AUFNR = ITAB-AUFNR.
            SELECT SUM( GMNGA ) INTO V_QTYMIN FROM AFRU WHERE AUFNR = ITAB-AUFNR AND VORNR =  V_MINOPR.
            SELECT SUM( GMNGA ) INTO V_QTYMAX FROM AFRU WHERE AUFNR = ITAB-AUFNR AND VORNR =  V_MAXOPR.
            V_QTY = V_QTY + V_QTYMIN - V_QTYMAX.
          ENDLOOP.
          ITAB2-STOCK = V_QTY.
          MODIFY ITAB2.
        ENDLOOP.
        LOOP AT ITAB2.
              WRITE:/ ITAB2-MATNR,ITAB2-STOCK.
        ENDLOOP.

    Instead of code from
    itab2[] = itab[] till last endloop try code given below
    data : begin of minopr occurs 0,
           aufnr type afru-aurnr,
           vornr type afru-vornr,
           end of minopr.
    data : begin of maxopr occurs 0,
           aufnr type afru-aurnr,
           vornr type afru-vornr,
           end of maxopr.
    data : begin of qtymin occurs 0,
           aufnr type afru-aurnr,
           vornr type afru-vornr,
           end of qtymin.
    data : begin of qtymax occurs 0,
           aufnr type afru-aurnr,
           vornr type afru-vornr,
           end of qtymax.
    select aurnr vornr into table minopr from afru for all entries in itab where aurnr = itab-aufnr
    maxopr[] = minopr[].
    sort minopr by aufnr vornr ascending.
    sort maxopr by aufnr vornr descending.
    delete adjacent duplicates from minopr comparing aufnr.
    delete adjacent duplicates from maxopr comparing aufnr.
    SELECT aufnr vornr GMNGA INTO TABLE QTYMIN FROM AFRU for all entries in minopr WHERE AUFNR = minopr-AUFNR AND VORNR = MINOPR-vornr.
    SELECT aufnr vornr GMNGA INTO TABLE QTYMAX FROM AFRU for all entries in maxopr WHERE AUFNR = maxopr-AUFNR AND VORNR = maxopr-vornr.
    sort qtymin by aufnr.
    sort qtymax by aufnr
    sort itab by matnr MEINS MTART NTGEW.
    LOOP AT ITAB.
    v_minopr = 0.
    v_maxopr = 0.
    read table qtymin with key aufnr = itab-aufnr binary search.
    if sy-subrc = 0.
    loop at qtymin from sy-tabix.
    if qtymin-aufnr = itab-aufnr.
    V_MINOPR = V_MINOPR + itab-gmnga.
    else.
    exit.
    endif.
    endloop.
    endif.
    read table qtymax with key aufnr = itab-aufnr binary search.
    if sy-subrc = 0.
    loop at qtymax from sy-tabix.
    if qtymax-aufnr = itab-aufnr.
    V_MaxOPR = V_MaxOPR + itab-gmnga.
    else.
    exit.
    endif.
    endloop.
    endif.
    V_QTY = V_QTY + V_QTYMIN - V_QTYMAX.
    At new itab-matnr.
    if sy-tabix = 1.
    continue.
    endif.
    itab2 = itab.
    itab2-stock = v_qty.
    append itab2.
    V_QTY = 0.
    endat.
    ENDLOOP.
    itab2 = itab.
    itab2-stock = v_qty.
    append itab2.
    LOOP AT ITAB2.
    WRITE:/ ITAB2-MATNR,ITAB2-STOCK.
    ENDLOOP.

  • How to add new increase the pool rather then trowing a error.

    Im trying to build a game and after many attempts and hours of thinking i did manage to create something that looks like a game.The problem now is that there are so many objects that are constantly creating and removing from the stage. that the game is starting to slow down(it is laggy.).So i have searched the net and understood that i will have to use a "Object pooling Method" rather than creating and removing the objects after i dont have any use of them any more, if i want to make the game more memory friendly.
    At first i didnt want to use this method (object pooling) ,but after a while i understood that i dont have a lot of options.So i started to search how and why and how.
    Yet in this example im just trying this for the bullets (for now) cause if i can do it for them, i can manage to do it for other objects and projects (it will be simple for me to understand what is happening ., what am i doing , when do i add an existing object from the pool and when im creating a new one(when there are non left, things like this)
    i did copy some part of this code from a tutorial that i found in the net but , from then i dont know how to increase the pool rather than throwing this error. I did try to create a new object or to increase the pool length but .... it is not working so im sure that im not doing something the way it must be done.
    so i have this so far :
    its a "simple" pool that calls a simple shape class (circle dot) and gives that to the main stage when the "SPACE" button is pressed
    package
              import flash.display.Sprite;
              import flash.events.Event;
              import flash.display.Bitmap;
              import flash.display.BitmapData;
              import flash.display.Shape;
              public class Bullet extends Sprite{
                        public var  rectangle:Shape = new Shape();
                        public function Bullet(){
                                  super();
                                  addEventListener(Event.ADDED_TO_STAGE, init);
                                  graphics.beginFill(0xFF0000);
                                  graphics.drawRect(-5, -5, 10,10);
                                  graphics.endFill();
                        private function init(event:Event):void{
    the SpritePool where i cant figure out how to replace the throw new error with some new code that will increase the pool
    package {
              import flash.display.DisplayObject;
              public class SpritePool {
                        private var pool:Array;
                        private var counter:int;
                        public function SpritePool(type:Class, len:int) {
                                  pool = new Array();
                                  counter = len;
                                  var i:int = len;
                                  while (--i > -1) {
                                            pool[i] = new type();
                        public function getSprite():DisplayObject {
                                  if (counter > 0) {
                                            return pool[--counter];
                                  } else {
                                            throw new Error("You exhausted the pool!");
                        public function returnSprite(s:DisplayObject):void {
                                  pool[counter++] = s;
    and the Game class (the documents class)
    package {
              import flash.ui.Keyboard;
              import flash.display.Sprite;
              import flash.events.Event;
              import flash.events.KeyboardEvent;
              import flash.display.Bitmap;
              import flash.display.BitmapData;
              import flash.display.Shape;
              public class Game extends Sprite {
                        private var ship:Shape;
                        private var bullets:Array;
                        private var pool:SpritePool;
                        public function Game() {
                                  Assets.init();
                                  addEventListener(Event.ADDED_TO_STAGE, init);
                        private function init(event:Event):void {
                                  pool = new SpritePool(Bullet,10);
                                  bullets = new Array();
                                  ship = new Shape();
                                  ship.graphics.beginFill(0xFF00FF);
                                  ship.graphics.drawRect(0,0, 60, 60);
                                  ship.graphics.endFill();
                                  ship.x = stage.stageWidth / 2 - ship.width / 2;
                                  ship.y = stage.stageHeight - ship.height;
                                  addChild(ship);
                                  stage.addEventListener(KeyboardEvent.KEY_DOWN, onDown);
                                  addEventListener(Event.ENTER_FRAME, loop);
                        private function onDown(event:KeyboardEvent):void {
                                  if (event.keyCode == Keyboard.SPACE) {
                                            var b:Bullet = pool.getSprite() as Bullet;
                                            b.x = ship.x + ship.width / 2;
                                            b.y = ship.y;
                                            addChild(b);
                                            bullets.push(b);
                                            trace("Bullet fired");
                        private function loop(event:Event):void {
                                  for (var i:int=bullets.length-1; i>=0; i--) {
                                            var b:Bullet = bullets[i];
                                            b.y -=  10;
                                            if (b.y < 0) {
                                                      bullets.splice(i, 1);
                                                      removeChild(b);
                                                      pool.returnSprite(b);
                                                      trace("Bullet disposed");
    any suggestions/help how to do it

    To put you on the path (the errors/events needs formalization), here would be a quick example. Your pool class:
    package
              import flash.display.DisplayObject;
              public class SpritePool
                        private var pool:Array;
                        private var counter:int;
                        private var classRef:Class;
                        // public get to know what's left in the pool
                        public function get availableObjects():int
                                  return counter;
                        public function SpritePool(type:Class, len:int)
                                  classRef = type;
                                  pool = new Array();
                                  counter = len;
                                  var i:int = len;
                                  while (--i > -1)
                                            pool[i] = new classRef();
                        public function getSprite():DisplayObject
                                  if (counter > 0)
                                            return pool[--counter];
                                  else
                                            throw new Error("PoolExhausted");
                        public function returnSprite(s:DisplayObject):void
                                  pool[counter++] = s;
                        public function increasePool(amount:int):void
                                  counter += amount;
                                  while (--amount > -1)
                                            pool.push(new classRef());
                        public function decreasePool(amount:int):void
                                  if (counter >= amount)
                                            counter -= amount;
                                            pool.splice(counter - amount,amount);
                                  else
                                            throw new Error("PoolDecreaseFail");
    Now you'd need to be catching those errors. Again, the errors should be formalized or you could use events by extending IEventDispatcher. I kept it simple.
    Here would be the simple Bullet class I'm using:
    package
              import flash.display.Sprite;
              public class Bullet extends Sprite
                        private var bullet:Sprite;
                        public function Bullet():void
                                  var bullet:Sprite = new Sprite();
                                  bullet.graphics.beginFill(0xFF0000,1);
                                  bullet.graphics.drawCircle(-5,-5,10);
                                  bullet.graphics.endFill();
                                  addChild(bullet);
    Just draws a red circle just to visualize it..
    Here would be a full example of using it. It will import both of these classes (saved as SpritePool.as and Bullet.as in the same folder). Paste this in the actions panel on frame 1:
    import SpritePool;
    import Bullet; // a simple red 10px circle
    import flash.display.Sprite;
    import flash.utils.setTimeout;
    // fill the pool, swim trunks optional
    var pool:SpritePool = new SpritePool(Bullet, 10);
    // grab some objects from the pool
    // array of currently held objects
    var myBullets:Array = new Array();
    while (pool.availableObjects > 0)
              myBullets.push(pool.getSprite());
    // display in random positions
    for (var i:int = 0; i < myBullets.length; i++)
              addChild(myBullets[i]);
              // position
              myBullets[i].x = int(Math.random()*stage.stageWidth);
              myBullets[i].y = int(Math.random()*stage.stageHeight);
    trace("myBullets has " + myBullets.length + " bullets! pool has " + pool.availableObjects + " left.");
    // now I want one more, but I should check for errors
    try
              // fail, none left!
              myBullets.push(pool.getSprite());
    catch (e:*)
              // this should be a custom event, but for speed, quick and dirty
              if (e == 'Error: PoolExhausted')
                        trace("D'oh no more bullets! I need more!");
                        pool.increasePool(10);
                        trace("Added 10 more, now available in pool " + pool.availableObjects);
    // try to reduce the pool by 15, which should error
    try
              pool.decreasePool(15);
    catch (e:*)
              // again should be a formal error
              if (e == 'Error: PoolDecreaseFail')
                        trace("Oops, can't reduce pool by 15! Let's trim all extras, available is " + pool.availableObjects);
                        // we know it'll work, no error checking
                        pool.decreasePool(pool.availableObjects);
                        trace("Left in pool: " + pool.availableObjects);
    // now lets wait 5 seconds and remove it all back to the pool
    setTimeout(ReturnToPool,5000);
    function ReturnToPool():void
              // now let's just return all the objects to the pool
              while (myBullets.length > 0)
                        removeChild(myBullets[myBullets.length - 1]);
                        pool.returnSprite(myBullets.pop());
              // now check the pool, should have 10
              trace("Amount of bullets in use " + myBullets.length + ", in pool " + pool.availableObjects);
    For ease you can just download my example source (saved down to CS5).
    Anything from here is just symantics. For example instead of throwing an error because the pool is too small you could simply increase the pool by a fixed amount yourself and return the objects requested.
    To keep objects as low as possible you could use a timer to measure the amount of objects in use over a duration and reduce the pool appropriately, knowing the pool will grow as it needs.
    All of this is just to avoid unnecessary object creation.
    BTW here's my trace which should match yours:
    myBullets has 10 bullets! pool has 0 left.
    D'oh no more bullets! I need more!
    Added 10 more, now available in pool 10
    Oops, can't reduce pool by 15! Let's trim all extras, available is 10
    Left in pool: 0
    (after 5 seconds)
    Amount of bullets in use 0, in pool 10

Maybe you are looking for