Sales order: price condition not working when i change the sold to party

Hi guys,
I've a strange problem by making the following steps:
1. Create a sales order:
     By VA01 i create an order by filling the SOLD TO and one material - all OK. The price is calculated correctly.
2. Change SOLD TO:
    I change the sold to by filling another payer that has a different price list (PLTYP) - the price is not re-calculated
If i change with another payer with the same price list everything is ok.
Can you tell me what could be the problem?
Many thanks

Did you actually change the sold-to party though or just the payer?  The sold-to party's price list type controls the price list type value copied into the order header.  Even if the payer has a different value, it's not copied to the order header.  You can see this behavior in FV45KFKD_VBKD_FUELLEN.  If you switch sold-to's then you should get a pop-up that new pricing was carried out; you should also see your new price list type value in the order header and you can use the 'analysis' function at the item level to verify that the correct price was used.

Similar Messages

  • Delta update not working when i change material master data

    Hi SAP Guru's
    can any body help me in solving my issue.
    My issue is i created a data source with a function module to create delta in change date field LAEDA.
    .Full upload is working fine based on the selection screen but delta update is not working properly .
    it is working as full load run for every first run of the day.
    Please can any body help me in this.
    What i did in ECC.
    I copied the FM 'RSAX_BIW_GET_DATA_SIMPLE to Z function module.
    Done a select on three tables and passed the data into e_t_data
    In Rso2 i attached LAEDA filed after clicking generic delta field.
    after completing the steps in ECC
    Any help will be apperitiated .
    Thanks in advance

    Did you actually change the sold-to party though or just the payer?  The sold-to party's price list type controls the price list type value copied into the order header.  Even if the payer has a different value, it's not copied to the order header.  You can see this behavior in FV45KFKD_VBKD_FUELLEN.  If you switch sold-to's then you should get a pop-up that new pricing was carried out; you should also see your new price list type value in the order header and you can use the 'analysis' function at the item level to verify that the correct price was used.

  • The Horizontal & vertical scroll is not visible or not working when i run the form in Forms 6i.

    Hi all,
    The Horizontal & vertical scroll is not visible or not working when i run the form.
    In this form , there are 5 canvas namely
    CANVAS2 - Stacked Canvas
    PASS - Content Canvas
    MAT_RATES - Content Canvas
    DATE - Content Canvas
    PREVIOUS - Content Canvas
    I have set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the WINDOW Property.
    I have  set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the STACKED CANVAS Property .
    But still the Horizontal and Vertical Scroll Bar is not working when i run the Form.
    Help me with this please. How do i make it visible??
    Oracle Forms 6i..
    Thank You.

    Vijetha wrote:
    Hi all,
    The Horizontal & vertical scroll is not visible or not working when i run the form.
    I have set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the WINDOW Property.
    I have  set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the STACKED CANVAS Property .
    But still the Horizontal and Vertical Scroll Bar is not working when i run the Form.
    Help me with this please. How do i make it visible??
    Oracle Forms 6i..
    Thank You.
    hello vijetha,
    window and canvas show scroll bar when it need.
    You should show block property
    and set block scroll bar
    hope this helps..
    Hamid

  • I have an apple iphone4 im facing the problem that my phone senser is not working when i rotate the phone in videos or music play there is working from the senser can u tell me what can i do for this....

    i have an apple iphone4 im facing the problem that my phone senser is not working when i rotate the phone in videos or music play there is working from the senser can u tell me what can i do for this....

    If you double tap the home button, and then swipe your finger to the right, make sure you DO NOT have the Lock Orientation button enabled.
    You know it is disabled if there is no padlock in the middle of the icon.

  • My i4s wifi button is not working. when i opened the setting and then wifi the button is greyed out. then i opened general and then about. in the bar of wifi address it is written N/A. what does its mean. i have done all other things like setting general

    my i4s wifi button is not working. when i opened the setting and then wifi the button is greyed out. then i opened general and then about. in the bar of wifi address it is written N/A. what does its mean. i have done all other things like setting >general<reset<reset network setting. but all in vain. tell me the solution

    restore your phone as new through itunes. if the issue persists after a factory restore via itunes, it means you've got a hardware issue and the phone needs to be repaired

  • Flash catalyst cs5.5 not working when i run the project

    when i ran prodjects in flash catalyst cs5 it came up as a webpage that could scroll, now in cs5.5 when i run the prodject it cannot scroll and it doesn't scroll when you export for web servers, help much apreciated.

    Vijetha wrote:
    Hi all,
    The Horizontal & vertical scroll is not visible or not working when i run the form.
    I have set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the WINDOW Property.
    I have  set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the STACKED CANVAS Property .
    But still the Horizontal and Vertical Scroll Bar is not working when i run the Form.
    Help me with this please. How do i make it visible??
    Oracle Forms 6i..
    Thank You.
    hello vijetha,
    window and canvas show scroll bar when it need.
    You should show block property
    and set block scroll bar
    hope this helps..
    Hamid

  • Change the Sold to Party(SP) in sales order in change mode

    Hi,
    Is it possible to change the Sold to Party(SP) in sales order in change mode?
    If yes then How??
    Regards
    Somnath

    Hi somnath,
    It is very much possible to change the sold-to-party in the change mode of Sales order(VA02).
    Goto VA02-->enter the sale order number.
    Press enter.
    In the overview screen if you change the sold-to-party then every thing will be redetermined(Taxes and pricing procedure etc...).These will be determined from CMr etc.
    You cannot change the sold-to-party at the partners tab that is present in the Header details.
    It will be greyed out.
    If you change the sold-to-party at the overview screen as suggested earlier it will not apply to the item.
    You are also going to see this message while changing.
    And finally save the document.
    Regards,
    Krishna.

  • Sales order status is not Closed when copy to AR Invoice

    Hi,
    Are there any known scenarios where sales order status is not changed to Closed and SO open qty not changed to zero after SO is fully copied to AR Invoice?
    Please advise. Thanks.
    Regards,
    Priscilla

    Hi Jitin,
    1. For this case, the sales order line status is not closed and the open qty is also not zero although the SO qty are fully invoiced
    2. Customer SBO version is 8.8 PL13.
    3. There is no SP_TransactionNotification created in this customer environment.
    FYI, there is no target entry shown in the sales order document as well. Hence, customer is not able to trace which open sales order has been copied to an AR Invoice target document.
    Customer has a few scenarios for the above issue:
    1. Multiple Sales orders copied to 1 AR Invoice.
    2. One sales order to many AR Invoice.
    Since there is no target entry updated in the sales order, is there any SQL query to check which sales order has been copied to a AR Invoice document to rectify the above issue.
    Thanks.
    Regards,
    Priscilla

  • The remote does not work, when i turn the tv on I see the apple tv and the itune icon on the screen

    the remote on apple tv does not work,when i turn on the tv Isee the appletv and the itune icon on the screen.

    Did you do a software update?
    AppleTV is unable to start properly.  You need to connect to a computer running iTunes as detailed here:
    Apple TV (2nd and 3rd generation): Restoring your Apple TV

  • Sales Order - Output determination not working

    Dear Friends,
    Greetings!
    I have a strange problem,
    Order Acknowledgement is to be emailed out automatically on meeting requirement 902 on order save. It goes out to customer (Output: ZBAC: Partner – SP: Customer copy – different layout), and commissioned agents (Output: ZEC1 to ZEC5, upto 5 partners: C1 to C5, Rep copy layout). Customer copy - ZBAC works fine, but ZEC1-ZEC5 rep copy output does not appear at all.
    here is <u>output analysis</u> for ZEC1 and ZEC2:
    ZEC1     529     No condition access - if desired, please set in Customizing
    ZEC1     562     This output is not defined for Customer 0001010059
    ZEC2     529     No condition access - if desired, please set in Customizing
    ZEC2     562     This output is not defined for Customer 0001010059
    All output types use same <u>access Sequence</u> as below:
    1     5     Sales Organization/Order Type     0
    2     13     Sales Org.     0
    3     7     Order Type     0
    Sample <u>Output Procedure</u>, using requirement 902
    2     1     ZBAR     Ord Conf. - Rep copy     902 >>> Rep copy, I originally thought would be possible to create 5 condition records with partners C1 to C5; but
    3     1     ZBAC     Ord Conf. - Customer     902 >>> Customer copy
    930     1     ZEC1     eMail Partner C1     902 >>> Rep copy should go to partner C1
    931     2     ZEC2     eMail Partner C2     902 >>> Rep copy should go to partner C2
    932     3     ZEC3     eMail Partner C3     902 >>> Rep copy should go to partner C3
    933     4     ZEC4     eMail Partner C4     902 >>> Rep copy should go to partner C4
    934     5     ZEC5     eMail Partner C5     902 >>> Rep copy should go to partner C5
    <u>VV12 Output record for ZEC1: by Order Type</u>
    ZOR     Sales Order     C1          5     4     EN
    ZOR     Sales Order     C2          5     4     EN
    <u>VV12 Output record for ZBAC: by Sales Org</u>
    3000     Rochester Operations     SP          5     4     EN
    >>> C1 and C2, SP Partner does not get description, when I click F4 then SAP throws following message: Possible entries only for mail addresses and PD Org objects Message no. VN341
    Appreciate your feedback, let me know if any additional information required.
    thank you,
    Hetal

    check in NACO transaction is you have assigned access sequence to your ZEC* output ytpes and if you have ticked checkbox "Access to output conditions" - otherwise it will not even try to access condition records.
    From help :
    Access to output conditions                                                                               
    Indicates whether the system determines the output by searching for valid
        condition records.                                                                               
    Procedure                                                                               
    If you want the system to search condition records for the appropriate   
        output, mark the field.                                                                               
    Note                                                                               
    If you leave the field blank and if you are processing sales, shipping,  
        or billing documents, the system automatically determines output from    
        information stored in the customer master record.

  • Enable PDF Generation of Sales Order from Opportunity not working

    Hi all,
    we are trying to enable the PDF Generation for Sales Order from Opportunity.
    We´re working on the ERP-HCI Scenario.
    We´ve setup the necessarry configurations (chapter 11.3.11) how described in the document:
    https://websmp201.sap-ag.de/~sapidb/012002523100002166322015E/1502_SAP_C4C_ERP_HCI.pdf
    1. Create Endpoint in ECC for the WS "SalesDocumentPrintPreviewQuery"
    After saving the settings we have an calculated enpoint:
    /sap/bc/srt/rfc/sap/salesdocumentprintpreviewquery/{SAP-CLIENT}/salesdocumentprintpreviewquery/salesdocumentprintpreviewquery
    2. Create a new Communication Arrangement in C4C for the Scenario "Print Preview of Business Documents in SAP Business Suite"
    Question to the following Step:
    Go to Advanced Settings and enter the URL you have captured from SOAMANAGER in the Create Endpoint section.
    Why we use the host and calculated endpoint from the ECC instead of the HCI settings, and maintain in HCI the target host and endpoint?
    The Check Service and Check Connection test was successfull.
    Finally if we try the scenario from C4C (Customers > {Select a Customer} > Opportunity > Sales Document > {Click the link}
    We got a blank new Window, in the C4C UI we get the error "PDF Document could not be retrieved"
    In the ECC > SOA Runtime Error Log i get the following Error!?
    What´s wrong with our config?
    Thanks in advance,
    Fabian

    There is nothing impossible in SAP. After all there is a code behind everything that we see in SAP screens and transactions and that code can be changed according to our requirement. That has always been m firm belief.
    Like I said get hold of your ABAP programmer and write out the spec and he should be able to do it.
    Its news for me that you can generate an automatic PO from a GR so if that is possible then why not this.
    Its not been attempted before.
    Try creating a new Sales doc type and map it to a delivery and see if it works. Much similar to a cash sale and rush order when both docs get generated immediately. Maybe you need to map your copy control criteria too in a way it can be done.Also maybe you need to create a new field called Immediae sales Order like we have an immediate delivery check box in a sales order so that an automatic sales order can be generated when you save a delivery.
    Like I said it needs some coding.
    regards
    Jude

  • Sale Order Item Quantity Not Populating When Create A Sale Order Using BAPI

    I am having a problem when creating a sale order using BAPI
    BAPI_SALESORDER_CREATEFROMDAT2
    Problem is that sale order item quantity field is not populating
    code is as follows
    ORDER_ITEMS_IN-ITM_NUMBER = '0010'.
    ORDER_ITEMS_IN-MATERIAL = '000000000010000262'.
    ORDER_ITEMS_IN-TARGET_QU = 'LB'.
    ORDER_ITEMS_IN-TARGET_QTY = 1.

    Hi,
    Try populating ORDER_SCHEDULES_IN table in the bapi field REQ_QTY.
    Regds,
    Rudra

  • Sale Order Api Is not working

    Hi experts ,
    I am trying to load the data via api , Its not getting load , can u help me pls ,
    DECLARE
    l_line_id NUMBER;
    l_item_id NUMBER;
    l_order_qty NUMBER;
    l_msg_index number;
    L_data VARCHAR2 (2000);
    l_debug_file VARCHAR2 (200);
    resultout VARCHAR2 (100);
    l_order_uom VARCHAR2 (10);
    l_reship_order NUMBER;
    itemkey number := 215600;
    l_negative_prorate NUMBER;
    l_prorate_qty NUMBER;
    l_sch_ship_date DATE;
    l_debug_level NUMBER := 3;
    l_ship_to_org_id NUMBER;
    l_attribute1 VARCHAR2 (150);
    l_attribute2 VARCHAR2 (150);
    l_line_num NUMBER;
    l_agreement_id NUMBER;
    l_organization_id NUMBER;
    l_segment VARCHAR2 (120);
    l_child_onhand NUMBER := 0;
    l_qty_temp NUMBER := 0;
    l_excl_temp NUMBER := 0;
    l_prorate_percent NUMBER;
    l_onhand NUMBER;
    l_error VARCHAR2 (240);
    l_error_message VARCHAR2 (240);
    l_line_tbl oe_order_pub.line_tbl_type;
    l_line_tbl_count NUMBER := 0;
    l_temp_count NUMBER := 0;
    p_line_tbl_rec oe_order_pub.line_tbl_type;
    p_line_id NUMBER;
    p_error_flag VARCHAR2 (1000);
    p_error_message VARCHAR2 (1000);
    l_api_version_number NUMBER := 1;
    l_return_status VARCHAR2 (2000);
    l_return_status1 VARCHAR2 (2000);
    l_msg_count NUMBER;
    l_msg_data VARCHAR2 (2000);
    -- l_msg_index VARCHAR2 (1000);
    l_line_out_tbl oe_order_pub.line_tbl_type;
    p_parent_item VARCHAR2 (100) := 'PROPANE';
    p_organization_id NUMBER := 321;
    l_header_id NUMBER := 152066;
    --- Child Cursor Without Exclusion of Soldado
    CURSOR c_child_items (
    p_parent_item VARCHAR2,
    p_organization_id NUMBER
    IS
    CURSOR c_positive_items (
    p_parent_item VARCHAR2,
    p_organization_id NUMBER
    IS
    SELECT inventory_item_id,
    segment1,
    organization_id,
    SUM (onhand - order_qty) onhand,
    COUNT ( * ) OVER () total_rows
    FROM ( SELECT msi.inventory_item_id,
    msi.segment1,
    msi.organization_id,
    NVL (
    SUM(inv_convert.inv_um_convert_new (
    moq.inventory_item_id,
    5,
    moq.transaction_quantity,
    moq.transaction_uom_code,
    l_order_uom,
    NULL,
    NULL,
    'U'
    0
    onhand,
    (SELECT NVL (SUM (ordered_quantity), 0)
    FROM oe_order_lines_all
    WHERE header_id = l_header_id
    AND flow_status_code NOT IN
    ('CLOSED', 'SHIPPED')
    AND inventory_item_id =
    msi.inventory_item_id)
    order_qty
    FROM mtl_system_items_b msi,
    oe_lookups ol,
    mtl_onhand_quantities_detail moq
    WHERE msi.segment1 = ol.meaning
    AND TRIM (SYSDATE) BETWEEN ol.start_date_active
    AND NVL (ol.end_date_active,
    TRIM (SYSDATE))
    AND ol.enabled_flag = 'Y'
    AND ol.lookup_type = p_parent_item
    AND msi.organization_id = p_organization_id
    AND msi.inventory_item_id = moq.inventory_item_id(+)
    AND msi.organization_id = moq.organization_id(+)
    AND (msi.segment1 LIKE '%SOLDADO%'
    OR msi.segment1 LIKE '%T4%')
    GROUP BY msi.inventory_item_id,
    msi.segment1,
    msi.organization_id)
    GROUP BY inventory_item_id, segment1, organization_id
    HAVING SUM (onhand - order_qty) > 0
    ORDER BY segment1;
    --- Child Cursor With only Positive Buckets
    CURSOR c_positive_onhand (
    p_parent_item IN VARCHAR2,
    p_organization_id IN NUMBER
    IS
    BEGIN
    IF (l_debug_level > 0)
    THEN
    l_debug_file := oe_debug_pub.set_debug_mode ('FILE');
    oe_debug_pub.initialize;
    oe_debug_pub.setdebuglevel (l_debug_level);
    oe_msg_pub.initialize;
    END IF;
    --- Initialization Block
    DBMS_OUTPUT.put_line ('Initialization Block');
    fnd_global.apps_initialize (fnd_global.user_id,
    fnd_global.resp_id,
    fnd_global.resp_appl_id);
    -- BEGIN
    -- MO_GLOBAL.SET_POLICY_CONTEXT ('S', 321);
    -- END;
    -- fnd_global.apps_initialize (-1, 21623, 660);
    --- Get Line ID from workflow
    l_line_id := TO_NUMBER (itemkey);
    --- To get the line details
    BEGIN
    SELECT header_id,
    ordered_item,
    inventory_item_id,
    line_number,
    order_quantity_uom,
    ordered_quantity,
    ship_from_org_id,
    ship_to_org_id,
    schedule_ship_date,
    attribute1,
    attribute2,
    agreement_id
    INTO l_header_id,
    l_segment,
    l_item_id,
    l_line_num,
    l_order_uom,
    l_order_qty,
    l_organization_id,
    l_ship_to_org_id,
    l_sch_ship_date,
    l_attribute1,
    l_attribute2,
    l_agreement_id
    FROM oe_order_lines_all
    WHERE line_id = l_line_id;
    DBMS_OUTPUT.put_line ('To get the line details');
    EXCEPTION
    WHEN OTHERS
    THEN
    l_header_id := NULL;
    l_segment := NULL;
    l_item_id := NULL;
    l_order_qty := NULL;
    l_organization_id := NULL;
    DBMS_OUTPUT.put_line ('Not Avilable for To get the line details');
    END;
    -- To get the Original sales order Number
    BEGIN
    SELECT attribute10
    INTO l_reship_order
    FROM oe_order_headers_all
    WHERE header_id = l_header_id;
    EXCEPTION
    WHEN OTHERS
    THEN
    l_reship_order := NULL;
    END;
    --- Check for the Top Level Item Name
    IF l_segment IN ('PROPANE', 'BUTANE', 'ISO BUTANE', 'GASOLINE')
    THEN
    --- To get the total positive onhand quantity for all the child items
    BEGIN
    SELECT NVL (SUM (trx_qty), 0)
    INTO l_onhand
    FROM ( SELECT moq.inventory_item_id,
    NVL (
    SUM(NVL (
    inv_convert.inv_um_convert_new (
    msi.inventory_item_id,
    5,
    moq.transaction_quantity,
    moq.transaction_uom_code,
    l_order_uom,
    NULL,
    NULL,
    'U'
    0
    - (SELECT NVL (SUM (ordered_quantity), 0)
    FROM oe_order_lines_all
    WHERE header_id = l_header_id
    AND flow_status_code NOT IN
    ('CLOSED', 'SHIPPED')
    AND inventory_item_id =
    msi.inventory_item_id),
    0
    trx_qty
    FROM mtl_onhand_quantities_detail moq,
    mtl_system_items msi,
    oe_lookups ol
    WHERE msi.segment1 = ol.meaning
    AND TRIM (SYSDATE) BETWEEN ol.start_date_active
    AND NVL (
    ol.end_date_active,
    TRIM (SYSDATE)
    AND ol.enabled_flag = 'Y'
    AND ol.lookup_type = l_segment
    AND msi.organization_id = l_organization_id
    AND moq.inventory_item_id = msi.inventory_item_id
    AND moq.organization_id = msi.organization_id
    AND (msi.segment1 NOT LIKE '%SOLDADO%'
    AND msi.segment1 NOT LIKE '%T4%')
    GROUP BY msi.inventory_item_id, moq.inventory_item_id)
    WHERE trx_qty > 0;
    DBMS_OUTPUT.put_line ('l_onhand' || l_onhand);
    EXCEPTION
    WHEN OTHERS
    THEN
    l_onhand := 0;
    DBMS_OUTPUT.put_line ('Not Avilable for on hand');
    END;
    -- To check whether this order is a reshipment order
    DBMS_OUTPUT.put_line (
    'To check whether this order is a reshipment order'
    IF l_reship_order IS NOT NULL
    THEN
    DBMS_OUTPUT.put_line ('1st Else Case reship');
    ELSE
    DBMS_OUTPUT.put_line ('1st Else Case no reship');
    FOR l_positive_items
    IN c_positive_items (l_segment, l_organization_id)
    LOOP
    DBMS_OUTPUT.put_line( 'l_positive_items.onhand'
    || l_positive_items.onhand
    || 'l_excl_temp'
    || l_excl_temp
    || ' l_order_qty'
    || l_order_qty);
    IF l_positive_items.onhand > 0 AND l_excl_temp < l_order_qty
    THEN
    l_line_tbl_count := l_line_tbl_count + 1;
    IF (l_order_qty - l_excl_temp) < l_positive_items.onhand
    THEN
    l_prorate_qty := l_order_qty - l_excl_temp;
    ELSE
    l_prorate_qty := l_positive_items.onhand;
    END IF;
    -- Initializing the Sales order Lines Record type
    DBMS_OUTPUT.put_line (
    'Initializing the Sales order Lines Record type'
    l_line_tbl (l_line_tbl_count) := oe_order_pub.g_miss_line_rec;
    l_line_tbl (l_line_tbl_count).operation :=
    oe_globals.g_opr_create;
    l_line_tbl (l_line_tbl_count).header_id := l_header_id;
    l_line_tbl (l_line_tbl_count).inventory_item_id :=
    l_positive_items.inventory_item_id;
    l_line_tbl (l_line_tbl_count).ship_to_org_id :=
    l_ship_to_org_id;
    l_line_tbl (l_line_tbl_count).ordered_quantity := l_prorate_qty;
    l_line_tbl (l_line_tbl_count).schedule_ship_date :=
    l_sch_ship_date;
    l_line_tbl (l_line_tbl_count).attribute1 := l_attribute1;
    l_line_tbl (l_line_tbl_count).attribute2 := l_attribute2;
    l_line_tbl (l_line_tbl_count).attribute9 := l_line_id;
    l_line_tbl (l_line_tbl_count).attribute10 :=
    ROUND (l_prorate_qty / l_order_qty * 100, 5);
    l_line_tbl (l_line_tbl_count).agreement_id := l_agreement_id;
    l_line_tbl (l_line_tbl_count).calculate_price_flag := 'Y';
    l_excl_temp := l_excl_temp + l_prorate_qty;
    END IF;
    END LOOP;
    -- To check if the total onhand is greater than zero
    DBMS_OUTPUT.put_line (
    'To check if the total onhand is greater than zero'
    IF l_onhand > 0
    THEN
    IF l_order_qty > l_excl_temp
    THEN
    -- To check whether the onhand is lesser than order qty
    DBMS_OUTPUT.put_line (
    'To check whether the onhand is lesser than order qty'
    IF (l_onhand < (l_order_qty - l_excl_temp))
    THEN
    -- Loop the cursor with exclusion of soldado logic
    DBMS_OUTPUT.put_line (
    'Loop the cursor with exclusion of soldado logic'
    FOR l_child_item
    IN c_child_items (l_segment, l_organization_id)
    LOOP
    l_prorate_percent := NULL;
    l_negative_prorate := 0;
    l_temp_count := 0;
    l_prorate_qty := 0;
    -- Initializing the Sales order Lines Record type
    DBMS_OUTPUT.put_line (
    'Initializing the Sales order Lines Record type2'
    l_line_tbl (l_line_tbl_count) :=
    oe_order_pub.g_miss_line_rec;
    l_line_tbl (l_line_tbl_count).operation :=
    oe_globals.g_opr_create;
    l_line_tbl (l_line_tbl_count).header_id := l_header_id;
    l_line_tbl (l_line_tbl_count).inventory_item_id :=
    l_child_item.inventory_item_id;
    l_line_tbl (l_line_tbl_count).ship_to_org_id :=
    l_ship_to_org_id;
    l_line_tbl (l_line_tbl_count).ordered_quantity :=
    l_prorate_qty;
    l_line_tbl (l_line_tbl_count).schedule_ship_date :=
    l_sch_ship_date;
    l_line_tbl (l_line_tbl_count).attribute1 := l_attribute1;
    l_line_tbl (l_line_tbl_count).attribute2 := l_attribute2;
    l_line_tbl (l_line_tbl_count).attribute9 := l_line_id;
    l_line_tbl (l_line_tbl_count).attribute10 :=
    ROUND (l_prorate_qty / l_order_qty * 100, 5);
    l_line_tbl (l_line_tbl_count).agreement_id :=
    l_agreement_id;
    l_line_tbl (l_line_tbl_count).calculate_price_flag := 'Y';
    END LOOP;
    ELSE
    -- Loop the cursor of all the positive buckets
    FOR l_child_items
    IN c_positive_onhand (l_segment, l_organization_id)
    LOOP
    l_prorate_percent := NULL;
    l_child_onhand := 0;
    l_prorate_qty := 0;
    -- To get the split percentage of the child items
    l_prorate_percent :=
    ROUND ( (l_child_items.trx_qty / l_onhand) * 100, 5);
    -- To check whether the prorate percentage exits
    IF l_prorate_percent IS NOT NULL
    AND l_prorate_percent > 0
    THEN
    -- To calculate the prorate quantity
    l_line_tbl_count := l_line_tbl_count + 1;
    l_prorate_qty :=
    ROUND (
    (l_order_qty - l_excl_temp)
    * (l_prorate_percent / 100),
    5
    l_qty_temp := l_qty_temp + l_prorate_qty;
    -- To calculate the prorate quantity for the last line
    IF c_positive_onhand%ROWCOUNT =
    l_child_items.total_rows
    THEN
    l_prorate_qty :=
    l_prorate_qty
    + (l_order_qty - (l_qty_temp + l_excl_temp));
    END IF;
    -- Initializing the line record type to process
    DBMS_OUTPUT.put_line (
    'Initializing the Sales order Lines Record type3'
    l_line_tbl (l_line_tbl_count) :=
    oe_order_pub.g_miss_line_rec;
    l_line_tbl (l_line_tbl_count).operation :=
    oe_globals.g_opr_create;
    l_line_tbl (l_line_tbl_count).header_id := l_header_id;
    l_line_tbl (l_line_tbl_count).inventory_item_id :=
    l_child_items.inventory_item_id;
    l_line_tbl (l_line_tbl_count).ship_to_org_id :=
    l_ship_to_org_id;
    l_line_tbl (l_line_tbl_count).ordered_quantity :=
    l_prorate_qty;
    l_line_tbl (l_line_tbl_count).schedule_ship_date :=
    l_sch_ship_date;
    l_line_tbl (l_line_tbl_count).attribute1 :=
    l_attribute1;
    l_line_tbl (l_line_tbl_count).attribute2 :=
    l_attribute2;
    l_line_tbl (l_line_tbl_count).attribute9 := l_line_id;
    l_line_tbl (l_line_tbl_count).attribute10 :=
    ROUND (l_prorate_qty / l_order_qty * 100, 5);
    l_line_tbl (l_line_tbl_count).agreement_id :=
    l_agreement_id;
    l_line_tbl (l_line_tbl_count).calculate_price_flag :=
    'Y';
    DBMS_OUTPUT.put_line( '3rd insert'
    || 'l_prorate_qty'
    || l_prorate_qty
    || 'l_ship_to_org_id'
    || l_ship_to_org_id
    || 'l_sch_ship_date'
    || l_sch_ship_date
    || 'l_child_items.inventory_item_id'
    || l_child_items.inventory_item_id
    || 'l_agreement_id'
    || l_agreement_id);
    END IF;
    COMMIT;
    END LOOP;
    END IF;
    END IF;
    ELSIF l_order_qty > l_excl_temp
    THEN
    -- Loop the cursor with exclusion of soldado logic
    FOR l_child_item IN c_child_items (l_segment, l_organization_id)
    LOOP
    l_prorate_percent := 0;
    l_prorate_qty := 0;
    l_prorate_percent := ROUND (100 / l_child_item.total_rows, 5);
    l_prorate_qty :=
    ROUND (
    ( (l_order_qty - l_excl_temp) / l_child_item.total_rows),
    5
    l_line_tbl_count := l_line_tbl_count + 1;
    l_qty_temp := l_qty_temp + l_prorate_qty;
    -- To calculate the prorate quantity for the last line
    IF c_child_items%ROWCOUNT = l_child_item.total_rows
    THEN
    l_prorate_qty :=
    l_prorate_qty
    + (l_order_qty - (l_qty_temp + l_excl_temp));
    END IF;
    -- Initializing the line record type to process
    DBMS_OUTPUT.put_line (
    'Initializing the Sales order Lines Record type4'
    l_line_tbl (l_line_tbl_count) := oe_order_pub.g_miss_line_rec;
    l_line_tbl (l_line_tbl_count).operation :=
    oe_globals.g_opr_create;
    l_line_tbl (l_line_tbl_count).header_id := l_header_id;
    l_line_tbl (l_line_tbl_count).inventory_item_id :=
    l_child_item.inventory_item_id;
    l_line_tbl (l_line_tbl_count).ship_to_org_id :=
    l_ship_to_org_id;
    l_line_tbl (l_line_tbl_count).ordered_quantity := l_prorate_qty;
    l_line_tbl (l_line_tbl_count).schedule_ship_date :=
    l_sch_ship_date;
    l_line_tbl (l_line_tbl_count).attribute1 := l_attribute1;
    l_line_tbl (l_line_tbl_count).attribute2 := l_attribute2;
    l_line_tbl (l_line_tbl_count).attribute9 := l_line_id;
    l_line_tbl (l_line_tbl_count).attribute10 :=
    ROUND (l_prorate_qty / l_order_qty * 100, 5);
    l_line_tbl (l_line_tbl_count).agreement_id := l_agreement_id;
    l_line_tbl (l_line_tbl_count).calculate_price_flag := 'Y';
    END LOOP;
    END IF;
    END IF; -- to check whether any records are initialized
    IF l_line_tbl_count > 0
    THEN
    -- Cancel the Parent Item
    DBMS_OUTPUT.put_line ('Cancel the Parent Item');
    l_line_tbl (l_line_tbl_count + 1) := oe_order_pub.g_miss_line_rec;
    l_line_tbl (l_line_tbl_count + 1).operation :=
    oe_globals.g_opr_update;
    l_line_tbl (l_line_tbl_count + 1).header_id := l_header_id;
    l_line_tbl (l_line_tbl_count + 1).line_id := l_line_id;
    l_line_tbl (l_line_tbl_count + 1).ordered_quantity := 0;
    l_line_tbl (l_line_tbl_count + 1).attribute10 := l_order_qty;
    l_line_tbl (l_line_tbl_count + 1).cancelled_flag := 'Y';
    l_line_tbl (l_line_tbl_count + 1).change_reason := 'Not Provided';
    DBMS_OUTPUT.put_line( 'Cancellation Process fileds'
    || 'HDR_ID'
    || l_header_id
    || 'LINE'
    || l_line_id
    || 'l_order_qty'
    || l_order_qty);
    -- Call the procedure to process the sales order lines
    -- process_order_line_api (p_line_tbl_rec => l_line_tbl,
    -- p_line_id => l_line_id,
    -- p_error_flag => l_error,
    -- p_error_message => l_error_message);
    IF l_error = 'Y'
    THEN
    resultout := 'COMPLETE:Y';
    ELSE
    resultout := 'COMPLETE:N';
    END IF;
    ELSE
    resultout := 'COMPLETE:N';
    END IF;
    END IF;
    BEGIN
    fnd_global.apps_initialize (fnd_global.user_id,
    fnd_global.resp_id,
    fnd_global.resp_appl_id);
    -- BEGIN
    -- MO_GLOBAL.SET_POLICY_CONTEXT ('S', 321);
    -- END;
    -- fnd_global.apps_initialize (-1, 21623, 660);
    -- Call Process Line API to process sales order lines
    DBMS_OUTPUT.put_line ('fianl line to be processd');
    BEGIN
    oe_order_pub.process_line (p_line_tbl => p_line_tbl_rec,
    x_line_out_tbl => l_line_out_tbl,
    x_return_status => l_return_status,
    x_msg_count => l_msg_count,
    x_msg_data => l_msg_data);
    COMMIT;
    DBMS_OUTPUT.put_line ('API Processed' || l_msg_data);
    fnd_file.put_line (fnd_file.LOG, 'Processed - ' || l_msg_data);
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ('Failed With1' || SQLERRM);
    END;
    -- display error msgs
    IF (l_debug_level > 0)
    THEN
    FOR i IN 1 .. l_msg_count
    LOOP
    oe_msg_pub.get (p_msg_index => i,
    p_encoded => fnd_api.g_false,
    p_data => l_data,
    p_msg_index_out => l_msg_index);
    fnd_file.put_line (fnd_file.LOG, 'message is:' || l_data);
    fnd_file.put_line (fnd_file.LOG,
    'message index is:' || l_msg_index);
    DBMS_OUTPUT.put_line (
    'l_data' || l_data || 'l_debug_level' || l_debug_level
    END LOOP;
    END IF;
    IF p_error_flag = 'N'
    THEN
    FOR i IN 1 .. l_msg_count
    LOOP
    oe_msg_pub.get (p_msg_index => i,
    p_encoded => fnd_api.g_false,
    p_data => p_error_message,
    p_msg_index_out => l_msg_index);
    END LOOP;
    ELSE
    DBMS_OUTPUT.put_line ('Out Of loop Exit');
    END IF;
    fnd_file.put_line (fnd_file.LOG, 'p_error_message - ' || SQLERRM);
    DBMS_OUTPUT.put_line ('p_error_message' || p_error_message || SQLERRM);
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ('Failed With' || SQLERRM);
    fnd_file.put_line (fnd_file.LOG,
    'Unexpected Errors Found4 - ' || SQLERRM);
    END;
    END;
    Thanks
    Shagul

    Hi experts ,
    I am trying to load the data via api , Its not getting load , can u help me pls ,
    DECLARE
    l_line_id NUMBER;
    l_item_id NUMBER;
    l_order_qty NUMBER;
    l_msg_index number;
    L_data VARCHAR2 (2000);
    l_debug_file VARCHAR2 (200);
    resultout VARCHAR2 (100);
    l_order_uom VARCHAR2 (10);
    l_reship_order NUMBER;
    itemkey number := 215600;
    l_negative_prorate NUMBER;
    l_prorate_qty NUMBER;
    l_sch_ship_date DATE;
    l_debug_level NUMBER := 3;
    l_ship_to_org_id NUMBER;
    l_attribute1 VARCHAR2 (150);
    l_attribute2 VARCHAR2 (150);
    l_line_num NUMBER;
    l_agreement_id NUMBER;
    l_organization_id NUMBER;
    l_segment VARCHAR2 (120);
    l_child_onhand NUMBER := 0;
    l_qty_temp NUMBER := 0;
    l_excl_temp NUMBER := 0;
    l_prorate_percent NUMBER;
    l_onhand NUMBER;
    l_error VARCHAR2 (240);
    l_error_message VARCHAR2 (240);
    l_line_tbl oe_order_pub.line_tbl_type;
    l_line_tbl_count NUMBER := 0;
    l_temp_count NUMBER := 0;
    p_line_tbl_rec oe_order_pub.line_tbl_type;
    p_line_id NUMBER;
    p_error_flag VARCHAR2 (1000);
    p_error_message VARCHAR2 (1000);
    l_api_version_number NUMBER := 1;
    l_return_status VARCHAR2 (2000);
    l_return_status1 VARCHAR2 (2000);
    l_msg_count NUMBER;
    l_msg_data VARCHAR2 (2000);
    -- l_msg_index VARCHAR2 (1000);
    l_line_out_tbl oe_order_pub.line_tbl_type;
    p_parent_item VARCHAR2 (100) := 'PROPANE';
    p_organization_id NUMBER := 321;
    l_header_id NUMBER := 152066;
    --- Child Cursor Without Exclusion of Soldado
    CURSOR c_child_items (
    p_parent_item VARCHAR2,
    p_organization_id NUMBER
    IS
    CURSOR c_positive_items (
    p_parent_item VARCHAR2,
    p_organization_id NUMBER
    IS
    SELECT inventory_item_id,
    segment1,
    organization_id,
    SUM (onhand - order_qty) onhand,
    COUNT ( * ) OVER () total_rows
    FROM ( SELECT msi.inventory_item_id,
    msi.segment1,
    msi.organization_id,
    NVL (
    SUM(inv_convert.inv_um_convert_new (
    moq.inventory_item_id,
    5,
    moq.transaction_quantity,
    moq.transaction_uom_code,
    l_order_uom,
    NULL,
    NULL,
    'U'
    0
    onhand,
    (SELECT NVL (SUM (ordered_quantity), 0)
    FROM oe_order_lines_all
    WHERE header_id = l_header_id
    AND flow_status_code NOT IN
    ('CLOSED', 'SHIPPED')
    AND inventory_item_id =
    msi.inventory_item_id)
    order_qty
    FROM mtl_system_items_b msi,
    oe_lookups ol,
    mtl_onhand_quantities_detail moq
    WHERE msi.segment1 = ol.meaning
    AND TRIM (SYSDATE) BETWEEN ol.start_date_active
    AND NVL (ol.end_date_active,
    TRIM (SYSDATE))
    AND ol.enabled_flag = 'Y'
    AND ol.lookup_type = p_parent_item
    AND msi.organization_id = p_organization_id
    AND msi.inventory_item_id = moq.inventory_item_id(+)
    AND msi.organization_id = moq.organization_id(+)
    AND (msi.segment1 LIKE '%SOLDADO%'
    OR msi.segment1 LIKE '%T4%')
    GROUP BY msi.inventory_item_id,
    msi.segment1,
    msi.organization_id)
    GROUP BY inventory_item_id, segment1, organization_id
    HAVING SUM (onhand - order_qty) > 0
    ORDER BY segment1;
    --- Child Cursor With only Positive Buckets
    CURSOR c_positive_onhand (
    p_parent_item IN VARCHAR2,
    p_organization_id IN NUMBER
    IS
    BEGIN
    IF (l_debug_level > 0)
    THEN
    l_debug_file := oe_debug_pub.set_debug_mode ('FILE');
    oe_debug_pub.initialize;
    oe_debug_pub.setdebuglevel (l_debug_level);
    oe_msg_pub.initialize;
    END IF;
    --- Initialization Block
    DBMS_OUTPUT.put_line ('Initialization Block');
    fnd_global.apps_initialize (fnd_global.user_id,
    fnd_global.resp_id,
    fnd_global.resp_appl_id);
    -- BEGIN
    -- MO_GLOBAL.SET_POLICY_CONTEXT ('S', 321);
    -- END;
    -- fnd_global.apps_initialize (-1, 21623, 660);
    --- Get Line ID from workflow
    l_line_id := TO_NUMBER (itemkey);
    --- To get the line details
    BEGIN
    SELECT header_id,
    ordered_item,
    inventory_item_id,
    line_number,
    order_quantity_uom,
    ordered_quantity,
    ship_from_org_id,
    ship_to_org_id,
    schedule_ship_date,
    attribute1,
    attribute2,
    agreement_id
    INTO l_header_id,
    l_segment,
    l_item_id,
    l_line_num,
    l_order_uom,
    l_order_qty,
    l_organization_id,
    l_ship_to_org_id,
    l_sch_ship_date,
    l_attribute1,
    l_attribute2,
    l_agreement_id
    FROM oe_order_lines_all
    WHERE line_id = l_line_id;
    DBMS_OUTPUT.put_line ('To get the line details');
    EXCEPTION
    WHEN OTHERS
    THEN
    l_header_id := NULL;
    l_segment := NULL;
    l_item_id := NULL;
    l_order_qty := NULL;
    l_organization_id := NULL;
    DBMS_OUTPUT.put_line ('Not Avilable for To get the line details');
    END;
    -- To get the Original sales order Number
    BEGIN
    SELECT attribute10
    INTO l_reship_order
    FROM oe_order_headers_all
    WHERE header_id = l_header_id;
    EXCEPTION
    WHEN OTHERS
    THEN
    l_reship_order := NULL;
    END;
    --- Check for the Top Level Item Name
    IF l_segment IN ('PROPANE', 'BUTANE', 'ISO BUTANE', 'GASOLINE')
    THEN
    --- To get the total positive onhand quantity for all the child items
    BEGIN
    SELECT NVL (SUM (trx_qty), 0)
    INTO l_onhand
    FROM ( SELECT moq.inventory_item_id,
    NVL (
    SUM(NVL (
    inv_convert.inv_um_convert_new (
    msi.inventory_item_id,
    5,
    moq.transaction_quantity,
    moq.transaction_uom_code,
    l_order_uom,
    NULL,
    NULL,
    'U'
    0
    - (SELECT NVL (SUM (ordered_quantity), 0)
    FROM oe_order_lines_all
    WHERE header_id = l_header_id
    AND flow_status_code NOT IN
    ('CLOSED', 'SHIPPED')
    AND inventory_item_id =
    msi.inventory_item_id),
    0
    trx_qty
    FROM mtl_onhand_quantities_detail moq,
    mtl_system_items msi,
    oe_lookups ol
    WHERE msi.segment1 = ol.meaning
    AND TRIM (SYSDATE) BETWEEN ol.start_date_active
    AND NVL (
    ol.end_date_active,
    TRIM (SYSDATE)
    AND ol.enabled_flag = 'Y'
    AND ol.lookup_type = l_segment
    AND msi.organization_id = l_organization_id
    AND moq.inventory_item_id = msi.inventory_item_id
    AND moq.organization_id = msi.organization_id
    AND (msi.segment1 NOT LIKE '%SOLDADO%'
    AND msi.segment1 NOT LIKE '%T4%')
    GROUP BY msi.inventory_item_id, moq.inventory_item_id)
    WHERE trx_qty > 0;
    DBMS_OUTPUT.put_line ('l_onhand' || l_onhand);
    EXCEPTION
    WHEN OTHERS
    THEN
    l_onhand := 0;
    DBMS_OUTPUT.put_line ('Not Avilable for on hand');
    END;
    -- To check whether this order is a reshipment order
    DBMS_OUTPUT.put_line (
    'To check whether this order is a reshipment order'
    IF l_reship_order IS NOT NULL
    THEN
    DBMS_OUTPUT.put_line ('1st Else Case reship');
    ELSE
    DBMS_OUTPUT.put_line ('1st Else Case no reship');
    FOR l_positive_items
    IN c_positive_items (l_segment, l_organization_id)
    LOOP
    DBMS_OUTPUT.put_line( 'l_positive_items.onhand'
    || l_positive_items.onhand
    || 'l_excl_temp'
    || l_excl_temp
    || ' l_order_qty'
    || l_order_qty);
    IF l_positive_items.onhand > 0 AND l_excl_temp < l_order_qty
    THEN
    l_line_tbl_count := l_line_tbl_count + 1;
    IF (l_order_qty - l_excl_temp) < l_positive_items.onhand
    THEN
    l_prorate_qty := l_order_qty - l_excl_temp;
    ELSE
    l_prorate_qty := l_positive_items.onhand;
    END IF;
    -- Initializing the Sales order Lines Record type
    DBMS_OUTPUT.put_line (
    'Initializing the Sales order Lines Record type'
    l_line_tbl (l_line_tbl_count) := oe_order_pub.g_miss_line_rec;
    l_line_tbl (l_line_tbl_count).operation :=
    oe_globals.g_opr_create;
    l_line_tbl (l_line_tbl_count).header_id := l_header_id;
    l_line_tbl (l_line_tbl_count).inventory_item_id :=
    l_positive_items.inventory_item_id;
    l_line_tbl (l_line_tbl_count).ship_to_org_id :=
    l_ship_to_org_id;
    l_line_tbl (l_line_tbl_count).ordered_quantity := l_prorate_qty;
    l_line_tbl (l_line_tbl_count).schedule_ship_date :=
    l_sch_ship_date;
    l_line_tbl (l_line_tbl_count).attribute1 := l_attribute1;
    l_line_tbl (l_line_tbl_count).attribute2 := l_attribute2;
    l_line_tbl (l_line_tbl_count).attribute9 := l_line_id;
    l_line_tbl (l_line_tbl_count).attribute10 :=
    ROUND (l_prorate_qty / l_order_qty * 100, 5);
    l_line_tbl (l_line_tbl_count).agreement_id := l_agreement_id;
    l_line_tbl (l_line_tbl_count).calculate_price_flag := 'Y';
    l_excl_temp := l_excl_temp + l_prorate_qty;
    END IF;
    END LOOP;
    -- To check if the total onhand is greater than zero
    DBMS_OUTPUT.put_line (
    'To check if the total onhand is greater than zero'
    IF l_onhand > 0
    THEN
    IF l_order_qty > l_excl_temp
    THEN
    -- To check whether the onhand is lesser than order qty
    DBMS_OUTPUT.put_line (
    'To check whether the onhand is lesser than order qty'
    IF (l_onhand < (l_order_qty - l_excl_temp))
    THEN
    -- Loop the cursor with exclusion of soldado logic
    DBMS_OUTPUT.put_line (
    'Loop the cursor with exclusion of soldado logic'
    FOR l_child_item
    IN c_child_items (l_segment, l_organization_id)
    LOOP
    l_prorate_percent := NULL;
    l_negative_prorate := 0;
    l_temp_count := 0;
    l_prorate_qty := 0;
    -- Initializing the Sales order Lines Record type
    DBMS_OUTPUT.put_line (
    'Initializing the Sales order Lines Record type2'
    l_line_tbl (l_line_tbl_count) :=
    oe_order_pub.g_miss_line_rec;
    l_line_tbl (l_line_tbl_count).operation :=
    oe_globals.g_opr_create;
    l_line_tbl (l_line_tbl_count).header_id := l_header_id;
    l_line_tbl (l_line_tbl_count).inventory_item_id :=
    l_child_item.inventory_item_id;
    l_line_tbl (l_line_tbl_count).ship_to_org_id :=
    l_ship_to_org_id;
    l_line_tbl (l_line_tbl_count).ordered_quantity :=
    l_prorate_qty;
    l_line_tbl (l_line_tbl_count).schedule_ship_date :=
    l_sch_ship_date;
    l_line_tbl (l_line_tbl_count).attribute1 := l_attribute1;
    l_line_tbl (l_line_tbl_count).attribute2 := l_attribute2;
    l_line_tbl (l_line_tbl_count).attribute9 := l_line_id;
    l_line_tbl (l_line_tbl_count).attribute10 :=
    ROUND (l_prorate_qty / l_order_qty * 100, 5);
    l_line_tbl (l_line_tbl_count).agreement_id :=
    l_agreement_id;
    l_line_tbl (l_line_tbl_count).calculate_price_flag := 'Y';
    END LOOP;
    ELSE
    -- Loop the cursor of all the positive buckets
    FOR l_child_items
    IN c_positive_onhand (l_segment, l_organization_id)
    LOOP
    l_prorate_percent := NULL;
    l_child_onhand := 0;
    l_prorate_qty := 0;
    -- To get the split percentage of the child items
    l_prorate_percent :=
    ROUND ( (l_child_items.trx_qty / l_onhand) * 100, 5);
    -- To check whether the prorate percentage exits
    IF l_prorate_percent IS NOT NULL
    AND l_prorate_percent > 0
    THEN
    -- To calculate the prorate quantity
    l_line_tbl_count := l_line_tbl_count + 1;
    l_prorate_qty :=
    ROUND (
    (l_order_qty - l_excl_temp)
    * (l_prorate_percent / 100),
    5
    l_qty_temp := l_qty_temp + l_prorate_qty;
    -- To calculate the prorate quantity for the last line
    IF c_positive_onhand%ROWCOUNT =
    l_child_items.total_rows
    THEN
    l_prorate_qty :=
    l_prorate_qty
    + (l_order_qty - (l_qty_temp + l_excl_temp));
    END IF;
    -- Initializing the line record type to process
    DBMS_OUTPUT.put_line (
    'Initializing the Sales order Lines Record type3'
    l_line_tbl (l_line_tbl_count) :=
    oe_order_pub.g_miss_line_rec;
    l_line_tbl (l_line_tbl_count).operation :=
    oe_globals.g_opr_create;
    l_line_tbl (l_line_tbl_count).header_id := l_header_id;
    l_line_tbl (l_line_tbl_count).inventory_item_id :=
    l_child_items.inventory_item_id;
    l_line_tbl (l_line_tbl_count).ship_to_org_id :=
    l_ship_to_org_id;
    l_line_tbl (l_line_tbl_count).ordered_quantity :=
    l_prorate_qty;
    l_line_tbl (l_line_tbl_count).schedule_ship_date :=
    l_sch_ship_date;
    l_line_tbl (l_line_tbl_count).attribute1 :=
    l_attribute1;
    l_line_tbl (l_line_tbl_count).attribute2 :=
    l_attribute2;
    l_line_tbl (l_line_tbl_count).attribute9 := l_line_id;
    l_line_tbl (l_line_tbl_count).attribute10 :=
    ROUND (l_prorate_qty / l_order_qty * 100, 5);
    l_line_tbl (l_line_tbl_count).agreement_id :=
    l_agreement_id;
    l_line_tbl (l_line_tbl_count).calculate_price_flag :=
    'Y';
    DBMS_OUTPUT.put_line( '3rd insert'
    || 'l_prorate_qty'
    || l_prorate_qty
    || 'l_ship_to_org_id'
    || l_ship_to_org_id
    || 'l_sch_ship_date'
    || l_sch_ship_date
    || 'l_child_items.inventory_item_id'
    || l_child_items.inventory_item_id
    || 'l_agreement_id'
    || l_agreement_id);
    END IF;
    COMMIT;
    END LOOP;
    END IF;
    END IF;
    ELSIF l_order_qty > l_excl_temp
    THEN
    -- Loop the cursor with exclusion of soldado logic
    FOR l_child_item IN c_child_items (l_segment, l_organization_id)
    LOOP
    l_prorate_percent := 0;
    l_prorate_qty := 0;
    l_prorate_percent := ROUND (100 / l_child_item.total_rows, 5);
    l_prorate_qty :=
    ROUND (
    ( (l_order_qty - l_excl_temp) / l_child_item.total_rows),
    5
    l_line_tbl_count := l_line_tbl_count + 1;
    l_qty_temp := l_qty_temp + l_prorate_qty;
    -- To calculate the prorate quantity for the last line
    IF c_child_items%ROWCOUNT = l_child_item.total_rows
    THEN
    l_prorate_qty :=
    l_prorate_qty
    + (l_order_qty - (l_qty_temp + l_excl_temp));
    END IF;
    -- Initializing the line record type to process
    DBMS_OUTPUT.put_line (
    'Initializing the Sales order Lines Record type4'
    l_line_tbl (l_line_tbl_count) := oe_order_pub.g_miss_line_rec;
    l_line_tbl (l_line_tbl_count).operation :=
    oe_globals.g_opr_create;
    l_line_tbl (l_line_tbl_count).header_id := l_header_id;
    l_line_tbl (l_line_tbl_count).inventory_item_id :=
    l_child_item.inventory_item_id;
    l_line_tbl (l_line_tbl_count).ship_to_org_id :=
    l_ship_to_org_id;
    l_line_tbl (l_line_tbl_count).ordered_quantity := l_prorate_qty;
    l_line_tbl (l_line_tbl_count).schedule_ship_date :=
    l_sch_ship_date;
    l_line_tbl (l_line_tbl_count).attribute1 := l_attribute1;
    l_line_tbl (l_line_tbl_count).attribute2 := l_attribute2;
    l_line_tbl (l_line_tbl_count).attribute9 := l_line_id;
    l_line_tbl (l_line_tbl_count).attribute10 :=
    ROUND (l_prorate_qty / l_order_qty * 100, 5);
    l_line_tbl (l_line_tbl_count).agreement_id := l_agreement_id;
    l_line_tbl (l_line_tbl_count).calculate_price_flag := 'Y';
    END LOOP;
    END IF;
    END IF; -- to check whether any records are initialized
    IF l_line_tbl_count > 0
    THEN
    -- Cancel the Parent Item
    DBMS_OUTPUT.put_line ('Cancel the Parent Item');
    l_line_tbl (l_line_tbl_count + 1) := oe_order_pub.g_miss_line_rec;
    l_line_tbl (l_line_tbl_count + 1).operation :=
    oe_globals.g_opr_update;
    l_line_tbl (l_line_tbl_count + 1).header_id := l_header_id;
    l_line_tbl (l_line_tbl_count + 1).line_id := l_line_id;
    l_line_tbl (l_line_tbl_count + 1).ordered_quantity := 0;
    l_line_tbl (l_line_tbl_count + 1).attribute10 := l_order_qty;
    l_line_tbl (l_line_tbl_count + 1).cancelled_flag := 'Y';
    l_line_tbl (l_line_tbl_count + 1).change_reason := 'Not Provided';
    DBMS_OUTPUT.put_line( 'Cancellation Process fileds'
    || 'HDR_ID'
    || l_header_id
    || 'LINE'
    || l_line_id
    || 'l_order_qty'
    || l_order_qty);
    -- Call the procedure to process the sales order lines
    -- process_order_line_api (p_line_tbl_rec => l_line_tbl,
    -- p_line_id => l_line_id,
    -- p_error_flag => l_error,
    -- p_error_message => l_error_message);
    IF l_error = 'Y'
    THEN
    resultout := 'COMPLETE:Y';
    ELSE
    resultout := 'COMPLETE:N';
    END IF;
    ELSE
    resultout := 'COMPLETE:N';
    END IF;
    END IF;
    BEGIN
    fnd_global.apps_initialize (fnd_global.user_id,
    fnd_global.resp_id,
    fnd_global.resp_appl_id);
    -- BEGIN
    -- MO_GLOBAL.SET_POLICY_CONTEXT ('S', 321);
    -- END;
    -- fnd_global.apps_initialize (-1, 21623, 660);
    -- Call Process Line API to process sales order lines
    DBMS_OUTPUT.put_line ('fianl line to be processd');
    BEGIN
    oe_order_pub.process_line (p_line_tbl => p_line_tbl_rec,
    x_line_out_tbl => l_line_out_tbl,
    x_return_status => l_return_status,
    x_msg_count => l_msg_count,
    x_msg_data => l_msg_data);
    COMMIT;
    DBMS_OUTPUT.put_line ('API Processed' || l_msg_data);
    fnd_file.put_line (fnd_file.LOG, 'Processed - ' || l_msg_data);
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ('Failed With1' || SQLERRM);
    END;
    -- display error msgs
    IF (l_debug_level > 0)
    THEN
    FOR i IN 1 .. l_msg_count
    LOOP
    oe_msg_pub.get (p_msg_index => i,
    p_encoded => fnd_api.g_false,
    p_data => l_data,
    p_msg_index_out => l_msg_index);
    fnd_file.put_line (fnd_file.LOG, 'message is:' || l_data);
    fnd_file.put_line (fnd_file.LOG,
    'message index is:' || l_msg_index);
    DBMS_OUTPUT.put_line (
    'l_data' || l_data || 'l_debug_level' || l_debug_level
    END LOOP;
    END IF;
    IF p_error_flag = 'N'
    THEN
    FOR i IN 1 .. l_msg_count
    LOOP
    oe_msg_pub.get (p_msg_index => i,
    p_encoded => fnd_api.g_false,
    p_data => p_error_message,
    p_msg_index_out => l_msg_index);
    END LOOP;
    ELSE
    DBMS_OUTPUT.put_line ('Out Of loop Exit');
    END IF;
    fnd_file.put_line (fnd_file.LOG, 'p_error_message - ' || SQLERRM);
    DBMS_OUTPUT.put_line ('p_error_message' || p_error_message || SQLERRM);
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ('Failed With' || SQLERRM);
    fnd_file.put_line (fnd_file.LOG,
    'Unexpected Errors Found4 - ' || SQLERRM);
    END;
    END;
    Thanks
    Shagul

  • Sales Order No is not accepting when we doing down Payment through F-29

    Hi All,
    when we are doing customer down Payment thru F-29, system is not accepting sales order number in sales order feild itself.
    if we enter quation or enqiry number system is accepting and posting, if we put sales order number feild empty also it accpting and posting, if we enter sales order number in sales order feild sytem is not accepting it is giving error message and saying entry xxxx does not exist in VBUK - check your entry
    kindly help regarding this
    thanks in advance
    Kiran

    Sales order does not create FI document, only billing document does.  You can only apply payment to the corresponding FI (transferred from billing) document.

  • Sale Order quantity,amount not reduce when raised 1st partialy AR invoice

    Help needed,
    Please can anyone help .. I came with case that our company policy is to raise Partial AR Invoice on single Sale order.
    When we generate 1st AR Invoice on Sale order and manually changed qty till this process ok. but when we select 2nd time to same SO , all rows came with same qty and amount when SO was generated.
    i need to reduce the amount and qty automatically when i raised 2nd partial invoice through AR invoice.
    i am new on this forum , please help me to solve this problem if there is any query,
    Thanks in advance.

    Dear Shafi ullah,
    This is difinetly  system bug, what is you SAP patch.
    try to run same senario with different patch
    And log raise support tiket to SAP.
    Regards
    MANGESH PAGDHARE

Maybe you are looking for

  • My iPhone 5 isn't powering on. What's wrong with this?

    My iPhone 5 was just recently updated to iOS 7 and I spent a lot of hours playing and doing stuff on it but it has just recently run into trouble. Here's what happened: Last night, at the dead of night at about 2 AM, I woke up to find my iPhone 5 dis

  • Step by step creation of sales order in oops

    step by step creation of sales order in oops

  • Editable hierarchy viewer

    Hi, I noticed that there does not seem to be a way to edit data in a hierarchy viewer (Jdev 11.1.1.10). I even tried changing default <outputText> fields to <inputText> fields. I was wondering if someone had any suggestions. Thanks,

  • Hamamatsu Video Capture Library

    Hi, I have a Hamamatsu Digital Camera (Orca C11440-10C) and a PCI Express frame grabber (X64 Xcelera-CL PX4) and I am trying to control image acquisition through LabVIEW. I have downloaded and installed the Hamamatsu Video Capture Library (http://sal

  • Reg: IDOC import

    Hi guys, While importing the idocs in ESR (PI 7.1) ,after giving application server, sytem number ,user id and password getting error as "Authentication not sufficient " , i enabled the option in the SWCV for importing idocs. Please let me know wheth