Error while doing MIRO-Overflow for arithmetical operation (type P) in prog

Hi ,
I am getting the error while doing the MIRO  as below-
Runtime Errors         COMPUTE_BCD_OVERFLOW
Exception              CX_SY_ARITHMETIC_OVERFLOW
Date and Time          20.05.2009 10:07:03
Short text
     Overflow during the arithmetical operation (type P) in program "SAPLMRMC".
What happened?
     Error in the ABAP Application Program
     The current ABAP program "SAPLMRMC" had to be terminated because it has
     come across a statement that unfortunately cannot be executed.
What can you do?
     Note down which actions and inputs caused the error.
     To process the problem further, contact you SAP system
     administrator.
     Using Transaction ST22 for ABAP Dump Analysis, you can look
     at and manage termination messages, and you can also
     keep them for a long time.
Error analysis
     An exception occurred that is explained in detail below.
     The exception, which is assigned to class 'CX_SY_ARITHMETIC_OVERFLOW', was not
      caught in
     procedure "MRM_AMOUNT_QUANTITY_PROPOSE" "(FUNCTION)", nor was it propagated by
      a RAISING clause.
     Since the caller of the procedure could not have anticipated that the
Please let me know how can this be removed.

Hi,
There can be some problem with tolerances set in the customizing.
In my case, I was getting this error because of delivery date variance. The difference between delivery date maintained in PO and invoice date was huge and hence the multiplication of price of PO and difference  of delivery date was huge and that was the reason for error.
Similarly in your case also, there will be some tolerance limit problem.
Please check your tolerance limits set in customizing.
Regards,
Mihir Popat

