Discount Modifiers application @ Order Line

Hi All
I have requirement, where business needs to apply discounts @ order line level based on customer DFF ( Saying yes or no) and Order DFF(%) modifiers should apply automatically the % based on the inputs@Order DFF and Customer DFF, once its applied, additionally, after the booking process, down the line if we are adding new order lines, user should not be able to apply any discount/modifiers ( need to restrict users)
Is this possible in R12
Please let me know
Krishna

I believe this would be possible.  You'd have to create a custom pricing attribute based on the customer DFF to be used as a qualifier for your modifier.  Then I would attempt to use the "Get Custom Price" formula to do the calculation based on the order DFF. I'm not 100% clear on the requirements you stated about restricting users later - if you set the calculate_price field to "Frozen" on the order line, the pricing for that line will not change. 

Similar Messages

  • Can we modify sales order line item before its booked through API?

    can we modify sales order line item before its booked through process_order API?
    here we have a situation where related item should be substituted for actual order item when user selects the related item , So looking for a way to modify the ordered item on sales order line .
    Thanks,

    Hi
    There is an API to update the Related Item on the line level in the Sales Order.
    PROCESS_ORDER API can be used for this purpose. It is part of OE_ORDER_PUB.
    Below are the fields on line table type that will be assigned to create an order line with related item and original ordered item.
    ORIGINAL_ORDERED_ITEM : Original Item
    ORDERED_ITEM : Related Item
    ITEM_RELATIONSHIP_TYPE : Type of Relationship.
    Please go ahead and try to create it like this. I am pretty sure that it will get the order created with related items.
    Note: Please make sure the profile option
    OM: Enable Related Items
    should be enabled.
    Please mark the response as helpful or correct if it provides you the solution.
    Thanks
    Mirza Tanzeel

  • Urgent: Unable to Edit Modifiers to Order Lines.

    Guys,
    Modifiers are defined correctly for order lines.
    "Override" checkbox exists for all item categories.
    Profile "OM: Discounting Privileges" to "Full"
    "Enfore Price List" is not checked for the order type.
    All price list,Transactions types and modifiers are active and has no end date.
    Ran
    Build Attribute Mapping Rules
    QP: Maintains the denormalized data in QP Qualifiers
    Any others setups I missing?
    Cheers!!!

    911669 wrote:
    Guys,
    Modifiers are defined correctly for order lines.
    "Override" checkbox exists for all item categories.
    Profile "OM: Discounting Privileges" to "Full"
    "Enfore Price List" is not checked for the order type.
    All price list,Transactions types and modifiers are active and has no end date.
    Ran
    Build Attribute Mapping Rules
    QP: Maintains the denormalized data in QP Qualifiers
    Any others setups I missing?
    Cheers!!!You mean..when you go for view adjustments at line level..you are not able to see modifers there??

  • Modify Sales order line item Type

    Hey Guys,
    I was wondering if there is a way through the DI or UI that I can change the type of a line item in a sales order matrix. I can change it through the Business One client to sub total or text on a line item and add comments. Is it possible to do this through code via DI or UI?
    Any examples would be helpful.

    Something like this.
    ComboBox cb = (ComboBox)oMatrix.Columns.Item("COLUID").Cells.Item("row").Specific;
    cb.Select("ValueToSelect",BoSearchKey.psk_ByValue);
    Normal lines have "" (empty) value
    Textlines have "T" value
    Subtotals have "S" value

  • Need to report on sales order lines using specific pricing modifier

    Is there a report I can run for a specific modifier number that will give me all the sales order lines that were adjusted using that pricing modifier?

    Use oe_price_adjustments table and link that to the qp_list_headers and lines to get the details of the modifiers.
    Thanks
    Nagamohan

  • Unable to copy the Price Modifiers associated with a Sales Order Line

    Dear All,
    I am copying Sales Order Line using the process_order API. I was not able to copy the Price Modifiers associated with the Lines. How can I accomplish this..?
    Is there any API available for copying the Price Modifier info associated with the Sales Order Line..?
    Environment is 11i and OS is SUN Solaris
    Please update...
    Many thanks in advance..

    Hello All,
    Please let me know is this possible to have the list of Invoices for an associated Sales Order.
    Thanks,
    Abdul

  • Report on Orders that have Order Lines modified during the period

    hi,
    I am a Beginner, PLEASE I NEED A HELP
    Report on Orders that have Order Lines modified during the period

    I don't know a standard report (SE95 does not seem to include selection by date), maybe you can tweak SE16 display of table SMODILOG for your purpose.
    Thomas

  • Sales Order line item Price after Discount

    Hi all
    How to get the line item price after discount in Sales Order Query?
    Kedalene

    Hi Kedalene,
    Please check below Query.
    SELECT T0.[DocNum], T0.[DocDate], T0.[CardName], T1.[Dscription], T1.[Quantity], T1.[Price] as Price_After_Discount, T1.[PriceBefDi] As Price_Before_Discount,T1.[DiscPrcnt],  T1.[LineTotal] FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry]
    Hope this help
    Regards:::::
    Atul Chakraborty

  • Modifying Unit Price of Parchase Order Line by the Receiving Open Interface

    I’m using the” Receiving open Interface” to make receptions of standard purchase orders line by interface (RCV_TRANSACTIONS_INTERFACE) and what I need is to change the unit price of the item in the line of Purchase Order,
    the idea is that it takes the value that I’m populating by the interface table “RCV_TRANSACTIONS_INTERFACE” and not the value that is in the Standard purchase Order line (unit_price)
    It´s possible to do that in this way?? How can I do that??
    Message was edited by:
    alejandrojrc

    Any sugestion??

  • Manual override option for Unit selling price in Order line level.

    In OM R-12
    Our client wants manual override option for Unit selling price in Order line level.
    But there is no solution available to fulfill this requirment. To be able to manually override the price on a Sales Order line you
    must have defined a manual modifier that qualifies for the Sales Order line in question. Without a suitable manual modifier the price cannot be changed.
    This is current standard functionality.
    Anybody can give some suggestion/workaround to override selling price in Order header level without using the modifiers.
    regards,

    Hi Kashif,
    I'm finding it little difficult to buy Oracle Support's feedback with regards to R12 functionality for direct List Price update without using any modifier (manual or whatever). After all it is Oracle's product and they should know better. But test results in Solution Beacon's Vision 12.0.6 instance (http://www.solutionbeacon.com/tools_r12vision.htm) and documentation updates in R12 (R12.0.4) OM user guide & implementation manuals potray a different picture.
    After your last post, I did a test in Solution Beacon's Vision 12.0.6 instance with following details:
    OM: List Price Override Privilege = "Unlimited Access" at user level
    OM: Discounting Privileges = "None" at user level
    No manual modifiers defined and Order status = "Entered"
    I could display the "List Price" field from folder under Line Items >> Main tab, override the list price to a new value and save. The unit selling price showed the new value based on updated List Price as soon as I tabbed out of the list price field after overriding. After saving it showed the new selling price. _Please note that under Line Items >> Pricing tab there is another "List Price" field and that is not editable_. For such overrides "View Adjustments" (from Line >> Actions) will not show any adjustment details as it is a direct update of list price.
    Also please note that, if "Enforce List Price" checkbox is selected for the order type, the list price cannot be overridden even if the profile option is set to "Unlimited Access".
    Document References:
    Oracle® Order Management User's Guide
    Release 12, Part No. B28099-03, September 2007 >> R12.0.4
    Page No. 10-74
    +Note: Note: If any order line for an order has the Calculate Price Flag value equal to Partial Price or Freeze Price new order level adjustments will not be applied or allowed to be overridden. _The profile option OM: List Price Override  Privilege controls your ability to override the unit list price. If you have this profile set to Unlimited, you may modify the unit list price by editing the current value displayed_. The original list price is saved in a hidden folder field, so you can display it if necessary+.
    Page No. 10-94
    User Procedures
    _A new profile option, OM: List Price Override Privilege controls whether or not you can update the List Price_. It is enabled and updated at the application, responsibility and user level. It is not user visible and updatable. The values include+:
    - View Only: This is the default value. If set to this value, the current behavior is retained, which means unit list price field is protected.
    - Unlimited Privilege: If set to this value, you can override the unit list price field from the main tab and immediately see selling price adjusted accordingly.
    To use Override List Price:
    +1. Navigate to the Sales Orders/Quick Sales Orders window.+
    +2. Enter the header and line information, including the ordered item and quantity, then tab to the next field. The Selling Price and List Price display+.
    +3. If the profile is set to Unlimited Privilege, you can enter a new list price in the List Price field. You can either proceed to the next line or save your work+.
    +4. You can see the new, entered list price, and if there are automatic discounts applied, they will be based on the new list price+.
    +5. If the folder has been modified to show the Original List Price, the original list price displays+.
    +6. To change the List Price again, go to the list price field and enter a new value, replacing a previously entered value. If Audit Trail is enabled for List Price and a reason is required, a window appears to enter a reason and optional comments+.
    Note: Subsequent overrides of the List Price, after the order line is saved, can be captured by Audit Trail, depending on the setup of Audit Trail (entered or booked state) and any processing constraints that have been set up.
    In the OM Implementation Manual also there are notes related to this.
    OM Implementation Manual
    Release 12, Part No. B25975-03, September 2007 >> R12.0.4
    You can refer to page no. 2-59, C-4 etc.
    Thanks
    Supro

  • Price from Order Line and Price from QP_PREQ_PUB.PRICE_REQUEST is different

    Hi,
    I have trouble in using QP_PREQ_PUB.PRICE_REQUEST to derive the price of an item.
    RDBMS : 11.1.0.7.0
    Oracle Applications : 12.1.3
    From the Pricing Request Viewer or from Order Entry Line, The price lis coming as expected, but not from QP_PREQ_PUB.PRICE_REQUEST API.
    Here are the details -
    Primary Price List - 'Primary'
    Secondary Price List - 'Secondary1' - Item Price 40 (Precedence 150)
    Secondary Price List - 'Secondary2' - Item Price 25 (Precedence 130) , Custom Qualifier Qualifier_Attribute31 = > Attribute1('Yes/No') from Item Master.
    From the application, it is giving 25. Where as using the below code it is giving 40, Can you please advise what could be the issue/fix for it?
    DECLARE
    p_line_tbl QP_PREQ_GRP.LINE_TBL_TYPE;
    p_qual_tbl QP_PREQ_GRP.QUAL_TBL_TYPE;
    p_line_attr_tbl QP_PREQ_GRP.LINE_ATTR_TBL_TYPE;
    p_LINE_DETAIL_tbl QP_PREQ_GRP.LINE_DETAIL_TBL_TYPE;
    p_LINE_DETAIL_qual_tbl QP_PREQ_GRP.LINE_DETAIL_QUAL_TBL_TYPE;
    p_LINE_DETAIL_attr_tbl QP_PREQ_GRP.LINE_DETAIL_ATTR_TBL_TYPE;
    p_related_lines_tbl QP_PREQ_GRP.RELATED_LINES_TBL_TYPE;
    p_control_rec QP_PREQ_GRP.CONTROL_RECORD_TYPE;
    x_line_tbl QP_PREQ_GRP.LINE_TBL_TYPE;
    x_line_qual QP_PREQ_GRP.QUAL_TBL_TYPE;
    x_line_attr_tbl QP_PREQ_GRP.LINE_ATTR_TBL_TYPE;
    x_line_detail_tbl QP_PREQ_GRP.LINE_DETAIL_TBL_TYPE;
    x_line_detail_qual_tbl QP_PREQ_GRP.LINE_DETAIL_QUAL_TBL_TYPE;
    x_line_detail_attr_tbl QP_PREQ_GRP.LINE_DETAIL_ATTR_TBL_TYPE;
    x_related_lines_tbl QP_PREQ_GRP.RELATED_LINES_TBL_TYPE;
    x_return_status VARCHAR2(240);
    x_return_status_text VARCHAR2(240);
    qual_rec QP_PREQ_GRP.QUAL_REC_TYPE;
    line_attr_rec QP_PREQ_GRP.LINE_ATTR_REC_TYPE;
    line_rec QP_PREQ_GRP.LINE_REC_TYPE;
    detail_rec QP_PREQ_GRP.LINE_DETAIL_REC_TYPE;
    ldet_rec QP_PREQ_GRP.LINE_DETAIL_REC_TYPE;
    rltd_rec QP_PREQ_GRP.RELATED_LINES_REC_TYPE;
    x_price_contexts_result_tbl QP_Attr_Mapping_PUB.Contexts_Result_Tbl_Type;
    x_qual_contexts_result_tbl QP_Attr_Mapping_PUB.Contexts_Result_Tbl_Type;
    v_line_tbl_cnt integer;
    I BINARY_INTEGER;
    l_version VARCHAR2(240);
    l_file_val VARCHAR2(60);
    L_MODIFIER VARCHAR2(4000);
    L_ADJUSTMENT_AMOUNT VARCHAR2(300);
    L_MOD_NAME VARCHAR2(240);
    l_unit_price number;
    l_selling_price number;
    BEGIN
    MO_GLOBAL.INIT('ONT');
    MO_GLOBAL.SET_POLICY_CONTEXT('S',89);
    --FND_GLOBAL.APPS_INITIALIZE(1130,21623,660);
    DBMS_OUTPUT.PUT_LINE('1');
    v_line_tbl_cnt := 1;
    ---- Control Record
    p_control_rec.pricing_event := 'BATCH';
    p_control_rec.calculate_flag := QP_PREQ_GRP.G_SEARCH_N_CALCULATE;
    p_control_rec.simulation_flag := 'Y';
    p_control_rec.source_order_amount_flag := 'Y';
    p_control_rec.PUBLIC_API_CALL_FLAG := 'N';
    p_control_rec.rounding_flag := 'Q';
    p_control_Rec.manual_discount_flag := 'N';
    --p_control_rec.MANUAL_ADJUSTMENTS_CALL_FLAG := 'Y';
    p_control_rec.request_type_code := 'ONT';
    p_control_rec.TEMP_TABLE_INSERT_FLAG := 'Y';
    DBMS_OUTPUT.PUT_LINE('2');
    line_rec.request_type_code :='ONT';
    --line_rec.PRICE_LIST_HEADER_ID := 8007;
    line_rec.line_id :=2125125; -- Order Line Id. This can be any thing for this script
    line_rec.line_Index :=1; -- Request Line Index
    line_rec.line_type_code := 'LINE'; -- LINE or ORDER(Summary Line)
    line_rec.pricing_effective_date := TRUNC(sysdate); -- Pricing as of what date ?
    line_rec.active_date_first := TRUNC(sysdate); -- Can be Ordered Date or Ship Date
    line_rec.active_date_second := TRUNC(sysdate); -- Can be Ordered Date or Ship Date
    line_rec.active_date_first_type := 'ORD'; -- ORD/SHIP
    line_rec.active_date_second_type :='SHIP'; -- ORD/SHIP
    line_rec.line_quantity := 1; -- Ordered Quantity
    line_rec.line_uom_code := 'EA'; -- Ordered UOM Code
    line_rec.currency_code := 'USD'; -- Currency Code
    line_rec.price_flag := 'Y'; -- Price Flag can have 'Y' , 'N'(No pricing) , 'P'(Phase)
    p_line_tbl(1) := line_rec;
    DBMS_OUTPUT.PUT_LINE('3');
    ---- Line Attribute Record
    line_attr_rec.LINE_INDEX := 1;
    line_attr_rec.PRICING_CONTEXT :='ITEM'; --
    line_attr_rec.PRICING_ATTRIBUTE :='PRICING_ATTRIBUTE3';
    line_attr_rec.PRICING_ATTR_VALUE_FROM :='ALL';
    line_attr_rec.VALIDATED_FLAG :='Y';
    p_line_attr_tbl(1) := line_attr_rec;
    line_attr_rec.LINE_INDEX := 1;
    line_attr_rec.PRICING_CONTEXT :='ITEM'; --
    line_attr_rec.PRICING_ATTRIBUTE :='PRICING_ATTRIBUTE1';
    --line_attr_rec.COMPARISON_OPERATOR_CODE         := 'BETWEEN';
    line_attr_rec.PRICING_ATTR_VALUE_FROM := '4466'; -- INVENTORY ITEM ID
    line_attr_rec.VALIDATED_FLAG :='Y';
    p_line_attr_tbl(2) := line_attr_rec;
    line_attr_rec.LINE_INDEX := 1;
    line_attr_rec.PRICING_CONTEXT :='ITEM'; --
    line_attr_rec.PRICING_ATTRIBUTE :='PRICING_ATTRIBUTE1';
    --line_attr_rec.COMPARISON_OPERATOR_CODE         := 'BETWEEN';
    line_attr_rec.PRICING_ATTR_VALUE_FROM := '2395'; -- INVENTORY ITEM ID
    line_attr_rec.VALIDATED_FLAG :='Y';
    p_line_attr_tbl(3) := line_attr_rec;
    line_attr_rec.LINE_INDEX := 1;
    line_attr_rec.PRICING_CONTEXT :='ITEM'; --
    line_attr_rec.PRICING_ATTRIBUTE :='PRICING_ATTRIBUTE30';
    --line_attr_rec.COMPARISON_OPERATOR_CODE         := 'BETWEEN';
    line_attr_rec.PRICING_ATTR_VALUE_FROM := 'Yes'; -- INVENTORY ITEM ID
    line_attr_rec.VALIDATED_FLAG :='Y';
    p_line_attr_tbl(3) := line_attr_rec;
    DBMS_OUTPUT.PUT_LINE('4');
    ---- Qualifier Attribute Record
    qual_rec.LINE_INDEX := 1; -- Attributes for the above line. Attributes are attached with the line index
    qual_rec.QUALIFIER_CONTEXT :='MODLIST';
    qual_rec.QUALIFIER_ATTRIBUTE :='QUALIFIER_ATTRIBUTE4';
    qual_rec.QUALIFIER_ATTR_VALUE_FROM :='8007'; -- PRICE LIST ID
    qual_rec.COMPARISON_OPERATOR_CODE := '=';
    qual_rec.VALIDATED_FLAG :='Y';
    p_qual_tbl(1) := qual_rec;
    DBMS_OUTPUT.PUT_LINE('5');
    qual_rec.line_index := 1;
    qual_rec.qualifier_context := 'ITEM';
    qual_rec.qualifier_attribute := 'QUALIFIER_ATTRIBUTE31';
    qual_rec.qualifier_attr_value_from := 'Yes';
    qual_rec.comparison_operator_code := '=';
    qual_rec.validated_flag := 'Y';
    p_qual_tbl (2) := qual_rec;
    DBMS_OUTPUT.PUT_LINE('6');
    OE_ORDER_PUB.G_LINE.inventory_item_id := 4466;
    DBMS_OUTPUT.PUT_LINE(Fnd_Profile.VALUE('QP_CUSTOM_SOURCED') );
    --QP_Attr_Mapping_PUB.Build_Contexts
    --( p_request_type_code => 'ONT',
    -- p_line_index => 1,
    -- p_pricing_type_code => 'L'
    QP_Attr_Mapping_PUB.Build_Contexts(
    p_request_type_code => 'ONT',
    p_pricing_type => 'L',
    --p_org_id => 89,
    x_price_contexts_result_tbl => x_price_contexts_result_tbl,
    x_qual_contexts_result_tbl => x_qual_contexts_result_tbl );
    I := x_qual_contexts_result_tbl.FIRST;
    IF I IS NOT NULL THEN
    LOOP
    DBMS_OUTPUT.PUT_LINE('Context: '||x_qual_contexts_result_tbl(I).context_name);
    DBMS_OUTPUT.PUT_LINE('attribute_name: '||x_qual_contexts_result_tbl(I).attribute_name);
    DBMS_OUTPUT.PUT_LINE('attribute_value: '||x_qual_contexts_result_tbl(I).attribute_value);
    EXIT WHEN I = x_qual_contexts_result_tbl.LAST;
    I := x_qual_contexts_result_tbl.NEXT(I);
    END LOOP;
    END IF;
    I := x_price_contexts_result_tbl.FIRST;
    IF I IS NOT NULL THEN
    LOOP
    DBMS_OUTPUT.PUT_LINE('Context: '||x_price_contexts_result_tbl(I).context_name);
    DBMS_OUTPUT.PUT_LINE('attribute_name: '||x_price_contexts_result_tbl(I).attribute_name);
    DBMS_OUTPUT.PUT_LINE('attribute_value: '||x_price_contexts_result_tbl(I).attribute_value);
    EXIT WHEN I = x_price_contexts_result_tbl.LAST;
    I := x_price_contexts_result_tbl.NEXT(I);
    END LOOP;
    END IF;
    DBMS_OUTPUT.PUT_LINE(Fnd_Profile.VALUE('QP_CUSTOM_SOURCED') );
    DBMS_OUTPUT.PUT_LINE('7');
    l_version := QP_PREQ_GRP.GET_VERSION;
    dbms_output.put_line(OE_ORDER_PUB.G_LINE.price_list_id);
    dbms_output.put_line(OE_ORDER_PUB.G_LINE.inventory_item_id);
    QP_PREQ_PUB.PRICE_REQUEST
    (p_line_tbl,
    p_qual_tbl,
    p_line_attr_tbl,
    p_line_detail_tbl,
    p_line_detail_qual_tbl,
    p_line_detail_attr_tbl,
    p_related_lines_tbl,
    p_control_rec,
    x_line_tbl,
    x_line_qual,
    x_line_attr_tbl,
    x_line_detail_tbl,
    x_line_detail_qual_tbl,
    x_line_detail_attr_tbl,
    x_related_lines_tbl,
    x_return_status,
    x_return_status_text);
    -- Return Status Information ..
    DBMS_OUTPUT.PUT_LINE('8');
    DBMS_OUTPUT.PUT_LINE('Return Status text '|| x_return_status_text);
    DBMS_OUTPUT.PUT_LINE('Return Status '|| x_return_status);
    DBMS_OUTPUT.PUT_LINE('+---------Information Returned to Caller---------------------+ ');
    DBMS_OUTPUT.PUT_LINE('-------------Request Line Information-------------------');
    I := x_line_tbl.FIRST;
    IF I IS NOT NULL THEN
    LOOP
    DBMS_OUTPUT.PUT_LINE('Line Index: '||x_line_tbl(I).line_index);
    DBMS_OUTPUT.PUT_LINE('Unit_price: '||x_line_tbl(I).unit_price);
    DBMS_OUTPUT.PUT_LINE('Percent price: '||x_line_tbl(I).percent_price);
    DBMS_OUTPUT.PUT_LINE('Adjusted Unit Price: '||x_line_tbl(I).adjusted_unit_price);
    DBMS_OUTPUT.PUT_LINE('Pricing status code: '||x_line_tbl(I).status_code);
    DBMS_OUTPUT.PUT_LINE('Pricing status text: '||x_line_tbl(I).status_text);
    EXIT WHEN I = x_line_tbl.LAST;
    I := x_line_tbl.NEXT(I);
    END LOOP;
    END IF;
    DBMS_OUTPUT.PUT_LINE('-----------Pricing Attributes Information-------------');
    I := x_line_detail_attr_tbl.FIRST;
    IF I IS NOT NULL THEN
    LOOP
    DBMS_OUTPUT.PUT_LINE('Line detail Index '||x_line_detail_attr_tbl(I).line_detail_index);
    DBMS_OUTPUT.PUT_LINE('Context '||x_line_detail_attr_tbl(I).pricing_context);
    DBMS_OUTPUT.PUT_LINE('Attribute '||x_line_detail_attr_tbl(I).pricing_attribute);
    DBMS_OUTPUT.PUT_LINE('Value '||x_line_detail_attr_tbl(I).pricing_attr_value_from);
    DBMS_OUTPUT.PUT_LINE('Status Code '||x_line_detail_attr_tbl(I).status_code);
    DBMS_OUTPUT.PUT_LINE('---------------------------------------------------');
    EXIT WHEN I = x_line_detail_attr_tbl.last;
    I:=x_line_detail_attr_tbl.NEXT(I);
    END LOOP;
    END IF;
    DBMS_OUTPUT.PUT_LINE('-----------Qualifier Attributes Information-------------');
    I := x_line_detail_qual_tbl.FIRST;
    IF I IS NOT NULL THEN
    LOOP
    DBMS_OUTPUT.PUT_LINE('Line Detail Index '||x_line_detail_qual_tbl(I).line_detail_index);
    DBMS_OUTPUT.PUT_LINE('Context '||x_line_detail_qual_tbl(I).qualifier_context);
    DBMS_OUTPUT.PUT_LINE('Attribute '||x_line_detail_qual_tbl(I).qualifier_attribute);
    DBMS_OUTPUT.PUT_LINE('Value '||x_line_detail_qual_tbl(I).qualifier_attr_value_from);
    DBMS_OUTPUT.PUT_LINE('Status Code '||x_line_detail_qual_tbl(I).status_code);
    DBMS_OUTPUT.PUT_LINE('---------------------------------------------------');
    EXIT WHEN I = x_line_detail_qual_tbl.last;
    I:=x_line_detail_qual_tbl.NEXT(I);
    END LOOP;
    END IF;
    I := x_line_detail_tbl.FIRST;
    DBMS_OUTPUT.PUT_LINE('------------Price List/Discount Information------------');
    IF I IS NOT NULL THEN
    LOOP
    L_MOD_NAME := '';
    DBMS_OUTPUT.PUT_LINE('Line Index: '||x_line_detail_tbl(I).line_index);
    DBMS_OUTPUT.PUT_LINE('Line Detail Index: '||x_line_detail_tbl(I).line_detail_index);
    DBMS_OUTPUT.PUT_LINE('Line Detail Type:'||x_line_detail_tbl(I).line_detail_type_code);
    DBMS_OUTPUT.PUT_LINE('List Header Id: '||x_line_detail_tbl(I).list_header_id);
    DBMS_OUTPUT.PUT_LINE('List Line Id: '||x_line_detail_tbl(I).list_line_id);
    DBMS_OUTPUT.PUT_LINE('List Line Type Code: '||x_line_detail_tbl(I).list_line_type_code);
    DBMS_OUTPUT.PUT_LINE('Adjustment Amount : '||x_line_detail_tbl(I).adjustment_amount);
    DBMS_OUTPUT.PUT_LINE('Line Quantity : '||x_line_detail_tbl(I).line_quantity);
    DBMS_OUTPUT.PUT_LINE('Operand Calculation Code: '||x_line_detail_tbl(I).Operand_calculation_code);
    DBMS_OUTPUT.PUT_LINE('Operand value: '||x_line_detail_tbl(I).operand_value);
    DBMS_OUTPUT.PUT_LINE('Automatic Flag: '||x_line_detail_tbl(I).automatic_flag);
    DBMS_OUTPUT.PUT_LINE('Override Flag: '||x_line_detail_tbl(I).override_flag);
    DBMS_OUTPUT.PUT_LINE('status_code: '||x_line_detail_tbl(I).status_code);
    DBMS_OUTPUT.PUT_LINE('status text: '||x_line_detail_tbl(I).status_text);
    DBMS_OUTPUT.PUT_LINE('-------------------------------------------');
    EXIT WHEN I = x_line_detail_tbl.LAST;
    BEGIN
    SELECT NAME INTO L_MOD_NAME
    FROM QP_LIST_HEADERS_ALL
    WHERE LIST_HEADER_ID=x_line_detail_tbl(I).list_header_id
    AND x_line_detail_tbl(I).list_line_type_code <>'PLL'
    AND x_line_detail_tbl(I).adjustment_amount IS NOT NULL;
    L_MODIFIER := L_MODIFIER||'~'||L_MOD_NAME;
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END;
    IF x_line_detail_tbl(I).list_line_type_code <>'PLL' AND x_line_detail_tbl(I).adjustment_amount IS NOT NULL THEN
    L_ADJUSTMENT_AMOUNT := L_ADJUSTMENT_AMOUNT||'~'||x_line_detail_tbl(I).adjustment_amount;
    END IF;
    I := x_line_detail_tbl.NEXT(I);
    END LOOP;
    END IF;
    SELECT line_unit_price , order_uom_selling_price
    INTO l_unit_price , l_selling_price
    FROM qp_preq_lines_tmp
    WHERE pricing_status_code = Qp_Preq_Pub.g_status_updated
    ORDER BY line_id;
    DBMS_OUTPUT.PUT_LINE('Unit Price := '||l_unit_price);--x_line_tbl(1).UNIT_PRICE );
    DBMS_OUTPUT.PUT_LINE('Selling Price := '||l_selling_price);---x_line_tbl(1).LINE_UNIT_PRICE );
    DBMS_OUTPUT.PUT_LINE('L_MODIFIER: '||L_MODIFIER);
    DBMS_OUTPUT.PUT_LINE('L_ADJUSTMENT_AMOUNT: '||L_ADJUSTMENT_AMOUNT);
    DBMS_OUTPUT.PUT_LINE('--------------Related Lines Information for Price Breaks/Service Items---------------');
    I := x_related_lines_tbl.FIRST;
    IF I IS NOT NULL THEN
    LOOP
    DBMS_OUTPUT.PUT_LINE('Line Index :'||x_related_lines_tbl(I).line_index);
    DBMS_OUTPUT.PUT_LINE('Line Detail Index: '||x_related_lines_tbl(I).LINE_DETAIL_INDEX);
    DBMS_OUTPUT.PUT_LINE('Relationship Type Code: '||x_related_lines_tbl(I).relationship_type_code);
    DBMS_OUTPUT.PUT_LINE('Related Line Index: '||x_related_lines_tbl(I).RELATED_LINE_INDEX);
    DBMS_OUTPUT.PUT_LINE('Related Line Detail Index: '||x_related_lines_tbl(I).related_line_detail_index);
    DBMS_OUTPUT.PUT_LINE('Status Code: '|| x_related_lines_tbl(I).STATUS_CODE);
    EXIT WHEN I = x_related_lines_tbl.LAST;
    I := x_related_lines_tbl.NEXT(I);
    END LOOP;
    END IF;
    END; -- procedure --;
    Edited by: user7751421 on Apr 20, 2013 8:54 AM

    I tried with bellow code but it shows both Unit Price (price after apply all adjustment) and List price same_
    What I need is get unit selling price before order book, when customer called for inquiry only._
    DECLARE
    p_line_tbl QP_PREQ_GRP.LINE_TBL_TYPE;
    p_qual_tbl QP_PREQ_GRP.QUAL_TBL_TYPE;
    p_line_attr_tbl QP_PREQ_GRP.LINE_ATTR_TBL_TYPE;
    p_LINE_DETAIL_tbl QP_PREQ_GRP.LINE_DETAIL_TBL_TYPE;
    p_LINE_DETAIL_qual_tbl QP_PREQ_GRP.LINE_DETAIL_QUAL_TBL_TYPE;
    p_LINE_DETAIL_attr_tbl QP_PREQ_GRP.LINE_DETAIL_ATTR_TBL_TYPE;
    p_related_lines_tbl QP_PREQ_GRP.RELATED_LINES_TBL_TYPE;
    p_control_rec QP_PREQ_GRP.CONTROL_RECORD_TYPE;
    x_line_tbl QP_PREQ_GRP.LINE_TBL_TYPE;
    x_line_qual QP_PREQ_GRP.QUAL_TBL_TYPE;
    x_line_attr_tbl QP_PREQ_GRP.LINE_ATTR_TBL_TYPE;
    x_line_detail_tbl QP_PREQ_GRP.LINE_DETAIL_TBL_TYPE;
    x_line_detail_qual_tbl QP_PREQ_GRP.LINE_DETAIL_QUAL_TBL_TYPE;
    x_line_detail_attr_tbl QP_PREQ_GRP.LINE_DETAIL_ATTR_TBL_TYPE;
    x_related_lines_tbl QP_PREQ_GRP.RELATED_LINES_TBL_TYPE;
    x_return_status VARCHAR2 (240);
    x_return_status_text VARCHAR2 (240);
    qual_rec QP_PREQ_GRP.QUAL_REC_TYPE;
    line_attr_rec QP_PREQ_GRP.LINE_ATTR_REC_TYPE;
    line_rec QP_PREQ_GRP.LINE_REC_TYPE;
    detail_rec QP_PREQ_GRP.LINE_DETAIL_REC_TYPE;
    ldet_rec QP_PREQ_GRP.LINE_DETAIL_REC_TYPE;
    rltd_rec QP_PREQ_GRP.RELATED_LINES_REC_TYPE;
    x_price_contexts_result_tbl QP_Attr_Mapping_PUB.Contexts_Result_Tbl_Type;
    x_qual_contexts_result_tbl QP_Attr_Mapping_PUB.Contexts_Result_Tbl_Type;
    v_line_tbl_cnt INTEGER;
    I BINARY_INTEGER;
    l_version VARCHAR2 (240);
    l_file_val VARCHAR2 (60);
    L_MODIFIER VARCHAR2 (4000);
    L_ADJUSTMENT_AMOUNT VARCHAR2 (300);
    L_MOD_NAME VARCHAR2 (240);
    l_unit_price NUMBER;
    l_selling_price NUMBER;
    l_item_id number:=17155;
    BEGIN
    MO_GLOBAL.INIT ('ONT');
    MO_GLOBAL.SET_POLICY_CONTEXT ('S', 91);
    --FND_GLOBAL.APPS_INITIALIZE(1130,21623,660);
    DBMS_OUTPUT.PUT_LINE ('1');
    v_line_tbl_cnt := 1;
    ---- Control Record
    p_control_rec.pricing_event := 'LINE';
    p_control_rec.calculate_flag := 'Y';
    p_control_rec.simulation_flag := 'Y';
    p_control_rec.source_order_amount_flag := 'Y';
    p_control_rec.PUBLIC_API_CALL_FLAG := 'N';
    p_control_rec.rounding_flag := 'Q';
    p_control_Rec.manual_discount_flag := 'N';
    --p_control_rec.MANUAL_ADJUSTMENTS_CALL_FLAG := 'Y';
    p_control_rec.request_type_code := 'ONT';
    p_control_rec.TEMP_TABLE_INSERT_FLAG := 'Y';
    DBMS_OUTPUT.PUT_LINE ('2');
    line_rec.request_type_code := 'ONT';
    -- line_rec.PRICE_LIST_HEADER_ID := 386481;
    line_rec.line_id := 72202; -- Order Line Id. This can be any thing for this script
    line_rec.line_Index := 1; -- Request Line Index
    line_rec.line_type_code := 'LINE'; -- LINE or ORDER(Summary Line)
    line_rec.pricing_effective_date := TRUNC (SYSDATE); -- Pricing as of what date ?
    line_rec.active_date_first := TRUNC (SYSDATE); -- Can be Ordered Date or Ship Date
    line_rec.active_date_second := TRUNC (SYSDATE); -- Can be Ordered Date or Ship Date
    line_rec.active_date_first_type := 'ORD'; -- ORD/SHIP
    line_rec.active_date_second_type := 'SHIP'; -- ORD/SHIP
    line_rec.line_quantity := 10; -- Ordered Quantity
    line_rec.line_uom_code := 'Ea'; -- Ordered UOM Code
    line_rec.currency_code := 'USD'; -- Currency Code
    line_rec.price_flag := 'Y'; -- Price Flag can have 'Y' , 'N'(No pricing) , 'P'(Phase)
    p_line_tbl (1) := line_rec;
    DBMS_OUTPUT.PUT_LINE ('3');
    ---- Line Attribute Record
    line_attr_rec.LINE_INDEX := 1;
    line_attr_rec.PRICING_CONTEXT := 'ITEM'; --
    line_attr_rec.PRICING_ATTRIBUTE := 'PRICING_ATTRIBUTE3';
    line_attr_rec.PRICING_ATTR_VALUE_FROM := 'ALL';
    line_attr_rec.VALIDATED_FLAG := 'N';
    p_line_attr_tbl (1) := line_attr_rec;
    line_attr_rec.LINE_INDEX := 1;
    line_attr_rec.PRICING_CONTEXT := 'ITEM'; --
    line_attr_rec.PRICING_ATTRIBUTE := 'PRICING_ATTRIBUTE1';
    --line_attr_rec.COMPARISON_OPERATOR_CODE := 'BETWEEN';
    line_attr_rec.PRICING_ATTR_VALUE_FROM := '17155'; -- INVENTORY ITEM ID
    line_attr_rec.VALIDATED_FLAG := 'Y';
    p_line_attr_tbl (2) := line_attr_rec;
    -- line_attr_rec.LINE_INDEX := 1;
    -- line_attr_rec.PRICING_CONTEXT := 'ITEM'; --
    -- line_attr_rec.PRICING_ATTRIBUTE := 'PRICING_ATTRIBUTE1';
    -- --line_attr_rec.COMPARISON_OPERATOR_CODE := 'BETWEEN';
    -- line_attr_rec.PRICING_ATTR_VALUE_FROM := '72201'; -- INVENTORY ITEM ID
    -- line_attr_rec.VALIDATED_FLAG := 'Y';
    -- p_line_attr_tbl (3) := line_attr_rec;
    -- line_attr_rec.LINE_INDEX := 1;
    -- line_attr_rec.PRICING_CONTEXT := 'ITEM'; --
    -- line_attr_rec.PRICING_ATTRIBUTE := 'PRICING_ATTRIBUTE30';
    -- --line_attr_rec.COMPARISON_OPERATOR_CODE := 'BETWEEN';
    -- line_attr_rec.PRICING_ATTR_VALUE_FROM := 'Yes'; -- INVENTORY ITEM ID
    -- line_attr_rec.VALIDATED_FLAG := 'Y';
    -- p_line_attr_tbl (3) := line_attr_rec;
    DBMS_OUTPUT.PUT_LINE ('4');
    ---- Qualifier Attribute Record
    qual_rec.LINE_INDEX := 1; -- Attributes for the above line. Attributes are attached with the line index
    qual_rec.QUALIFIER_CONTEXT := 'MODLIST';
    qual_rec.QUALIFIER_ATTRIBUTE := 'QUALIFIER_ATTRIBUTE4';
    qual_rec.QUALIFIER_ATTR_VALUE_FROM := '386481'; -- PRICE LIST ID
    qual_rec.COMPARISON_OPERATOR_CODE := '=';
    qual_rec.VALIDATED_FLAG := 'Y';
    p_qual_tbl (1) := qual_rec;
    DBMS_OUTPUT.PUT_LINE ('5');
    -- qual_rec.line_index := 1;
    -- qual_rec.qualifier_context := 'ITEM';
    -- qual_rec.qualifier_attribute := 'QUALIFIER_ATTRIBUTE31';
    -- qual_rec.qualifier_attr_value_from := 'Yes';
    -- qual_rec.comparison_operator_code := '=';
    -- qual_rec.validated_flag := 'Y';
    -- p_qual_tbl (2) := qual_rec;
    qual_rec.LINE_INDEX := 1; -- Attributes for the above line. Attributes are attached with the line index
    qual_rec.QUALIFIER_CONTEXT := 'CUSTOMER';
    qual_rec.QUALIFIER_ATTRIBUTE := 'QUALIFIER_ATTRIBUTE5';
    qual_rec.QUALIFIER_ATTR_VALUE_FROM := 5728; -- Customer Account ID
    qual_rec.COMPARISON_OPERATOR_CODE := '=';
    qual_rec.VALIDATED_FLAG := 'Y';
    p_qual_tbl (3) := qual_rec;
    qual_rec.LINE_INDEX := 1;
    qual_rec.QUALIFIER_CONTEXT := 'ITEM_CATEGORY';
    qual_rec.QUALIFIER_ATTRIBUTE := 'QUALIFIER_ATTRIBUTE35';
    qual_rec.QUALIFIER_ATTR_VALUE_FROM := 'TOOLS.HARDWARE TOOLS (DISCOUNTABLE).'; -- item category
    qual_rec.COMPARISON_OPERATOR_CODE := '=';
    qual_rec.VALIDATED_FLAG := 'N';
    p_qual_tbl (4) := qual_rec;
    DBMS_OUTPUT.PUT_LINE ('6');
    OE_ORDER_PUB.G_LINE.inventory_item_id := l_item_id;
    DBMS_OUTPUT.PUT_LINE (Fnd_Profile.VALUE ('QP_CUSTOM_SOURCED'));
    --QP_Attr_Mapping_PUB.Build_Contexts
    --( p_request_type_code => 'ONT',
    -- p_line_index => 1,
    -- p_pricing_type_code => 'L'
    QP_Attr_Mapping_PUB.
    Build_Contexts (
    p_request_type_code => 'ONT',
    p_pricing_type => 'L',
    --p_org_id => 89,
    x_price_contexts_result_tbl => x_price_contexts_result_tbl,
    x_qual_contexts_result_tbl => x_qual_contexts_result_tbl);
    I := x_qual_contexts_result_tbl.FIRST;
    IF I IS NOT NULL
    THEN
    LOOP
    DBMS_OUTPUT.
    PUT_LINE (
    'Context: ' || x_qual_contexts_result_tbl (I).context_name);
    DBMS_OUTPUT.
    PUT_LINE (
    'attribute_name: '
    || x_qual_contexts_result_tbl (I).attribute_name);
    DBMS_OUTPUT.
    PUT_LINE (
    'attribute_value: '
    || x_qual_contexts_result_tbl (I).attribute_value);
    EXIT WHEN I = x_qual_contexts_result_tbl.LAST;
    I := x_qual_contexts_result_tbl.NEXT (I);
    END LOOP;
    END IF;
    I := x_price_contexts_result_tbl.FIRST;
    IF I IS NOT NULL
    THEN
    LOOP
    DBMS_OUTPUT.
    PUT_LINE (
    'Context: ' || x_price_contexts_result_tbl (I).context_name);
    DBMS_OUTPUT.
    PUT_LINE (
    'attribute_name: '
    || x_price_contexts_result_tbl (I).attribute_name);
    DBMS_OUTPUT.
    PUT_LINE (
    'attribute_value: '
    || x_price_contexts_result_tbl (I).attribute_value);
    EXIT WHEN I = x_price_contexts_result_tbl.LAST;
    I := x_price_contexts_result_tbl.NEXT (I);
    END LOOP;
    END IF;
    DBMS_OUTPUT.PUT_LINE (' Fnd_Profile.VALUE (QP_CUSTOM_SOURCED): ' || Fnd_Profile.VALUE ('QP_CUSTOM_SOURCED'));
    DBMS_OUTPUT.PUT_LINE ('7');
    l_version := QP_PREQ_GRP.GET_VERSION;
    DBMS_OUTPUT.put_line (OE_ORDER_PUB.G_LINE.price_list_id);
    DBMS_OUTPUT.put_line (OE_ORDER_PUB.G_LINE.inventory_item_id);
    QP_PREQ_PUB.PRICE_REQUEST (p_line_tbl,
    p_qual_tbl,
    p_line_attr_tbl,
    p_line_detail_tbl,
    p_line_detail_qual_tbl,
    p_line_detail_attr_tbl,
    p_related_lines_tbl,
    p_control_rec,
    x_line_tbl,
    x_line_qual,
    x_line_attr_tbl,
    x_line_detail_tbl,
    x_line_detail_qual_tbl,
    x_line_detail_attr_tbl,
    x_related_lines_tbl,
    x_return_status,
    x_return_status_text);
    -- Return Status Information ..
    DBMS_OUTPUT.PUT_LINE ('8');
    DBMS_OUTPUT.PUT_LINE ('Return Status text ' || x_return_status_text);
    DBMS_OUTPUT.PUT_LINE ('Return Status ' || x_return_status);
    DBMS_OUTPUT.
    PUT_LINE (
    '+---------Information Returned to Caller---------------------+ ');
    DBMS_OUTPUT.
    PUT_LINE ('-------------Request Line Information-------------------');
    I := x_line_tbl.FIRST;
    IF I IS NOT NULL
    THEN
    LOOP
    DBMS_OUTPUT.PUT_LINE ('Line Index: ' || x_line_tbl (I).line_index);
    DBMS_OUTPUT.PUT_LINE ('Unit_price: ' || x_line_tbl (I).unit_price);
    DBMS_OUTPUT.
    PUT_LINE ('Percent price: ' || x_line_tbl (I).percent_price);
    DBMS_OUTPUT.
    PUT_LINE (
    'Adjusted Unit Price: ' || x_line_tbl (I).adjusted_unit_price);
    DBMS_OUTPUT.
    PUT_LINE ('Pricing status code: ' || x_line_tbl (I).status_code);
    DBMS_OUTPUT.
    PUT_LINE ('Pricing status text: ' || x_line_tbl (I).status_text);
    EXIT WHEN I = x_line_tbl.LAST;
    I := x_line_tbl.NEXT (I);
    END LOOP;
    END IF;
    DBMS_OUTPUT.
    PUT_LINE ('-----------Pricing Attributes Information-------------');
    I := x_line_detail_attr_tbl.FIRST;
    IF I IS NOT NULL
    THEN
    LOOP
    DBMS_OUTPUT.
    PUT_LINE (
    'Line detail Index '
    || x_line_detail_attr_tbl (I).line_detail_index);
    DBMS_OUTPUT.
    PUT_LINE ('Context ' || x_line_detail_attr_tbl (I).pricing_context);
    DBMS_OUTPUT.
    PUT_LINE (
    'Attribute ' || x_line_detail_attr_tbl (I).pricing_attribute);
    DBMS_OUTPUT.
    PUT_LINE (
    'Value ' || x_line_detail_attr_tbl (I).pricing_attr_value_from);
    DBMS_OUTPUT.
    PUT_LINE ('Status Code ' || x_line_detail_attr_tbl (I).status_code);
    DBMS_OUTPUT.
    PUT_LINE ('---------------------------------------------------');
    EXIT WHEN I = x_line_detail_attr_tbl.LAST;
    I := x_line_detail_attr_tbl.NEXT (I);
    END LOOP;
    END IF;
    DBMS_OUTPUT.
    PUT_LINE ('-----------Qualifier Attributes Information-------------');
    I := x_line_detail_qual_tbl.FIRST;
    IF I IS NOT NULL
    THEN
    LOOP
    DBMS_OUTPUT.
    PUT_LINE (
    'Line Detail Index '
    || x_line_detail_qual_tbl (I).line_detail_index);
    DBMS_OUTPUT.
    PUT_LINE (
    'Context ' || x_line_detail_qual_tbl (I).qualifier_context);
    DBMS_OUTPUT.
    PUT_LINE (
    'Attribute ' || x_line_detail_qual_tbl (I).qualifier_attribute);
    DBMS_OUTPUT.
    PUT_LINE (
    'Value ' || x_line_detail_qual_tbl (I).qualifier_attr_value_from);
    DBMS_OUTPUT.
    PUT_LINE ('Status Code ' || x_line_detail_qual_tbl (I).status_code);
    DBMS_OUTPUT.
    PUT_LINE ('---------------------------------------------------');
    EXIT WHEN I = x_line_detail_qual_tbl.LAST;
    I := x_line_detail_qual_tbl.NEXT (I);
    END LOOP;
    END IF;
    I := x_line_detail_tbl.FIRST;
    DBMS_OUTPUT.
    PUT_LINE ('------------Price List/Discount Information------------');
    IF I IS NOT NULL
    THEN
    LOOP
    L_MOD_NAME := '';
    DBMS_OUTPUT.
    PUT_LINE ('Line Index: ' || x_line_detail_tbl (I).line_index);
    DBMS_OUTPUT.
    PUT_LINE (
    'Line Detail Index: ' || x_line_detail_tbl (I).line_detail_index);
    DBMS_OUTPUT.
    PUT_LINE (
    'Line Detail Type:'
    || x_line_detail_tbl (I).line_detail_type_code);
    DBMS_OUTPUT.
    PUT_LINE (
    'List Header Id: ' || x_line_detail_tbl (I).list_header_id);
    DBMS_OUTPUT.
    PUT_LINE ('List Line Id: ' || x_line_detail_tbl (I).list_line_id);
    DBMS_OUTPUT.
    PUT_LINE (
    'List Line Type Code: '
    || x_line_detail_tbl (I).list_line_type_code);
    DBMS_OUTPUT.
    PUT_LINE (
    'Adjustment Amount : ' || x_line_detail_tbl (I).adjustment_amount);
    DBMS_OUTPUT.
    PUT_LINE ('Line Quantity : ' || x_line_detail_tbl (I).line_quantity);
    DBMS_OUTPUT.
    PUT_LINE (
    'Operand Calculation Code: '
    || x_line_detail_tbl (I).Operand_calculation_code);
    DBMS_OUTPUT.
    PUT_LINE ('Operand value: ' || x_line_detail_tbl (I).operand_value);
    DBMS_OUTPUT.
    PUT_LINE (
    'Automatic Flag: ' || x_line_detail_tbl (I).automatic_flag);
    DBMS_OUTPUT.
    PUT_LINE ('Override Flag: ' || x_line_detail_tbl (I).override_flag);
    DBMS_OUTPUT.
    PUT_LINE ('status_code: ' || x_line_detail_tbl (I).status_code);
    DBMS_OUTPUT.
    PUT_LINE ('status text: ' || x_line_detail_tbl (I).status_text);
    DBMS_OUTPUT.PUT_LINE ('-------------------------------------------');
    EXIT WHEN I = x_line_detail_tbl.LAST;
    BEGIN
    SELECT NAME
    INTO L_MOD_NAME
    FROM QP_LIST_HEADERS_ALL
    WHERE LIST_HEADER_ID = x_line_detail_tbl (I).list_header_id
    AND x_line_detail_tbl (I).list_line_type_code = 'PLL'
    AND x_line_detail_tbl (I).adjustment_amount IS NOT NULL;
    L_MODIFIER := L_MODIFIER || '~' || L_MOD_NAME;
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL;
    END;
    IF x_line_detail_tbl (I).list_line_type_code = 'PLL'
    AND x_line_detail_tbl (I).adjustment_amount IS NOT NULL
    THEN
    L_ADJUSTMENT_AMOUNT :=
    L_ADJUSTMENT_AMOUNT
    || '~'
    || x_line_detail_tbl (I).adjustment_amount;
    END IF;
    I := x_line_detail_tbl.NEXT (I);
    END LOOP;
    END IF;
    SELECT line_unit_price, order_uom_selling_price
    INTO l_unit_price, l_selling_price
    FROM qp_preq_lines_tmp
    WHERE pricing_status_code = Qp_Preq_Pub.g_status_updated
    ORDER BY line_id;
    DBMS_OUTPUT.PUT_LINE ('Unit Price := ' || l_unit_price); --x_line_tbl(1).UNIT_PRICE );
    DBMS_OUTPUT.PUT_LINE ('Selling Price := ' || l_selling_price); ---x_line_tbl(1).LINE_UNIT_PRICE );
    DBMS_OUTPUT.PUT_LINE ('L_MODIFIER: ' || L_MODIFIER);
    DBMS_OUTPUT.PUT_LINE ('L_ADJUSTMENT_AMOUNT: ' || L_ADJUSTMENT_AMOUNT);
    DBMS_OUTPUT.
    PUT_LINE (
    '--------------Related Lines Information for Price Breaks/Service Items---------------');
    I := x_related_lines_tbl.FIRST;
    IF I IS NOT NULL
    THEN
    LOOP
    DBMS_OUTPUT.
    PUT_LINE ('Line Index :' || x_related_lines_tbl (I).line_index);
    DBMS_OUTPUT.
    PUT_LINE (
    'Line Detail Index: '
    || x_related_lines_tbl (I).LINE_DETAIL_INDEX);
    DBMS_OUTPUT.
    PUT_LINE (
    'Relationship Type Code: '
    || x_related_lines_tbl (I).relationship_type_code);
    DBMS_OUTPUT.
    PUT_LINE (
    'Related Line Index: '
    || x_related_lines_tbl (I).RELATED_LINE_INDEX);
    DBMS_OUTPUT.
    PUT_LINE (
    'Related Line Detail Index: '
    || x_related_lines_tbl (I).related_line_detail_index);
    DBMS_OUTPUT.
    PUT_LINE ('Status Code: ' || x_related_lines_tbl (I).STATUS_CODE);
    EXIT WHEN I = x_related_lines_tbl.LAST;
    I := x_related_lines_tbl.NEXT (I);
    END LOOP;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.
    PUT_LINE ('SQLERRM' || SQLERRM);
    END;
    Kindly provide sugession if I miss any thing.
    Regards,
    Akil
    Edited by: 1004537 on May 9, 2013 7:20 AM
    Edited by: 1004537 on May 9, 2013 7:20 AM

  • Manual price change on Sales Order line

    Hi everyone,
    Say I have a product A and have entered this in the price list Product A = USD 100 per unit.
    I create the order and process the order, do ship confirm, but at the time of creating the invoice, I want to change the price to 97. or 95 or whatever. This is not fixed and depends probably on various business factors not in anyone's control.
    I tried to manually change the price on the sales order line, but it is not allowing me to change, saying 'no manual discounts available'. My questions are :
    1. How can I manually change the price of a product at the time of invoicing?
    2. I have not defined any modifiers or qualifiers. Is this required, and if yes, what type and how to do it.
    3. At what level can the price be changed? at order booking or even after ship confirm?
    4. If I change the price today, this price change will be applicable to what orders? All orders with booked statuses, or all orders which are not yet ship confirmed, or all orders not interfaced or all future orders entered after this price change is saved?
    5. Do I need to make this price change in the price list also?
    Pls reply asap.
    Thanks a lot in advance.
    Sudhindra Desai

    Hi Sudhindra,
    Check out if this helps:
    1. How can I manually change the price of a product at the time of invoicing?
    You cannot change the price once invoicing is done or when the Order Line Status becomes 'Closed' . Any change at the order entry level can only be effected till the Order Line Status is in 'Entered' Stage.
    2. I have not defined any modifiers or qualifiers. Is this required, and if yes, what type and how to do it.
    We have defined a modifier for our business purpose where by we can manually change the Price at the order entry level. If you require I can send you the screen shots of the setups we have done. I would need your e-mail id for that.
    3. At what level can the price be changed? at order booking or even after ship confirm?
    Price can be changed till the order is in 'Entered Stage'. It cannot be changed once it is 'Booked'
    4. If I change the price today, this price change will be applicable to what orders? All orders with booked statuses, or all orders which are not yet ship confirmed, or all orders not interfaced or all future orders entered after this price change is saved?
    I did'nt understand this question actually. I think the price change is done on an order to order basis, if it is done for a particular order I don't think so it would affect further orders. If i'm changing the price in my price list then surely it would affect future orders.
    5. Do I need to make this price change in the price list also?
    This depends on ur business situation. If the price change is permanent u can make the changes in the price list also. Our business situation demands a base price to be defined in the price list even though the price we enter at the order entry level is always different from what comes from the attached price list.
    Hope this helps you.
    Regards,
    Anil Wadhwa

  • Routine or exit in modifying return order in reference to an invoice...

    Hello Experts,
    Is there a routine(inside VOFM) or user-exit to modify the values being passed
    from the original invoice document to the return order being created. Presently,
    we are having a problem when the original invoice has a rebate condition and when we
    create multiple line items with the same material in the return order, the succeeding
    line items references its rebate discount in the wrong material in the invoice document.
    Example:
    Original Sales Invoice 3010002390
    Line Item No.     SKU          Quantity     Total Rebate Discount          Per Unit Rebate Discount
    10          100315          10               128.07                    12.81
    20          106666          10               128.07                    12.81
    30          100338          10               243.86                    24.39
    Return Order 1120000402  (repeatedly created with reference to the same sales invoice number)
    20          106666          1               12.81                    12.81
    30          106666          1               24.39                    24.39
    For Return Order line 30, it should have picked the price 12.81 instead it picked 24.39,
    which is the same line item with the original sales invoice

    How do you create the return orders?
    From your example it looks like there is an error somewhere in the custom code. Either a variable is not cleaned up or an internal table is read, then manipulated and the previous record is not restored in the memory, etc. Also the program might be looking at the line number (POSNR) without considering the material number. Or, if you use a custom program to create the returns, the problem might be there.
    Take a look at the configuration of Copy Control. In SPRO, go to Sales & Distribution -> Sales -> Sales Documents -> Maintain Copy Control for Sales Documents -> Copying Control: Billing Document to Sales Document. Then find you document type combination (could be target = RE, source = F2) and double-click on it. There you will see the routines (VOFM) that are assigned to the copy control. Also check the config for Items and Schedule Lines (see the lefthand window there). There could be something different attached to each item type.
    Also check if there is anything in the pricing user exits, you'll find a list here:
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/erplo/copyofSDUserexits
    Good luck!

  • User exit for changing Sales order lines.

    Hello experts ,
    I want to delete the field "ROUTE" from all of the orders lines in sales orders, I have been using "USEREXIT_SAVE_DOCUMENT_PREPARE"  but it does not seems to do the job.
    What is the name of  user exit that i have to use for this task and which structure should be used,  is it xvbap ? is it vbap ?
    Thanks for the help.
    Avi.

    Hi,
    find the user exit u required.
    This IMG step describes additional installation-specific processing in sales document processing. In particular, the required INCLUDES and user exits are described.
    Involved program components
    System modifications for sales document processing affect different areas. Depending on the modification, you make the changes in the program components provided:
    MV45ATZZ
    For entering metadata for sales document processing. User-specific metadata must start with "ZZ".
    MV45AOZZ
    For entering additional installation-specific modules for sales document processing which are called up by the screen and run under PBO (Process Before Output) prior to output of the screen. The modules must start with "ZZ".
    MV45AIZZ
    For entering additional installation-specific modules for sales document processing. These are called up by the screen and run under PAI (Process After Input) after data input (for example, data validation). The modules must start with "ZZ".
    MV45AFZZ and MV45EFZ1
    For entering installation-specific FORM routines and for using user exits, which may be required and can be used if necessary. These program components are called up by the modules in MV45AOZZ or MV45AIZZ.
    User exits in the program MV45AFZZ
    The user exits which you can use for modifications in sales document processing are listed below.
    USEREXIT_DELETE_DOCUMENT
    This user exit can be used for deleting data which was stored in a separate table during sales document creation, for example, if the sales document is deleted.
    For example, if an additional table is filled with the name of the person in charge (ERNAM) during order entry, this data can also be deleted after the sales order has been deleted.
    The user exit is called up at the end of the FORM routine BELEG_LOESCHEN shortly before the routine BELEG_SICHERN.
    USEREXIT_FIELD_MODIFICATION
    This user exit can be used to modify the attributes of the screen fields.
    To do this, the screen fields are allocated to so-called modification groups 1 - 4 and can be edited together during a modification in ABAP. If a field has no field name, it cannot be allocated to a group.
    The usage of the field groups (modification group 1-4) is as follows:
    Modification group 1: Automatic modification with transaction MFAW
    Modification group 2: It contains 'LOO' for step loop fields
    Modification group 3: For modifications which depend on check tables or on other fixed information
    Modification group 4: is not used
    The FORM routine is called up for every field of a screen. If you require changes to be made, you must make them in this user exit.
    This FORM routine is called up by the module FELDAUSWAHL.
    See the Screen Painter manual for further information on structuring the interface.
    USEREXIT_MOVE_FIELD_TO_VBAK
    Use this user exit to assign values to new fields at sales document header level. It is described in the section "Transfer of the customer master fields into the sales document".
    The user exit is called up at the end of the FORM routine VBAK_FUELLEN.
    USEREXIT_MOVE_FIELD_TO_VBAP
    Use this user exit to assign values to new fields at sales document item level. It is described in the section "Copy customer master fields into the sales document".
    The user exit is called up at the end of the FORM routine VBAP_FUELLEN.
    USEREXIT_MOVE_FIELD_TO_VBEP
    Use this user exit to assign values to new fields at the level of the sales document schedule lines.
    The user exit is called up at the end of the FORM routine VBEP_FUELLEN.
    USEREXIT_MOVE_FIELD_TO_VBKD
    Use this user exit to assign values to new fields for business data of the sales document. It is described in the section "Copy customer master fields into sales document".
    The user exit is called up at the end of the FORM routine VBKD_FUELLEN.
    USEREXIT_NUMBER_RANGE
    Use this user exit to define the number ranges for internal document number assignment depending on the required fields. For example, if you want to define the number range depending on the sales organization (VKORG) or on the selling company (VKBUR), use this user exit.
    The user exit is called up in the FORM routine BELEG_SICHERN.
    USEREXIT_PRICING_PREPARE_TKOMK
    Use this user exit if you want to include and assign a value to an additional header field in the communication structure KOMK taken as a basis for pricing.
    USEREXIT_PRICING_PREPARE_TKOMP
    Use this user exit if you want to include or assign a value to an additional item field in the communication structure KOMP taken as a basis for pricing.
    USEREXIT_READ_DOCUMENT
    You use this user exit if further additional tables are to be read when importing TA01 or TA02.
    The user exit is called up at the end of the FORM routine BELEG_LESEN.
    USEREXIT_SAVE_DOCUMENT
    Use this user exit to fill user-specific statistics update tables.
    The user exit is called up by the FORM routine BELEG-SICHERN before the COMMIT command.
    Note
    If a standard field is changed, the field r185d-dataloss is set to X. The system queries this indicator at the beginning of the safety routine. This is why this indicator must also be set during the maintenance of user-specific tables that are also to be saved.
    USEREXIT_SAVE_DOCUMENT_PREPARE
    Use this user exit to make certain changes or checks immediately before saving a document. It is the last possibility for changing or checking a document before posting.
    The user exit is carried out at the beginning of the FORM routine BELEG_SICHERN.
    User exits in the program MV45AFZA
    USEREXIT_MOVE_FIELD_TO_KOMKD
    Use this user exit to include or assign values to additional header fields in the communication structure KOMKD taken as a basis for the material determination. This is described in detail in the section "New fields for material determination".
    USEREXIT_MOVE_FIELD_TO_KOMPD
    Use this user exit to include or assign values to additional item fields in the communication structure KOMPD taken as a basis for the material determination. This is described in detail in the section "New fields for material determination".
    USEREXIT_MOVE_FIELD_TO_KOMKG
    Use this user exit to include or assign values to additional fields in the communication structure KOMKG taken as a basis for material determination and material listing. This is described in detail in the section "New fields for listing/exclusion".
    USEREXIT_MOVE_FIELD_TO_KOMPG
    Use this user exit to include or assign values to additional fields in the communication structure KOMPG taken as a basis for material determination and material listung. This is described in detail in the section "New fields for listing/exclusion".
    USEREXIT_REFRESH_DOCUMENT
    With this user exit, you can reset certain customer-specific fields as soon as processing of a sales document is finished and before the following document is edited.
    For example, if the credit limit of the sold-to party is read during document processing, in each case it must be reset again before processing the next document so that the credit limit is not used for the sold-to party of the following document.
    The user exit is executed when a document is saved if you leave the processing of a document with F3 or F15.
    The user exit is called up at the end of the FORM routine BELEG_INITIALISIEREN.
    User-Exits in program MV45AFZB
    USEREXIT_CHECK_XVBAP_FOR_DELET
    In this user exit, you can enter additional data for deletion of an item. If the criteria are met, the item is not deleted (unlike in the standard system).
    USEREXIT_CHECK_XVBEP_FOR_DELET
    In this user exit, you can enter additional data for deletion of a schedule line. If the criteria are met, the schedule line is not deleted (unlike in the standard system).
    USEREXIT_CHECK_VBAK
    This user exit can be used to carry out additional checks (e.g. for completion) in the document header. The system could, for example, check whether certain shipping conditions are allowed for a particular customer group.
    USEREXIT_CHECK_VBAP
    This user exit can be used to carry out additional checks (e.g. for completion) at item level.
    USEREXIT_CHECK_VBKD
    The user exit can be used to carry out additional checks (e.g. for completion) on the business data in the order.
    USEREXIT_CHECK_VBEP
    This user exit can be use to carry out additional checks (e.g. for completion) on the schedule line. During BOM explosion, for example, you may want certain fields to be copied from the main item to the sub-items (as for billing block in the standard system).
    USEREXIT_CHECK_VBSN
    You can use this user exit to carry out additional checks (e.g. for completion) on the serial number.
    USEREXIT_CHECK_XVBSN_FOR_DELET In this user exit, you can enter additional criteria for deletion of the serial number. If the criteria are met, the serial number is not deleted (unlike in the standard system).
    USEREXIT_FILL_VBAP_FROM_HVBAP
    You can use this user exit to fill additional fields in the sub-item with data from the main item.
    USEREXIT_MOVE_FIELD_TO_TVCOM_H
    You can use this user exit to influence text determination for header texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
    USEREXIT_MOVE_FIELD_TO_TVCOM_I
    You can use this user exit to influence text determination for item texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
    User-Exits for product allocation:
    The following user exits all apply to structure COBL, in which the data for account determination is copied to item level.
    USEREXIT_MOVE_FIELD_TO_COBL
    Option to include new fields in structure COBL.
    USEREXIT_COBL_RECEIVE_VBAK
    Option to assign values from the document header to the new fields.
    USEREXIT_COBL_RECEIVE_VBAP
    Option to supply values from the item to the new fields.
    USEREXIT_COBL_SEND_ITEM
    A changed field can be copied from the structure into the item. You could use the user exit to display a certain field in the account assignment block (see also MV45AFZB).
    USEREXIT_COBL_SEND_HEADER
    A changed field can be copied from the structure to the header (see source text MV45AFZB)
    USEREXIT_SOURCE_DETERMINATION
    You can use this user exit to determine which plant will be used for the delivery. In the standard system, the delivering plant is copied from the customer master or the customer-material info record. If you want to use a different rule, then you must enter it in this user exit.
    USEREXIT_MOVE_FIELD_TO_ME_REQ
    With this user exit you can include additional fields for the following fields:
    EBAN (purchase requisition)
    EBKN (purchase requisition-account assignment)
    USEREXIT_GET_FIELD_FROM_SDCOM
    Option to include new fields for the variant configuration. Fields that are included in structure SDCOM can be processed and then returned to the order.
    USEREXIT_MOVE_WORKAREA_TO_SDWA
    You can use this user exit to format additional work areas for the variant configuration. You will find notes on the user exit in MV45AFZB.
    User-Exits for first data transfer:
    The following user exits can only be used for the first data transfer.
    Note
    Only use the user exits if the names/fields do NOT have the same name.
    USEREXIT_MOVE_FIELD_TO_VBAKKOM
    Option to include additional fields in structure VBAKKOM (communiction fields for maintaining the sales document header)
    USEREXIT_MOVE_FIELD_TO_VBAPKOM
    Option to include additional fields in structure VBAPKOM (communication fields for maintaining a sales item)
    USEREXIT_MOVE_FIELD_TO_VBEPKOM
    Option to include additional fields in structure VBEPKOM (communication fields for maintaining a sales document schedule line)
    USEREXIT_MOVE_FIELD_TO_VBSN
    You can use this user exit to include fields in structure VBSN (scheduling agreement-related change status).
    USEREXIT_MOVE_FIELD_TO_KOMKH
    You can use this user exit to include new fields for batch determination (document header).
    USEREXIT_MOVE_FIELD_TO_KOMPH
    You can use this user exit to include new fields for batch determination (document item).
    USEREXIT_CUST_MATERIAL_READ
    You can use this user exit to set another customer number in the customer material info record (e.g. with a customer hierarchy)
    USEREXIT_NEW_PRICING_VBAP
    Option for entry of preconditions for carrying out pricing again (e.g. changes made to a certain item field could be used as the precondition for pricing to be carried out again). Further information in MV45AFZB.
    USEREXIT_NEW_PRICING_VBKD
    Option for entry of preconditions for carrying out pricing again (e.g. changes to the customer group or price group could be set as the preconditions for the system to carry out pricing again). Further information in MV45AFZB.
    User-Exits in Program MV45AFZD
    USEREXIT_CONFIG_DATE_EXPLOSION
    The BOM is exploded in the order with the entry date. You can use this user exit to determine which data should be used to explode the BOM (explosion with required delivery date, for example).
    User exits in the program FV45EFZ1
    USEREXIT_CHANGE_SALES_ORDER
    In the standard SAP R/3 System, the quantity and confirmed date of the sales document schedule line is changed automatically if a purchase requisition is allocated, and it or the sales document is changed (for example, quantity, date).
    If you want to change this configuration in the standard system, you can define certain requirements in order to protect your sales orders from being changed automatically. Use this user exit for this purpose. Decide at this point whether the schedule lines are to be changed.
    User-Exits in Program RV45PFZA
    USEREXIT_SET_STATUS_VBUK
    In this user exit you can you can store a specification for the reserve fields in VBUK (header status). Reserve field UVK01 could, for example, be used for an additional order status (as for rejections status, etc.).
    The following workareas are available for this user exit:
    VBUK (header status)
    FXVBUP (item status)
    FXVBUV (Incompletion)
    USEREXIT_SET_STATUS_VBUP
    In this user exit you can you can store a specification for the reserve fields for VBUP (item status).
    The following workareas are available for this user exit:
    FXVBAP (Item data)
    FXVBAPF (Dynamic part of order item flow)
    FXVBUV (Incompletion)
    USEREXIT_STATUS_VBUK_INVOICE
    You can use this user exit to influence billing status at header level.
    User exits in the screens
    Additional header data is on screen SAPMV45A 0309, additional item data on screen SAPMV45A 0459. These screens contain the Include screens SAPMV45A 8309 or SAPMV45A 8459 as user exits.
    Fields which are also to be included in the sales document for a specific installation should be included on the Include screens for maintaining. If an application-specific check module is needed for the fields, this can be included in the Include MV45AIZZ. The module is called up in the processing logic of the Include screens.
    For field transports, you do not have to make changes or adjustments.
    Example
    A new field, VBAK-ZZKUN, should be included in table VBAK.
    If the check is defined via the Dictionary (fixed values or check table) the field must be included with the fullscreen editor in the Include screen SAPMV45A 8309. In this case, no change has to be made to the processing logic.
    User Exits in Program MV45AFZ4
    USEREXIT_MOVE_FIELD_TO_KOMK
    You can use this user exit to add or edit additional header fields in the communication structure - KOMK- for free goods determination. For more information, see the New Fields for Free Goods Determination IMG activity.
    USEREXIT_MOVE_FIELD_TO_KOMP
    You can use this user exit to add or edit additional item fields in the communication structure KOMP for free goods determination. For more information see the New Fields for Free Goods Determination IMG activity.
    User Exits in the SAPFV45PF0E and SAPFV45PF0C Programs
    EXIT_SAPFV45P_001
    Best regards,
    venkatawamy.y

  • Cash Discount Calculated for One Line Item and not for Other

    Hi All,
    We have devloped a Z program which is used to Write of InterCompany AR and AP recon Account to another GL Account. In this program to clear line item we have created a BDC which calls t-code FB05. Thsi program is running perfectly fine for all company codes.
    There is new company code SG20 for which it is not clearing the line items. It has created a Session in SM35, when we analysed the seesin we found that for some line items system is calculating Cash Discount and for some other line items it is not but the payment Term is same for all the douments with 3% 14days.
    I need your help in understanding that why for some line items system calculates the Cash Discout where as for others it is not calculation..also the Posting Date is same for all the documents.
    Please advise what could be the reson for this.
    Thanks!
    Regards,
    VIvek Srivastava

    Hi
    Cash discount is calculated based on the combination of baseline date and payment term conditions.
    Hence please check the baseline date for all the documents, in which the cash discount is not appearing.
    In your case, the possible reasons could be that 1) baseline date is different between these documents or 2) payment terms cash % is manually modified in the line item of the documents.
    Regards

