Recursion with reference cursors

Hi,
I need to do a recursive SQL select in a report. Using reference
cursors I can do dynamic SQL selects. What do I need to do if I
must do this recursively. I run into cursor already open error
trying to close the cursor does not help as well.
Any ideas?
TIA
Srinivas

Ok, so you know how the if- test works, and you even seem to almost understand the code you have posted (presuming your professor has written the code, right?). Good start! I like the way you post the code and ask the question can it be done? It is far better than just writing please do my homework for me, because I am too lazy to do it myself...
Have a look in your programming book and reed the chapter about loops. It should give you an idea of how to solve your assignment.
And try posting to the right forum. This question belongs to the New To Java Technology forum. Later on you may advance to the Java Programming forum.
Good luck!

Similar Messages

  • Weak and Strongly Typed Reference Cursors in Reports

    Our custom reports has been using a reference cursor. I have inherited the code and not sure why there is a need to use a reference cursor when it can be done by a simple select statements. I see no dynamic select statements passed or any special parameters to reason out for use of reference cursor in our custom reports. Prior developers had reason out the benefits of using reference cursor for performance. I tested this by running a report with reference cursor versus plain select statement and still the report that is using the plain select statement performed better (faster) than the report that has the reference cursor, there is a big difference.
    I have seen some disadvantage of using reference cursor on the reports that when there is a database object change even if the package that sourced the reference cursor has not been updated or modified the reports needs to be recompiled each time we get this error message coming from the report server queue:
      Terminated with error: <br>REP-8: Run time error in the PL/SQL development
      environment (DE). PDE-PSD001 Could not resolve reference to <Unknown Program Unit>
      while loading <Unknown> <Unknown>. REP-0008: Unexpected memory error while
      initializing preferences.In 9iAS reports prior version the error is occurring rarely. When we moved to 10.1.2.2.0 reports it appears the error occurs most often. We have made an effort to research about the issue and appears to be a bug. One suggestion is to use a strongly typed reference cursor. I have tried to researched about the difference between a weak and strongly typed reference cursor but failed to understand them. I appreciate any help about examples differentiating a weak versus a strongly typed reference cursors.
    Thanks,
    Warren

    I guess my point, for what it's worth, is that whether you use only a strongly typed REF CURSOR, or whether you also use a weakly typed REF CURSOR, you may still end up getting the REP-0008 error (at least if your report is in .REP format). You can avoid this by using a pipelined function instead (or by putting the SQL directly in the report, or possibly by using .RDF or .JSP format).
    To test this, you might:
    1. Create a database package with an SQL*Plus script that that looks something like this:
    CREATE OR REPLACE PACKAGE TEST AS
        TYPE RECORD_TYPE IS RECORD
            USERNAME ALL_USERS.USERNAME%TYPE
        TYPE TABLE_TYPE IS TABLE OF RECORD_TYPE;
        TYPE WEAKLY_TYPED_REF_CURSOR_TYPE IS REF CURSOR;
        TYPE STRONGLY_TYPED_REF_CURSOR_TYPE IS REF CURSOR RETURN RECORD_TYPE;
        FUNCTION GET_WEAKLY_TYPED_REF_CURSOR RETURN WEAKLY_TYPED_REF_CURSOR_TYPE;
        FUNCTION GET_STRONGLY_TYPED_REF_CURSOR RETURN STRONGLY_TYPED_REF_CURSOR_TYPE;
        FUNCTION GET_PIPELINED_TABLE RETURN TABLE_TYPE PIPELINED;
    END TEST;
    CREATE OR REPLACE PACKAGE BODY TEST AS
        FUNCTION GET_WEAKLY_TYPED_REF_CURSOR RETURN WEAKLY_TYPED_REF_CURSOR_TYPE
        IS
            cWeaklyTypedRefCursor WEAKLY_TYPED_REF_CURSOR_TYPE;
        BEGIN
            OPEN cWeaklyTypedRefCursor FOR
            SELECT USERNAME FROM ALL_USERS;
            RETURN cWeaklyTypedRefCursor;
        END GET_WEAKLY_TYPED_REF_CURSOR;
        FUNCTION GET_STRONGLY_TYPED_REF_CURSOR RETURN STRONGLY_TYPED_REF_CURSOR_TYPE
        IS
            cStronglyyTypedRefCursor WEAKLY_TYPED_REF_CURSOR_TYPE;
        BEGIN
            OPEN cStronglyyTypedRefCursor FOR
            SELECT USERNAME FROM ALL_USERS;
            RETURN cStronglyyTypedRefCursor;
        END GET_STRONGLY_TYPED_REF_CURSOR;
        FUNCTION GET_PIPELINED_TABLE
        RETURN TABLE_TYPE PIPELINED
        IS
        BEGIN
            FOR rec IN
                SELECT USERNAME FROM ALL_USERS
            LOOP
                PIPE ROW(rec);
            END LOOP;
        END GET_PIPELINED_TABLE;
    END TEST;
    /2. Create a report based on REF CURSOR query using only a strongly typed REF CURSOR. The PL/SQL statement that you use in the report as the data source for the query might look something like this:
    function QR_1RefCurDS return test.strongly_typed_ref_cursor_type is
    begin
      return test.get_strongly_typed_ref_cursor;
    end;3. Compile the report to a .REP file and run it to make sure it works as expected.
    4. Drop and re-create the TEST package in the database.
    5. Try running the .REP file again. I expect you will get the REP-0008 error.
    6. Modify the REF CURSOR query to use an underlying weakly typed REF CURSOR by changing the PL/SQL statement (from Step 2) to something like this:
    function QR_1RefCurDS return test.strongly_typed_ref_cursor_type is
    begin
      return test.get_weakly_typed_ref_cursor;
    end;7. Repeat Steps 3 through 5. I expect you will get the REP-0008 error again.
    8. Replace the REF CURSOR query in report with an SQL query that looks something like this:
    SELECT * FROM TABLE(TEST.GET_PIPELINED_TABLE)9. Repeat Steps 3 through 5. I expect you will not get the REP-0008 error.
    Hope this helps.

  • Help with Collections and Reference Cursor

    I have a procedure where I want to populate a table type and then return the results with a reference cursor so the results can be used by Hyperion. Here are the type declarations:
    create or replace type gg_audit_object as object (
                   owner varchar2(30),
                   table_name varchar2(30),
                   lag_time number)
    CREATE OR REPLACE TYPE gg_audit_table AS TABLE OF gg_audit_object
    and here's the procedure:
    CREATE OR REPLACE PROCEDURE ETSREP_GG_AUDIT_XX2 (results_cursor in out types.cursorType)
    AS
    v_owner varchar2(30);
    v_table_name varchar2(30);
    v_column_name varchar2(30);
    type v_record is record(
    owner varchar2(30),
    table_name varchar2(30),
    lag_time number);
    r1 v_record;
    t1 gg_audit_table;
    table_cr types.cursorType;
    sql_stmt varchar2(5000);
    cursor table_select is
    select g.owner,
    g.table_name,
    g.column_name
    from gg_tables_to_audit g
    where g.active_ind = 'Y'
    order by 1,2;
    BEGIN
    rec_count := 0;
    for main_rec in table_select loop
    sql_stmt := '';
    v_owner := main_rec.owner;
    v_table_name := main_rec.table_name;
    v_column_name := main_rec.column_name;
    sql_stmt := 'select '
    || '''' || v_owner || ''','
    || '''' || v_table_name || ''','
    || 'sysdate - max(' || v_column_name || ') '
    || 'from ' || v_owner || '.' || v_table_name;
    open table_cr for sql_stmt;
    FETCH table_cr into r1;
    close table_cr;
    -- here's where I'm stumped. I need to take the values from r1 and put them
    -- into t1.
    -- Something like this (or whatever is the correct way to do it)
    -- insert into table(t1) values (r1.owner, r1.table_name, r1.lag_time);
    end loop; -- end table_select loop
    -- and then open a reference cursor and select them out of t1.
    -- Something like
    -- open results_cursor for select * from t1;
    END;
    Just trying to avoid creating a real table and populating that. Any guidance would be greatly appreciated.

    Found the perfect example on Ask Tom. Here is the solution.
    create or replace package GG_AUDIT
    as
    type rc is ref cursor;
    procedure GG_AUDIT_PROC( r_cursor in out types.cursorType );
    end;
    create or replace package body GG_AUDIT
    as
    procedure GG_AUDIT_PROC( r_cursor in out types.cursorType )
    is
    l_data gg_audit_table := gg_audit_table();
    table_cr types.cursorType;
    type v_record is record(
    owner varchar2(30),
    table_name varchar2(30),
    lag_time number);
    r1 v_record;
    sql_stmt varchar2(5000);
    v_owner varchar2(30);
    v_table_name varchar2(30);
    v_column_name varchar2(30);
    rec_count number := 0;
    cursor table_select is
    select g.owner,
    g.table_name,
    g.column_name
    from gg_tables_to_audit g
    where g.active_ind = 'Y'
    order by 1,2;
    begin
    for main_rec in table_select loop
    sql_stmt := '';
    v_owner := main_rec.owner;
    v_table_name := main_rec.table_name;
    v_column_name := main_rec.column_name;
    sql_stmt := 'select '
    || '''' || v_owner || ''','
    || '''' || v_table_name || ''','
    || 'sysdate - max(' || v_column_name || ') '
    || 'from ' || v_owner || '.' || v_table_name;
    open table_cr for sql_stmt;
    FETCH table_cr into r1.owner, r1.table_name, r1.lag_time;
    close table_cr;
    rec_count := rec_count + 1;
    l_data.extend;
    l_data(rec_count) := gg_audit_object(r1.owner, r1.table_name, r1.lag_time);
    end loop;
    open r_cursor for select * from TABLE ( cast ( l_data as gg_audit_table) );
    end; -- end procedure
    end;
    Works perfectly. Thanks guys.

  • Stored procedure with multiple Reference Cursors

    In Sybase and SQLServer, result sets are returned to the application implicitly. Oracle emulates this by passing back weak reference cursors to the application through an IN OUT parameter.The number of reference cursors must match the number of results sets. For example, if 2 select statements are present in the stored procedure code, then 2 reference cursors are passed back.The Oracle Migration Workbench creates the correct number of reference cursors but assigns each select statement results to the first cursor created. Therefore only the last set of results are returned to the client.
    Before (SQLServer)
    CREATE PROCEDURE get_sch_associated_appointment_info (@piAcc_itn int) AS SELECT s.acc_itn, r.internal_key, r.mnemonic, r.descp, sh.start_dtime, sh.end_dtime FROM schdtl s, schdtlhdr sh, resource r WHERE s.acc_itn = @piAcc_itn and sh.acc_itn = @piAcc_itn and sh.resource_itn = r.internal_key SELECT sdcr.acc_itn, sdcr.rsch_dtime, sdcr.rsch_by_init, sdcr.rsch_code, sdcr.rsch_reason, sdcr.cncl_dtime, sdcr.cncl_by_init, sdcr.cncl_code, sdcr.cncl_reason, sdcr.prev_start_dtime, sdcr.prev_by_init FROM schdtl_canrsch sdcr WHERE sdcr.acc_itn = @piAcc_itn SELECT sdi.acc_itn, i.sched_notes, i.post_sched_notes, d.pre_sch_notes, d.post_sch_notes, i.detail_key, i.output_notes FROM schdtl_info sdi, extitem i, dept d WHERE sdi.acc_itn = @piAcc_itn and sdi.actual_dept = i.dept and sdi.actual_proc_no = i.proc_no and sdi.actual_dept = d.dept
    After (Migration Workbench) – Optional Section
    CREATE OR REPLACE PROCEDURE get_sch_associated_appointment_info (piAcc_itn int, RC1 IN OUT Omwb_emulation.globalPkg.RCT1) AS OPEN RC1 SELECT s.acc_itn, r.internal_key, r.mnemonic, r.descp, sh.start_dtime, sh.end_dtime FROM schdtl s, schdtlhdr sh, resource r WHERE s.acc_itn = piAcc_itn and sh.acc_itn = piAcc_itn and sh.resource_itn = r.internal_key; OPEN RC1 SELECT sdcr.acc_itn, sdcr.rsch_dtime, sdcr.rsch_by_init, sdcr.rsch_code, sdcr.rsch_reason, sdcr.cncl_dtime, sdcr.cncl_by_init, sdcr.cncl_code, sdcr.cncl_reason, sdcr.prev_start_dtime, sdcr.prev_by_init FROM schdtl_canrsch sdcr WHERE sdcr.acc_itn = piAcc_itn; OPEN RC1 SELECT sdi.acc_itn, i.sched_notes, i.post_sched_notes, d.pre_sch_notes, d.post_sch_notes, i.detail_key, i.output_notes FROM schdtl_info sdi, extitem i, dept d WHERE sdi.acc_itn = piAcc_itn and sdi.actual_dept = i.dept and sdi.actual_proc_no = i.proc_no and sdi.actual_dept = d.dept;
    After (Manual Change)
    CREATE OR REPLACE PROCEDURE get_sch_associated_appointment_info (piAcc_itn int, RC1 IN OUT Omwb_emulation.globalPkg.RCT1, RC2 IN OUT Omwb_emulation.globalPkg.RCT1, RC3 IN OUT Omwb_emulation.globalPkg.RCT1) AS OPEN RC1 SELECT s.acc_itn, r.internal_key, r.mnemonic, r.descp, sh.start_dtime, sh.end_dtime FROM schdtl s, schdtlhdr sh, resource r WHERE s.acc_itn = piAcc_itn and sh.acc_itn = piAcc_itn and sh.resource_itn = r.internal_key; OPEN RC2 SELECT sdcr.acc_itn, sdcr.rsch_dtime, sdcr.rsch_by_init, sdcr.rsch_code, sdcr.rsch_reason, sdcr.cncl_dtime, sdcr.cncl_by_init, sdcr.cncl_code, sdcr.cncl_reason, sdcr.prev_start_dtime, sdcr.prev_by_init FROM schdtl_canrsch sdcr WHERE sdcr.acc_itn = piAcc_itn; OPEN RC3 SELECT sdi.acc_itn, i.sched_notes, i.post_sched_notes, d.pre_sch_notes, d.post_sch_notes, i.detail_key, i.output_notes FROM schdtl_info sdi, extitem i, dept d WHERE sdi.acc_itn = piAcc_itn and sdi.actual_dept = i.dept and sdi.actual_proc_no = i.proc_no and sdi.actual_dept = d.dept;

    I believe you are using .NET(?). If that is the case, please post this query to the .NET Development - Crystal Reports  forum:
    SAP Crystal Reports, version for Visual Studio
    That forum is monitored by qualified technicians and you will get a faster response there.
    Thank you for your understanding,
    Ludek

  • How to implement a Copy or Create with Reference scenario

    For business objects, you might want to implement a Copy or Create with Reference scenario. The following procedure describes the UI configuration that you need if you want to place a copy button (in our example on an OWL) that starts a quick activity floorplan (on the same BO = Copy, or a different BO = Create with Reference). Pre-requisie in the target BO: The target BO requires a BO element SourceBOID and a Copy action that reads the SourceBO by SourceBOID by query, and copies the elements from the source to the target BO.
    The UI configuration in the target floor plan is:
    1. Open the QAF floor plan of the target BO (target floor plan).
    2. In the DataModel view of the target floor plan, select the Root entry and select Add Data Field from the context menu. Rename the created data element to OBN_OriginBOID.
    3. Choose the Controller tap, and select INPORTS and choose ADD INPORT from the context menu. A new in-port is created. Rename the in-port, for example to Copy.
    4. In the in-port maintenance form, activate the check box OBN INPORT.
    5. Select the namespace of your solution and the target business object.
    6. In the input field SELECT OPERATION enter Copy. A new select operation is created. The combination of business object name (including namespace), business object node and operation identifies the in-port and therefore the related floor plan as navigation target.
    7. Select the port type package /SAP_BYD_UI/SystemPortTypes.PTP.uicomponent.
    8. In the PARAMETERS section of the form, click the ADD button. Maintain the binding of the created parameter to /Root/OBN_OriginBOID. Based on this configuration, the system will transfer the parameter of the in-port to the element in the data model when the OBN is executed.
    9. In the Properties view, select the drop-down list box of the property EVENTS u2022 ONFIRE. Scroll down and select the entry u2026 NEW EVENT HANDLER u2026. The system starts the maintenance window for event handlers. Rename the event handler to CopyIn.
    10. In the OPERATIONS table of the maintenance window for event handlers, select type: BUSINESS OBJECT OPERATION. In the form below the table select the value CREATE for the input field BUSINESS OBJECT OPERATION TYPE. This operation will create a BO instance in the backend when the OBN is executed.
    11. In the OPERATIONS table, create a new operation of type: DATAOPERATION.  In the configuration of the data operation, select the operation type ASSIGN, source expression /Root/OBN_OriginBOID and target expression /Root/<BO>/OriginBOID.
    12. Create a third operation of type: BUSINESS OBJECT ACTION. Select the Copy action of the target business object and click the BIND button. Note: This action enforces another roundtrip to the backend. The Copy action must be implemented so that it will read the origin BO and copy selected data from the origin to the newly created object.
    13. Test the changes in the preview. If no error message is issued, save and activate the floor plan.
    The following procedure describes the configuration in the source floor plan (e.g. OWL floorplan ):
    1. Open the Source BO OWL floor plan (source floor plan).
    2. In the Designer view, place cursor the on the toolbar area and select ADD u2022 APPLICATION-SPECIFIC BUTTON u2022 MY BUTTON from a context menu. Rename the new button to Copy.
    3. In the Properties view, select the drop-down list box of the property MENU INFORMATION u2022 NAVIGATION. The system launches the maintenance window for OBN configuration.
    4. Select the in-port of the target floor plan by selecting the target business object (with namespace and name) the target business object node and the target operation, and the operation Copy.
    5. Choose the navigation style NEWWINDOW.
    6. Close the OBN configuration maintenance window by clicking the OK button. The system creates the OBN configuration, an out-port, that is used by the OBN configuration, and an event handler that uses the out-port and that is assigned to the button (see Properties view, EVENTS u2022 ONFIRE).
    7. Go to the Controller view and rename the OBN configuration to Copy, the new out port to Copy and the new event handler to CopyOut.
    8. Check that the event handler CopyOut fires the out-port Copy.
    9. In the Parameters section of the out-port maintenance form, click the ADD button. Maintain the binding of the created parameter as /Root/<BO>/<BO>ID. Based on this configuration, the system will transfer the identifier of the selected source BO to the out-port data structure when the OBN is executed.
    10. In the Operations table, select type: FIREOUTPORT. In the form below the table select the out-port CopyOut.
    11. Test the changes in the preview. If no error message is issued, save and activate the floor plan.

    Hi Dries-
    There are no pre-packaged solutions with BADIs since they are, by definition, custom development.  If that's the path you need to go down then consider the following high level alternatives:
    Incorporate custom code into the BPC Write Back BADI.  You can restrict the execution of the BADI using filters on the BADI definition, so that the BADI execution only occurs when a data manager package is called, and only for some defined combination of applications/appsets.  Utilized the standard copy/move functions delivered in Data Manager. When the BADI is called, interrogate each record being processed (table CT_ARRAY) and determine if the record has a value you want to process (i.e. save to the target application).  Skip any record that has a zero value.
    Another alternative is to develop the BADI as custom logic.  Data Manager parameters can be picked up in Script Logic and the values can be sent to the BADI by adding parameters.  Please see an example of parmater use in the "How To" document for Destination App at:
    [EPM How To Guides|https://wiki.sdn.sap.com/wiki/display/BPX/Enterprise%20Performance%20Management%20%28EPM%29%20How-to%20Guides]  > "How-to Desitnation App"
    Regards,
    Sheldon

  • REFERENCE CURSOR NOT CLOSING - Urgent!!!!!!

    I have some Oracle Stored Fucntions which return REFERENCE TYPE CURSOR. I noticed they are not closing. I even tried the following , but no luck. Any help is much needed.
    PACKAGE Types
    AS
    PRAGMA SERIALLY_REUSABLE;
    TYPE ref_cursor IS REF CURSOR;
    END Types;

    Thanks Justin.
    As you have replied to my query , I am placing the next again.
    I am using the following code :
    counter = 1;
    parm_status = OCIParamGet(stmthp, OCI_HTYPE_STMT, errhp, &mypard, (ub4) counter);
    /* Loop only if a descriptor was successfully retrieved for
    current position, starting at 1 */
    while (parm_status==OCI_SUCCESS)
         /* Retrieve the data type attribute */
         OCIAttrGet((dvoid*) mypard, (ub4)OCI_DTYPE_PARAM, (dvoid*) &dtype,(ub4 *) 0, (ub4) OCI_ATTR_DATA_TYPE, (OCIError *) errhp );
    When I have a stored proc with a reference cursor open then the above code works fine. But if I close the cursor before returning from the procedure then in the above case OCIParamGet() is returning a parameter descriptor , which raises unhandled exception when being called from OCIAttrGet().
    I think as the memory got freed where the reference cursor points , oracle should return some exception that could be handled but instead I receive unhandled exception.
    Is this a problem with Oracle or I need to something else at the client side.
    Please let me know all your views.
    Regards
    Sutanu

  • Reference cursor

    anybody have knowledge about reference cursor. please share it with me

    <FONT FACE="Arial" size=2 color="2D0000">
    Start Here  
    REF CURSOR
    -SK
    </FONT>

  • RFQ WITH REFERENCE TO ENQUIRY

    WHAT IS RFQ WITH REFERENCE TO ENQIRY. HOW CAN WE MAP IN MATERIALS MANAGAEMENT

    Hi,
    In MM, Inquiry means "Request for Quotation" and Quotation is called as "Quotation" only.
    Request for Quotation (RFQ): - A request for quotation (RFQ) is an invitation extended to a vendor by a purchasing organization to submit a quotation (bid) for the supply of materials or performance of services.
    ME41 - Create RFQ
    ME42 - Change RFQ
    ME43 - Display RFQ
    Creating an RFQ Manually: -
    Choose RFQ/quotation ® RFQ ® Create.
    The initial screen appears.
    Enter the deadline for submission of quotations, the purchasing organization, and the purchasing group.
    Document data
    RFQ type: In the standard system, the default value for the RFQ type is AN (RFQ). It is the value we assume for this example.
    RFQ: Enter a number only if you use external number assignment. If you leave the field blank, the system will assign a number automatically.
    Organizational data
    Enter the key for your purchasing organization and purchasing group.
    Default data
    If you make an entry in any of these fields, the value becomes the default value in each item.
    For example, if you enter the delivery date, then this date is suggested in each item. You can change this value at any time.
    Press ENTER .
    The item overview screen appears.
    For each item, enter:
    u2013 The number of the material, if the material has a material master record
    If the material does not have a master record, then leave the field for the material number blank. In this case, entry of the short text, material group, and order unit is mandatory, however.
    u2013 The quantity requested
    u2013 The delivery date (day, week, or month - enter the corresponding date category)
    u2013 The number of the receiving plant and that of the storage location, if known
    To review the detailed information for an item, first select the item. Then choose Item ® Details.
    To review such header information as the important deadlines for the RFQ, choose Header ® Details. You can also enter the collective number on this screen.
    Choose Header ® Vendor address.
    Enter the vendor number. The system will then take the address data from the vendor master record.
    If you enter the number of a one-time vendor, you must enter the complete address manually.
    Save the RFQ so that the RFQ is created for the relevant vendor.
    For each further vendor to whom you want to send the RFQ, enter the vendor number and save the document.
    Result
    The RFQ is created in the SAP System.
    Quotation: - A quotation is an offer by a vendor to a purchasing organization regarding the supply of materials or performance of services subject to specified conditions.
    ME47 - Maintain Quotation
    ME48 - Display Quotation
    Entering a Quotation Against an RFQ
    1. Choose RFQ/quotation ® Quotation ® Maintain.
    The initial screen for maintaining quotations appears.
    2. Enter the number of the RFQ and press ENTER.
    The RFQ item overview screen appears.
    3. You can enter the vendor's price per item on the item detail screen (see steps 4 and 5) or directly on the item overview screen.
    4. Choose Item ® Details to enter quotation data on the item detail screen.
    5. Enter the vendoru2019s quotation.
    6. Save your data.
    Entering Prices
    You can enter a vendor's quoted prices in one of two ways:
    You enter the net price per unit in the Net price field. This price includes the vendor's normal discounts and surcharges only. Cash discounts (for prompt payment) and taxes (e.g. value-added tax) are calculated separately.
    You enter the gross price in the Net price field, and maintain the conditions for the item. Then the system automatically replaces the entered gross price with the calculated net price (see Maintaining Conditions).
    If you enter the net price for an item for which pricing conditions have been maintained, the system always replaces the price you enter with the calculated net price.
    A warning message draws your attention to this fact, so that you can correct the price with which the system overwrote your input if necessary.
    Order Price Unit (of Measure)
    If the quotation price is based on a different unit of measure than the one you normally use (that is, the order unit), enter the order price unit next to the net price in the OPUn field on the item overview screen. On the item detail screen, enter the factor for converting the order unit into the order price unit (if this has not already been defined in the system).
    If the order price unit is "liter", but your order unit is "barrel", enter liter as the order price unit and specify the conversion factor 4:1 (assuming that one barrel contains 4 liters).
    For further details on units of measure, refer to the section Units of Measure in Purchase Orders.
    Entering Taxes
    Enter the code for any relevant taxes (for example, value-added tax - VAT) in the Tax code field. If a purchase order is created by referencing an RFQ, this code facilitates the determination of the tax amount when the invoice is entered in the system.
    Creating an Info Record
    You should create an info record for quotations that you decide to accept. (Particularly if you intend to order from the vendor concerned more than once.) If an info record is available, the conditions from the quotation are automatically suggested when a purchase order is created.
    If the quotation is to be stored in a purchasing info record, fill the InfoUpdate field on the item detail screen.
    And ME49 - Price Comparison of Quotations
    Procedure
    Choose RFQ/quotation ® Quotation ® Price comparison list.
    The selection screen for the price comparison list appears.
    Enter the selection criteria for the quotations that are to be compared.
    You can enter either a range of quotation numbers or, by entering the collective number, select all quotations belonging to a certain competitive bidding process. It is also possible to select by vendor number and by material number. You must specify either a range of quotation numbers or the collective number.
    Choose the comparison values to be used.
    Reference quotation
    You can compare the quotations within the list with a sample quotation. The system displays the percentage deviation between each quotation in the list and the sample quotation.
    Mean/minimum value quotation
    The price comparison list can also display a "fictitious" quotation reflecting the average or minimum value of all quotations. Select either the Mean or Minimum value quotation field to choose the type of fictitious quotation.
    Percentage basis
    The price comparison list displays the percentage of each item in relation to the maximum, minimum, or average price. To determine the display type, enter one of the following:
    u2013 + Highest value for each item is the 100% value
    u2013 - Lowest value for each item is the 100% value
    u2013 "_" Mean value for each item is the 100% value
    Price computations
    Select the appropriate field to specify which of the following should be taken into account in determining the comparison price:
    u2013 Cash discount
    u2013 Delivery costs
    u2013 Effective price
    Choose Program ® Execute.
    The price comparison list is generated.
    The price comparison list displays the price per item in the base unit stored in the material master record.
    Further Information
    From the price comparison list, you can do the following:
    · Display additional information about the material master record for a particular material
    · Display additional information on the quotations in the price comparison
    · Display a certain quotation
    · Display a vendor master record
    · Invoke vendor evaluation functions
    If you position the cursor on
    - A vendor, only the latteru2019s evaluation is displayed (in relation to the materials he is able to supply).
    - A material, the system generates a ranking list of all vendors that have submitted a quotation.
    - T he quotation data (e.g. price or rank), the system will carry out a comparison of evaluations.
    Saving the Market Price
    The market price is the basis for appraising the vendor's price level for a material and is used for vendor evaluation purposes. A market price can apply to a material or a material group.
    You can store a price as the market price from within the price comparison list. Position the cursor on the desired price and choose Edit ® Save market price.

  • Recursive Self Reference

    Hi,
    I am trying to do a recursive self reference. Is this the best way of doing it as I keep getting errors?
    SQL> CREATE OR REPLACE TYPE type_objtyp AS OBJECT (
    2 type_id NUMBER (10),
    3 type_name VARCHAR2 (100),
    4 sub_type REF type_objtyp
    5 )
    6 NOT FINAL
    7 /
    Type created.
    SQL> CREATE OR REPLACE TYPE data_objtyp
    2 /
    Type created.
    SQL> CREATE OR REPLACE TYPE data_list_objtyp AS TABLE OF data_objtyp
    2 /
    Warning: Type created with compilation errors.
    SQL> CREATE OR REPLACE TYPE data_objtyp AS OBJECT (
    2 data_id NUMBER (10),
    3 type_ref REF type_objtyp,
    4 creation_date DATE,
    5 child_list_ref REF data_list_objtyp
    6 )
    7 NOT FINAL
    8 /
    Warning: Type created with compilation errors.
    SQL>
    SQL> COMMIT
    2 /
    Commit complete.
    SQL> show errors
    Errors for TYPE DATA_OBJTYP:
    LINE/COL ERROR
    0/0 PL/SQL: Compilation unit analysis terminated
    5/25 PLS-00532: Target of REF must be a complete or incomplete object
    type.

    you can't have a REF to a table type, only to object types. so, instead use a table of REFs:
    -- incomplete declaration
    create or replace type data_objtyp;
    -- declare table type
    create or replace type data_objtyp_list is table of REF data_objtyp;
    -- complete data object declaration
    create or replace type data_objtyp is object (
    data_id NUMBER (10),
    type_ref REF type_objtyp,
    creation_date DATE,
    child_list data_objtyp_list
    NOT FINAL;
    hope that helps... g

  • Depot  Excise Invoice with reference to Delivery from project

    please understood my requirement
    Normal Depo Sales is like VA01-VL01N-J1IJ----VF01 here whatever excise values captured in J1IJ those values come to the commercial Invoice.
    As per My requirement we are creating Project and while creating sales order we have to assign WBS element.
    now Project -Delivery--Excise Invoice J1IJ
    Sales order -
    Inovice VFO1
    my question is how excise and commercial Invoice values come together.
    regards
    etr

    Hello Amol,
    you can create with reference of the deliveyr document. in J1iin trnsaction you have the option in the header tabs of create from delivery
    enter the delivery and create the excise invocie
    Hope this helps
    Thanks
    akasha

  • Error while creating a credit memo with reference to invoice

    HI aLL,
    I am facing one issue while creating a credit memo request in VA01 with reference to invoice.
    Our project stock is valuated stock.
    When we try top copy the error pops up" Valuated project stock not allowed with customer stock." and the line item is not copied in the credit memo.
    Diagnosis:The entered wbs manages a valuated project stock,at the same time sales order stock is maintained on sales order line item.this combo is not allowed as different valuation methods within a project is not allowed.
    Tarun Kapur

    Dear Tarun!
    1.Within a project we can get stock only in PROJECT or in SALES ORDER STOCK.....a single material can not be a both place at particular time ..so keep only one
    Project Stock or Sales Order Stock..
    2.Check DIP PRofile (ODP1) in usage BILLING AND RESULT ANALYSIS -Charectiristic -SDOC TYPE CMR.....are you selecting right document to which you want to copy .....
    Rewards Points if usefull
    Regards
    SMITH

  • Error while posting a sales order created with reference from contract for

    Hi,
    I am posting a sales document( Type: WA)  created with reference from contract document(  type wk2) for delivery.  The item category in the sales order of the Item is WAN. On posting this document for delivery I am getting the error as "Item category WAN is not defined".  Please help me out how to resolve this issue.
    Thanks
    Jayant

    Hi Jayant,
    I think its value contract releated error,
    You suppose to check material item category group through T.code-MM02 into sales2 tab and maintain VCIT,
    and do item category assignment through T.code- VOV4.
    plz.maintain like that,
    WK2 -          -VCIT-         -           - WAN(contract item category),
    wk2  -          -        -VCTR-          - WAN((contract item category),
    you should also maintain same against your standard Sales Document type and for Standard Item category into VOV4,
    WA(standard docu.type) -VCIT-                             -                -TAN(your standard docu.type item category),
    WA(standard docu.type) -         -VCTR(item usage)-              -TAN(your standard docu.type item category),

  • HOW TO CONTROL ON CREATION OF SALES ORDER WITH REFERENCE TO EARLIER SO?

    Dear All,
    I want to contol on creation of Sales order with reference to earlier SO?  While creation of sales order our enduser are creating sales order with reference to earlier month SO which I want to restrict. Recently I made changes in sales order like payment terms is grayed, system will atomatically pick pay terms from customer master.Now I am getting correct data also but enduser is using old SO no while creating new SO and old payment data is reflecting in fbl5n.
    I want to restrict enduser while creating new SO with ref. to old SO. Only for returns they should be able to use Billing refrence. Pl. suggest how to control the with reference to ealier SO.
    Nikhil

    Nikhil Deshpande,
          If you dont want allow create a sales order in referent to other one, just delete the copy control between these sales order type, so when the user tries to create a SO in reference to other one a message is displayed that is not possible.
    Thanks,
    Mariano.

  • Changing quantities in sales order with reference to quotation

    Hi,
    Quotation has been created for Product -- A, 10 quantities.
    Sales order created with reference to quotation, system copies 10 quantity in sales order.
    How do you restrict in sales order end user should not change quantities, system should not allow for changes by end user. If end user changes Qty system should give an "Error message", so that sales can not be saved.
    Could you suggest solution ASAP.
    Thanks in Advance.
    Regards,
    vamsi.

    Normally You will have a warning message set for this. under class V1. if you want the error to be hard error then you would have to hard code it in a user exit under mv45afzz "userexit_save_document_prepare" where u can check if the quantities in the quote and sales order are different and create a hard error.
    the other option which I am not sure if it is possible is to propose the eror in message class v4 which you can control thru customisation under SPRO>SD>message settings
    reward points if it helps
    regards
    Biju

  • Mandatory fields With reference to Material types

    Dear Gurus,
    I need to make few fields as mandatory with reference to material types while creation of the material master data.
    For example:
    For Semi finished and Finished Schedule margin key is required(mandatory)
    For Raw Materials Schedule margin key is optional.
    Regards,
    Siddharth

    Hi
    find  following step to make field mandatory for material type
    Follow the stpes for making field as optional, required entry
    1 click the tab ,(Which is u want to be Required entry )and get the field name by pressing F1 key and then
    2.Go to T.Code: OMSR and enter that field name and get Selection Group
    once you get selection group and field name
    3 Use t.Code: OMS2 and click your material type and in next screen check Field reference ( you have assigned for material type; example :;For ROH material type the Field reference is ROH
    3. Use T.code:OMS9,, Double Click your Field Reference and select field selection Group , & select round box of Required Entry or optional and save
    check following link you will get clear idea [How to configure the fields required for each Material type ?;
    Regards
    Kailas ugale

Maybe you are looking for

  • Why can't I download Adobe Media Encoder CC and I have the the Creative Cloud Suite.

    Why can't I download Adobe Media Encoder CC and I have the the Creative Cloud Suite? (Windows)

  • Reg : Idoc message type

    Hi All, I want to find what are the message types linked to the Basic idoc type. Can any one tell which table contains this information. Thanks VIJAY

  • Outlook Exchange on iMac - crashes

    I cannot get Outlook for Mac 2011 to run on my iMac, even though it runs fine on both my MacBook Pro and Air. It boots up, starts to connect to the Exchange Server, and before long it crashes. Here is an example of a detailed error message I have rec

  • When I add a phone-number, I can't define it as 'iPhone'.

    When I add a contact, and that person is also using iPhone, I can't define that. I can choose all kinds of things, like radio, fax, home, mobile,.. but not iPhone... This also means I can't use iMessage whit that person. How can I change this?

  • How to enable Intel VT-x in Windows 8 ?

    In VMware, I am getting error message about enabling Intel VT-x setting in bios ? I have no idea how to go to BIOS in windows 8 and how to enable it ? Could you please guide me how to enable VT-x in windows 8 ?