Similar Messages

  • Overflow for arithmetical operation (type P) in program.

    Hi experts..
    I had developed a report for showing total receipt and issues and confirmed issue.
    of PQ.
    For all the plant is running fine but only for one plant 2050 its going into dump and error is "Overflow for arithmetical operation (type P) in program." and the code line is
    T_EKET-MNG02 = T_EKET-MNG02 * ( t_mdbs-umrez / t_mdbs-umren ).
    MNG02 IS OF TYPE  Data : "Quan", length =13 , decimal = 3.
    initially : value in Mng02 is =  10       and ratio is 11/8 = 1.375
                  and in the debugging the value is   10*1.375 = 13.75
    but... when i am executing it .. its going into dump and after again checking the MNG02 is showing valude --9765133613.881  and the above error.
    what should i do....
    please help..
    i will award the points for every help...
    thanks

    Hi,
    Are you doing any other calculation for field MNG02 in your program?
    I created a small program with the field and values you have mentioned and it gave me the result 13.75 and no short dump.
    Please check following things:
    When short dump occurs, it shows at which line it has occured. Is it showing that the shortdump has occurs on the line you are talking about here or it is somewhere else.
    Also, when shortdump occurs, it shows a "debugging" button at the top. Hit that button and it will show you exactly where the short dump has occured. What ever this statement is, check what are the values of different variables here.
    Check all these and you might get the answer. Let me know if you still have problem.
    Regards,
    RS

  • Account dertermination error while doing MIRO for third party PO

    Hello,
    This is regarding error message while doing MIRO (IR)
    There is already a PO in the system with item category S ( Third Party ) &
    Acc assignment object u2013 C (Sales order).
    For this PO , I could find 10 invoices already posted in the system.
    Between when these invoices were posted , there were some changes done to the PO.
    But even after those changes , many invoices were posted in the system,
    But now , when I try to post the invoice , I am getting the below error message.
    the error message is ** Account determination for entry SKPL WRX 0002 _ 1020 not possible** while posting.
    Message no. M8147
    Diagnosis
    The system did not find an account for this transaction. This means that the account determination for key SKPL WRX 0002 _ 1020 is not maintained in MM Customizing (Valuation). The key is made up of:
    u2022 Chart of account
    u2022 Transaction key (= Posting transaction)
    u2022 Valuation grouping code
    u2022 Account grouping code
    u2022 Valuation class
    System Response
    The system cannot update a G/L account for this transaction. You cannot post the transaction.
    Procedure
    Contact your system administrator.
    If you have the authorization, check the Account determination in Customizing for Valuation.
    Proceed
    Note
    The relevant posting transaction can be found in Table T030A.
    I have checked the entry in OMWD, where valuation grouping code is maintained against the valuation area & company code.
    PLEASE SUGGEST ME SOME SOLUTION.
    Thanks,
    Vinoth

    Hi Raman,
    Yes, still i am getting error.
    before when the invoice is posted , there is no error.
    there are some 10 invoices posted already , but there are some changes done in the PO , after that they could post two invoices but for the third invoice , i am getting this error.
    when the invoive is posted without error , these are the account movements that are hit
    Here
    441510 is a vendor account
    61799410 is a WBS element G/L account
    27411000 is a G/L for tax.
    What could have pulled out this WRX error (Account determination for entry SKPL WRX 0002 _1020 not possible ) for me????
    can u suggest me some solutions.
    Thanks,
    Vinoth

  • Error while doing miro of network purchase order ( no funds center entered/

    Hi,
    we are facing one problem while doing miro of network  service purchase order. System is giving message 'No funds center entered/derived in item 00030'.
    We have activated funds management in Jul'10. The said network service PO belong to previous year. Also we have changed
    commitment item of GL account related to concerned service order in Jul'10 & posted GRN one in apr'10 & one aug'10.
    System is not allowing to cancel the service entry sheet.
    Can anybody help on this.
    regards
    abhishek

    we had activated the trace facility for FMDEIRIVE & found that all FC/Commitment item derived correctly. But while posting the document it is throwing an error.
    Regards
    Abhishek

  • Error while doing MIRO

    Hello Everybody,
    I am trying to do MIRO for a Purchase Order.
    But I see the following error while doing that -
    "G/L account  is not defined in chart of accounts 1000".
    Can someone tell me whats going wrong and where do I have to check to set the following conditions right for a MIRO posting to be done?
    Please help. All the help is appreciated.
    Thanks,
    Sneha.

    Hello Sneha singh
    In addition to Mr.srinath's suggestions please check whether you have maintained Reconsallation account for your vendor in the Vendor masterdata in XK01 in the company code level
    have you maintained properly the OBYC settings (take the help of your MM or FI consultant for this) and also check in OMWD whether the valuation grouping 0001 code is assigned to your plant
    Mostly along with Mr.Srinath's suggestions  Reconsallation account checkings in the Vendor masterdata in XK01 should solve your issue
    Regards
    Raja

  • Error while doing MIRO-Perform Plan price

    Hi ,
    We are on ECC 6 and we are getting error as "Perform Plan price for the material" while doing MIRO.
    *Information:*
    Price is different in Purchase requisition and PO&GR.MM03 is having proce control as "S" and the M Master is having both Moving price and standard price.
    I tried changing the price through MR21 but still didn't worked.
    Pl let me know if you need more info..
    Thanks a lot in advance for early reply.
    Govind

    Hi,
    Thanks for the reply. Since we are not using GR feature and we have not reversed the GR anytime.
    Regards,
    Lovkesh

  • Error while doing Goods receipt for process order. Error code: "BS027"

    I am getting error while doing GR for a day whereas previous day(s) GR is already done and also 2 days post that day are also done successfully.
    Error :  ""Goods receipt for prodn. order" is not allowed (ORD XX-CEMTSAL) " (XX = First two characters of plant code)
    Error code: BS027.
    Thanks to all in advance.

    Hello,
    This issue would occur when you want to post a confirmation for a production order. The error message is generated if you wanted to post a backflush for a component and if this component was assigned to a sales order stock. The sales order itself was assigned to a work breakdown structure element which should be debited with the actual costs. However, the business transaction 'Confirm' is not permitted for a work breakdown structure.
    Please look into SAP Note 62367 and 64370
    Hope the information is helpful
    regards

  • Run time error while doing VL10B transaction for STO

    Dear All,
    We are facing problem of run time error while creating Delivery (VL10B) for  STO .We have two company codes .For one company code its working fine .But we are trying for another company code ,this error coming.error detals
    Error in the ABAP Application Program
    The current ABAP program "SAPLV05I" had to be terminated because it has
    come across a statement that unfortunately cannot be executed.
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not cau
         in
        procedure "SD_PARTNER_UPDATE" "(FUNCTION)", nor was it propagated by a RAI
         clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        If you use an ABAP/4 Open SQL array insert to insert a record in
        the database and that record already exists with the same key,
        this results in a termination.
        (With an ABAP/4 Open SQL single record insert in the same error
    Kindly suggest as to how to resolve this asap.
    regards
    umesh

    These Kind of Errors Generally Occor for the wrong maitnaince of the partner functions. If you are using any user exits to detremine the partner functions. check the logic in that routine.
    Because we do frequently get this error, but only if we hae not maintained as per the rule written in the  user exit..
    The USer exits for partner Determiantion to check is Function Module EXIT_SAPLV09A_003.  THis gets activated, if you have give the source parner function as "X/Y/Z" in your partenr determiantion procedures.

  • Compensation Planning - Error while doing the planning for Employee

    Hi Friends,
    We have implemented standard MSS Business package.
    Line Mangers are using the Compensation Planning Iview and are facing errors while sending it for further approvals.
    In the steps.
    In the last step they get  RFC_ERROR_SYSTEM_FAILURE.
    A critical error has occurred. Processing of the service was terminated.
    Access via NULL Object reference not possible.,error key : RFC_ERROR_SYSTEM_FAILURE.
    Also to note that while doing the planning we get " No budget Data available"
    Is budget data mandatory to complete planning. However in test systems we were able to run the complete cycle even without the budget data we were able to complete one cycle.
    Kindly advise .
    Thanks
    Santosh

    Hello..
    This might point to an unhanded exception. There should be a backend dump (ST22) available and that would help in more analysis. You might need a ABAPer to look into the dump. You may paste the dump here for more analysis.

  • ABAP RUNTIME ERROR WHILE DOING MIRO

    Runtime Errors                                                       MESSAGE_TYPE_X                              
    Date and Time                                                       23.02.2011                    17:07:24          
    Short dump has not been completely stored (too big)                                                                                     
         Short text                                                                                
                   The current application triggered a termination with a short dump.                                                                      
         What happened?                                                                                
                   The current application program detected a situation which really                                                                      
                   should not occur. Therefore, a termination with a short dump was                                                                      
                   triggered on purpose by the key word MESSAGE (type X).                                                                      
         What can you do?                                                                                
                   Note down which actions and inputs caused the error.                                                                      
                   To process the problem further, contact you SAP system                                                                      
                   administrator.                                                                      
                   Using Transaction ST22 for ABAP Dump Analysis, you can look                                                                      
                   at and manage termination messages, and you can also                                                                      
                   keep them for a long time.                                                                      
         Error analysis                                                                                
                   Short text of error message:                                                                      
                   Error creating the document in Profitability Analysis                                                                      
                   Long text of error message:                                                                      
                    Diagnosis                                                                      
                        An error was found while the system was processing the FI/CO                                                                      
                        document in Profitability Analysis.                                                                      
                    System Response                                                                      
                        The document cannot be processed any further.                                                                      
                    Procedure                                                                      
                        Contact your system administrator.                                                                      
                   Technical information about the message:                                                                      
                   Message class....... "KE"                                                                      
                   Number.............. 476                                                                      
                   Variable 1.......... " "                                                                      
                   Variable 2.......... " "                                                                      
                   Variable 3.......... " "                                                                      
                   Variable 4.......... " "                                                                      
         How to correct the error                                                                                
                   Probably the only way to eliminate the error is to correct the program.                                                                      
                   If the error occures in a non-modified SAP program, you may be able to                                                                      
                   find an interim solution in an SAP Note.                                                                      
                   If you have access to SAP Notes, carry out a search with the following                                                                      
                   keywords:                                                                      
                   MESSAGE_TYPE_X " "                                                                      
                   RK2RF001 or "RKEVRK2R_FIX"                                                                      
                   MOVE_VALUE_FIELDS_FI                                                                      
                   If you cannot solve the problem yourself and want to send an error                                                                      
                   notification to SAP, include the following information:                                                                      
                   1. The description of the current problem (short dump)                                                                      
                      To save the description, choose "System->List->Save->Local File                                                                      
                   (Unconverted)".                                                                      
                   2. Corresponding system log                                                                      
                      Display the system log by calling transaction SM21.                                                                      
                      Restrict the time interval to 10 minutes before and five minutes                                                                      
                   after the short dump. Then choose "System->List->Save->Local File                                                                      
                   (Unconverted)".                                                                      
                   3. If the problem occurs in a problem of your own or a modified SAP                                                                      
                   program: The source code of the program                                                                      
                      In the editor, choose "Utilities->More                                                                      
                   Utilities->Upload/Download->Download".                                                                      
                   4. Details about the conditions under which the error occurred or which                                                                      
                   actions and input led to the error.                                                                               
    System environment                                                                                
                   SAP-Release 701                                                                      
                   Application server... "FPELECCPRD"                                                                      
                   Network address...... "192.168.0.24"                                                                      
                   Operating system..... "Windows NT"                                                                      
                   Release.............. "6.0"                                                                      
                   Hardware type........ "16x AMD64 Level"                                                                      
                   Character length.... 16 Bits                                                                      
                   Pointer length....... 64 Bits                                                                      
                   Work process number.. 1                                                                      
                   Shortdump setting.... "full"                                                                      
                   Database server... "FPELECCPRD\FTP"                                                                      
                   Database type..... "MSSQL"                                                                      
                   Database name..... "FTP"                                                                      
                   Database user ID.. "ftp"                                                                      
                   Terminal.......... "PUNE143"                                                                      
                   Char.set.... "C"                                                                      
                   SAP kernel....... 701                                                                      
                   created (date)... "Feb 24 2009 23:27:20"                                                                      
                   create on........ "NT 5.2 3790 Service Pack 1 x86 MS VC++ 14.00"                                                                      
                   Database version. "SQL_Server_8.00 "                                                                      
                   Patch level. 32                                                                      
                   Patch text.. " "                                                                      
                   Database............. "MSSQL 9.00.2047 or higher"                                                                      
                   SAP database version. 701                                                                      
                   Operating system..... "Windows NT 5.0, Windows NT 5.1, Windows NT 5.2, Windows                                                                      
                    NT 6.0"                                                                      
                   Memory consumption                                                                      
                   Roll.... 16192                                                                      
                   EM...... 29328880                                                                      
                   Heap.... 0                                                                      
                   Page.... 221184                                                                      
                   MM Used. 20281392                                                                      
                   MM Free. 664288                                                                      
         User and Transaction                                                                                
                   Client.............. 900                                                                      
                   User................ "FABUPLO"                                                                      
                   Language key........ "E"                                                                      
                   Transaction......... "MIRO "                                                                      
                   Transactions ID..... "1C413FE0E2E7F1C88D54E61F1346F073"                                                                      
                   Program............. "RK2RF001"                                                                      
                   Screen.............. "SAPLMR1M 6000"                                                                      
                   Screen line......... 34                                                                      
         Information on where terminated                                                                                
                   Termination occurred in the ABAP program "RK2RF001" - in                                                                      
                    "MOVE_VALUE_FIELDS_FI".                                                                      
                   The main program was "SAPLMR1M ".                                                                      
                   In the source code you have the termination point in line 2749                                                                      
                   of the (Include) program "RKEVRK2R_FIX".

    Hi
    Normally what we understand is we should not have a COPA doc in case of MIRO unless and untill one has got the Purchase Price Variance in the entry  and for the same the OKB9 setting has been made while the GL account either doesnot have cost element for the period or the PA structure is not complete.
    The above can be the probable reason for the dump. I hope if you try to investigate the problem on the above line you will find out the solution to the problem
    regards
    Debashis

  • Error while doing risk analysis for a user

    Hi ,
    When i did risk analysis at user level for a particular user we are getting this error under level  ."Exception!!. No relavent language message available in database for :0292".I had reuploaded the the messages text file but still the error persists i have restarted the j2ee application but still the error is not going .any pointers please thanx in advance.When checked the file CC5.3_MESSAGES.txt it does not contain any entry corresponding to message code 0292.So how shud i proceed.
    Edited by: Ambarish annapureddy on Jan 21, 2009 12:54 PM

    Hi Ambarish,
        What is the patch level of GRC AC 5.3? Did you apply any service pack recently? Did the service pack contain any message file? There has to be some message file which contains message '0292'. If you can not find the message file then open a message with SAP support and they should be able to provide it to you.
    Regards,
    Alpesh

  • Error while doing Goods Receipt for Production Order

    We have created following test data in our Development System:
    Production Order:1000016
    We have processed the abv. production order thru create, release & confirm stages.However, on doing Goods Receipt of the Order thru MB31, system is giving following error:
    Msg.No.NA M7001:Check Table TFBEFU_CR entry 10 does not exist.
    Can u pl help me in analysing the same.
    With Rgds.,
    Rakesh Kumar
    09324847499

    Hi,
    Maintain the OPK9 (Valuation Variant for the Order Costing).
    It will go thorugh..
    Otherwise revert for further discussion..
    Regards,
    Siva

  • Error while doing connection test for a jdbc system

    Hi all,
    i created a JDBC system. i gave all the required information for creating it like username, passowrd, connection URL, driver class name.
    i even did the user mapping. But still when i try the connetion test it is giving me an error.
    the error message that is visible in the front end is like follows
    <i>Test Connection with Connector - Jan 1, 1970 2:29:41 PM
      Test Details:
    The test consists of the following steps:
    1. Retrieve the default alias of the system
    2. Check the connection to the backend application using the connector defined in this system object
      Results
    Retrieval of default alias successful
    Connection failed. Make sure user mapping is set correctly and all connection properties are correct.</i>
    when i c the log files i noticed the following log messages
    <b>
    #1.5#00065BF80BD800660000000000000C6C000414205F93044C#1148029181853#/System/Server#sap.com/irj#com.sap.portal.ivs.semantic.systemLandscape#Administrator#435####cf4424d0e71511da940a00065bf80bd8#D:/Triniti_Deployment_Source/infrastructure/fdt/WEB-INF/classes
    fdtout.log##0#0#Warning#1#com.sap.portal.ivs.semantic.systemLandscape#Java###Failed to retrieve Password##
    #1.5#00065BF80BD800660000000100000C6C000414205F93059D#1148029181853#/System/Server#sap.com/irj#com.sap.portal.ivs.semantic.systemLandscape#Administrator#435####cf4424d0e71511da940a00065bf80bd8#D:/Triniti_Deployment_Source/infrastructure/fdt/WEB-INF/classes
    fdtout.log##0#0#Warning#1#com.sap.portal.ivs.semantic.systemLandscape#Java###Failed to retrieve User##
    #1.5#00065BF80BD800660000000200000C6C000414205F930770#1148029181853#/System/Server#sap.com/irj#com.sap.portal.ivs.connectorService#Administrator#435####cf4424d0e71511da940a00065bf80bd8#D:/Triniti_Deployment_Source/infrastructure/fdt/WEB-INF/classes
    fdtout.log##0#0#Error#1#com.sap.portal.ivs.connectorService#Java###Failed to get connection for system #1#Dummy_JDBC_System#
    </b>
    can any one please tell me where i am going wrong.
    thanks in advance
    Pavan Kumar.

    Hi Pavan
    i see the log file that u provide
    check ur connection properties.
    further also check following might help u
    http://help.sap.com/saphelp_nw2004s/helpdata/en/29/acd8403e37762ae10000000a155106/frameset.htm
    also look at sap note 773401
    regards,
    kaushal
    Message was edited by: kaushal malavia

  • Error while doing Good Issue for Production Order using BAPI

    Hi All,
    I am facing an error like 'u2018Content of order 1011907: MDT218AJ10 transferred to interface (IMSEG): T-86410-71".
    I have written the code as below. Please let me know what is missing when using the BAPI 'BAPI_GOODSMVT_CREATE'. What is the cause of this error ?
    *Action in Transaction (GM_CODE)
    *GM Code for Goods Issue for Production Order is 03
      gs_gmcode-gm_code = '03'.
    *Header Data
    *Posting date
      gs_header-pstng_date = sy-datum.
    *Document date
      gs_header-doc_date   = sy-datum.
    *Item Data
    *Material
      gs_item-material  = zptp_s_rf_migo_261-matnr1.
    *Movement Type
      gs_item-move_type = '261'.
    *Movement Indicator
      gs_item-mvt_ind   = 'F'.
    *Stock Type
      gs_item-stck_type = 'F'.
    *Plant
      gs_item-plant     = gv_plant.
    *Storage Location
      gs_item-stge_loc  = gv_str_loc.
    *Quantity
      gs_item-entry_qnt = zptp_s_rf_migo_261-menge2.
    *Unit
      gs_item-entry_uom = gv_uom.
    *ISO code for unit of measurement
      gs_item-entry_uom_iso = gv_uom.
    *Order Number
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = zptp_s_rf_migo_261-aufnr
        IMPORTING
          output = gs_item-orderid.
    *Reservation Number
      gs_item-reserv_no = gv_resv_num.
    *Reservation Item
      gs_item-res_item = gv_resv_itm.
    *Reservation Type
      gs_item-res_type = gv_resv_type.
      APPEND gs_item TO gt_item.
    Calling BAPI_GOODSMVT_CREATE to create the Material Document Number
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header       = gs_header
          goodsmvt_code         = gs_gmcode
        IMPORTING
          goodsmvt_headret      = gs_headret
        TABLES
          goodsmvt_item         = gt_item
          goodsmvt_serialnumber = gt_serial
          return                = gt_return.
    Thanks in Advance.

    hi,
    did you look at message ?
    System says, there are differences between the interface data and the order data. It can be anything. I think you should check
    data in the interface . 
    this is the long explanation of your message :
    Diagnosis
    When calling the function module MB_CREATE_GOODS_MOVEMENT or the BAPI GoodsMovement.CreateFromData (BAPI_GOODSMVT_CREATE) to post a goods receipt for a production order, there are differences between the interface data and the order data.
    Example: The order was created for plant 0001, but plant 0002 is passed on in the interface.
    The system checks this for the material and the order item.
    System response
    Due to this difference, the system cannot post the goods receipt.
    Procedure
    Check the data in the interface (IMSEG-WERKS, IMSEG-AUFNR). If necessary, correct the plant or the order number in the interface.
    << Moderator message - Point begging removed >>
    Edited by: Rob Burbank on Feb 6, 2012 11:24 AM

  • Error while doing Bulk Collect to a table type

    I'm using a Table type to accumulate resultset from a loop and finally return the records in the table type as a ref cursor to the front end.
    But when I'm using Bult collect to insert into the table type object it keeps throwing an error
    'PLS-00597: expression 'TAB_CALENDAR_AVAIL_RESULTSET' in the INTO list is of wrong type'. Can someone help me to let me know what could be the reason for this error. I'm not able to proceed further, please help.
    Here is the code.
    CREATE OR REPLACE PACKAGE hotel
    AS
    TYPE calendar_cursor IS REF CURSOR;
    TYPE type_calendar_avail is RECORD(
    HOTEL_ID AVAILABILITY_CALENDAR.hotel_id%TYPE,--varchar2(4), --AVAILABILITY_CALENDAR.hotel_id%TYPE,
    AVAIL_DATE AVAILABILITY_CALENDAR.AVAIL_DATE%TYPE ,
    TOTAL_COUNT number
    TYPE type_calendar_avail_resultset IS TABLE OF type_calendar_avail;
    tab_calendar_avail_resultset type_calendar_avail_resultset ; -- declare variable of type type_calendar_avail_resultset
    PROCEDURE sp_get_calendar_results (
    sallhotelswithavaildate VARCHAR2,
    ilengthofstay NUMBER,
    sorcowner VARCHAR2,
    all_unittypes VARCHAR2, --DBMS_SQL.VARCHAR2S
    calendar_resultset OUT calendar_cursor
         -- tab_calendar_avail_resultset out type_calendar_avail_resultset
    PROCEDURE sp_get_calendar_results (
    sallhotelswithavaildate VARCHAR2,
    ilengthofstay NUMBER,
    -- ivariant NUMBER,
    sorcowner VARCHAR2,
    all_unittypes VARCHAR2, --DBMS_SQL.VARCHAR2S
    calendar_resultset OUT calendar_cursor
    AS
    sbuf VARCHAR2 (200);
    sepr VARCHAR2 (1);
    shotelwithdate VARCHAR2 (200);
    shotelid VARCHAR2 (10);
    savaildate VARCHAR2 (8);
    sactualavaildate VARCHAR2 (8);
    pos NUMBER;
    istart NUMBER;
    sstartdate VARCHAR2 (8);
    senddate VARCHAR2 (8);
    squery VARCHAR2 (32767) := '';
    sunittypecond VARCHAR2 (500) := '';
    sunitdesccond VARCHAR2 (500) := '';
    v_unit_cond a_unit_cond;
    tempunitcond VARCHAR2 (50) := '';
    BEGIN
    istart := 1;
    LOOP
    tempunitcond := hotel.stringtokenizer (all_unittypes, istart, '|');
    IF tempunitcond IS NOT NULL
    THEN
    v_unit_cond (istart) := tempunitcond;
    istart := istart + 1;
    END IF;
    EXIT WHEN tempunitcond IS NULL;
    END LOOP;
    sunitdesccond := hotel.get_unit_description_cond (v_unit_cond);
    DBMS_OUTPUT.put_line ('unit description : ' || sunitdesccond);
    sbuf := sallhotelswithavaildate;
    sepr := '|';
    istart := 1;
    LOOP
    shotelwithdate := hotel.stringtokenizer (sbuf, istart, sepr);
    EXIT WHEN shotelwithdate IS NULL;
    shotelid :=
    SUBSTR (shotelwithdate, 1, INSTR (shotelwithdate, ',') - 1);
    savaildate :=
    SUBSTR (shotelwithdate, INSTR (shotelwithdate, ',') + 1);
    squery :=
    ' SELECT MIN (ad.avail_date) '
    || ' FROM wvo_fonres.fpavail_daily ad'
    || ' WHERE ad.hotel_id = '
    || shotelid
    || ' AND ad.days_left >= '
    || ilengthofstay
    || ' AND ad.avail_date >= '
    || savaildate;
    IF UPPER (sorcowner) = 'N'
    THEN
    squery :=
    squery
    || ' AND ad.ORC_TYPE != ''R'' and ad.ORC_TYPE != ''P'' and ad.ORC_TYPE != ''E'' ';
    END IF;
    squery := squery || ' AND ( ' || sunitdesccond || ') ';
    EXECUTE IMMEDIATE squery
    INTO sactualavaildate;
    DBMS_OUTPUT.put_line ('Actual available Date: ' || sactualavaildate);
    hotel.sp_get_startdate_enddate (sactualavaildate,
    --ivariant,
    sstartdate,
    senddate
    sunittypecond := hotel.get_unittype_cond (v_unit_cond, sorcowner);
    -- execute immediate
    squery :=
    'select HOTEL_ID, AVAIL_DATE, ' || sunittypecond || ' AS TOTAL_COUNT '
    || ' FROM AVAILABILITY_CALENDAR A '
    || 'WHERE '
    || 'AVAIL_DATE >= '''
    || sstartdate
    || ''' '
    || 'AND '
    || 'AVAIL_DATE <= '''
    || senddate
    || ''' '
    ||'AND '
    || 'A.HOTEL_ID IN ('
    || shotelid
    || ') '
    || 'AND ('
    || sunittypecond
    || '> 0) '
    || -- where total available count of unit type is greater than 0
    ' ORDER BY AVAIL_DATE'; --order clause
         open calendar_resultset for squery;
         fetch calendar_resultset BULK COLLECT INTO tab_calendar_avail_resultset;
    istart := istart + 1;
    END LOOP;
    COMMIT;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line
    (SQLERRM (SQLCODE));
    RAISE;
    END sp_get_calendar_results;
    END hotel;
    /

    1. put tags [co[/b][b]de] and [co[/b][b]de] around your code, so it's readable
    B. what does "hotel.get_unittype_cond (v_unit_cond, sorcowner)" actually retun?
    and third, try this for the array declaration:
    tab_calendar_avail_resultset type_calendar_avail_resultset := type_calendar_avail_resultset ; () ;

Maybe you are looking for