Maybe you are looking for

  • What's wrong with this firewall config? (Basic setup)

    I've got a single router (IOS 15.0), 1 inside interface (vlan1) and one outside int, gig0.  Using Zone-based firewall.  Router has NAT, using a static entry as follows: ip nat inside source static tcp 192.168.5.150 3389 <my external ip> 35411 extenda

  • Two commands suddenly greyed out in QT 7

    I have the registered version of Quicktime Player Pro 7. In the Registration window, it shows it is registered in my name and shows the Registration Code. I used to have thw two commands in the View menu in all movies, Loop and Loop Back and Forth. N

  • Foreign language emails

    Hi all, For my work, I receive some emails that are written in Spanish. I used to be able to see them fine. Then recently the special characters are no longer displayed and now emails from certain senders (all from abroad) are displayed in a string o

  • Server does not support remote front panels

    hello I'm about to command the front of my labview program remotely. I followed all the steps that I found on the NI website. when I do the test on my Intenet Explorer browser it gives me the following mesage: "Server does not support remote front pa

  • I have lost space on my drives - both internal and external drives.

    I am new to Mac.  I have a Macbookpro using 10.6.7. I used boot camp to add a partition to my internal drive so I could add some much needed PC apps.  Before adding apps I decided to rough it and deleted the partition,  But when I use get info for th