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.

Similar Messages

  • Sales Order Output - determined by Sales Order Type, Created By

    I want have my order output determined by sales order type
    (vbak-auart) and created by (vbak-ernam).
    I have created a condition table 501, access seqeunce Z001.
    In v/48, in accesses for Z001, I created
    AcNo: 10
    Tab: 501
    Requirement: [empty]
    Exclusive: unchecked
    in fields, I can't find ERNAM in structure KOMKBV1(header), but I find one in KOMPBV1 (item).So I have assigned it to ERNAM.
    besides, I have created the corresponding records in VV11
    I expect to have:
    Output Z001 will be created for sales order type OR if created by user XXX
    However, no output is generated. When I go out detemination analysis, I found that in the output determination procedure, it did go into output type Z001, but, since no value is found for "created by", i got message "Access not made (initialized field").
    I suspect that no value stored in KOMPBV1-ERNAM. Do you know how I can get it done?
    Points will be awarded for useful information. Thanks in advance.

    Hi
    You have to include this field as a Zfield in the structures KOMKBV1, KOMPBV1 and KOMB.
    You have to include the field as Zfield in these structures.
    Once this is done, you should also be able to update this field in the structures.(As on now, you have only created a field, but you have not mentioned how the field has to be updated.
    In order to update the logic, you have to do a small code in one of the user exits for outputs.
    In the user exit, you have to write a code like this
    MOVE VBAK-ERNAM = KOMKBV1-ZERNAM(this is the zfield you have created)
    Now create the condition table and do the rest.
    Your output should work fine. The user exit I was saying is the subroutine USEREXIT_KOMKBV3_FILL in the include RV61B902 in the user exit RVCOMFZZ. If you can give this info to the technical guy, he should be able to find out the same for saels order output also.
    The user exit RVCOMFZZ also has the subroutine USEREXIT_KOMKBV1_FILL    which you can verywell use for your requirement. This will solve your problem
    Hope this helps.
    If you have any problems in this, you can again put the problems in this thread. I will try to solve.
    Reward if this helps you

  • 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 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

  • SD- Sales Order - ATP check not working for few item in same sales order

    Hi Experts,
    Need help we activated ATP check but for few item i could not find confirmation qty after availability check. In same SO out of 4 items for schedule line it confirming qty for 2 item but  it's not confirming for remaining 2 items though stock is available. Please guide me how to correst and what need to check.
    Manoj

    Dear Manoj,
               As you know, ATP is a big subject & some times its difficult to point the exact problem.
    In your case, I suggest you to execute the function module:BAPI_MATERIAL_AVAILABILITY using Tx:SE37
    key in selection criteria , in results check the "ATPQTY"- it will show you how much actual stock is available for use i.e. ATP qtty.
    still if you find the availability & system not confirming the qtty, then problem could be in checking rule
    Tx:OVZ9 check in relevant combination, whether you are considering RLT or not?
    is this case with MTS or MTO
    because in Sales order -
    for MTS - checking rule "A" & MTO checking rule will be "AE"
    Regards,
    Reazuddin MD

  • 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.

  • Sales Order Output determination issue

    Dear expert,
    I met an issue that some orders can not generate output(no output type generated). the other order under the same situation(same order type/ sales area/customer etc. ) has the output generated. I checked nearly 250 orders of last month with the same order type and sales area. more than 30 orders did not have any output generated. I use the same data in the test system several times, get the output generated every time. I can also use the VA02 to add the output manually for the 30 orders.
    I already checked the related config and VV13.  the related routine. they are all good seems to me.
    Does any one met the same problem or can help me to analyze this issue. I am now having no direction to check...
    Looking forward to your reply.
    Br,
    Ivan.

    Ivan, you need to compare orders more properly.
    for example,
    -are they created by different users (if so, do users have different authorizations) ?
    -have someone changed those orders later (look at Environment->Changes in VA03)?
    -were those orders completed (check the logs)
    did you check the printers? does the issue relate to ONE particular printer or not?
    did you check that printer in SPAD ?
    do you have any specific user-exits? request abaper to check some orders.
    any background jobs involved?

  • Header condition type value not displayed in sales order output

    Hi gurus,
    I have observed a strange issue regarding a header condition in a sales order.
    we have a set up like following:
    1. If the Header condition XXXX is used in sales Order then this value should be printed on sales order output.
    2. If the Header condition mentioned in above point is not maintained in sales order it should print the total price of all line items.
    Though i have maintained the header condition value in Sales Order Header its not displayed in SO output.
    That is , I have a sales order and it has one HEADER condition type entered with 3500 USD.
    In fact this value is used for some business purpose and is being printed on the sales order output for a specific output type.
    But where as in a sales order this header condition value is not getting printed on the output though I am using same data as of the sales order which is having the header condition value printed on its output.
    According to business,we must have the header condition value printed on  sales Order output.
    Please suggest how to proceed.
    Thanks in advance.

    Not sure if you are using costom smartform to print invoice, if yes then ask developer to debug and find the root cause and fix it.
    You might need to give him condition when it shuld be printed and when not.
    You can take reference of another output type for which it is printing

  • Incoming orders in COPA not working if Sales Order blocked for Credit Check

    Hi all,
    We need to build a report showing all incoming sales order by entry date and/or change date (change of values or quantities later on). COPA allows to do this, but the problem is that COPA line item table is only updated if the sales order is released from credit check (VKM3). I am looking for a solution to be able to record sales orders in COPA even if they are still blocked for credit check. By doing that we will be able to report all sales orders entered from COPA and provide basis for commissions calculation to the business.
    I have investigated possible COPA enhancements like COPA0005 but it doesn't seem to be used at the time of sales order save.
    Thanks.

    Hello ,
    Thanks for the reply
    As you said , the credit check in the service order is information message "Credit check (maximum percentage for ope
    exceeded)" .
    If you enter and come out this message then one more message will come , i.e., "The business transaction can not be carried out" detail message -  System status CNOK is active (ORD XXXXXXX).
    with the above message , system will not allow to do the Service order release.
    In this particular case , we have done the VKM1 for the sales order to unblock the order from credit check . But again system is checking the credit check at service order (created w.r.t sales order) . we are not able to control this .
    we also suggested the solution to the customer , saying removal of credit check for service orders . But customer requires credit check to happen at both the documents.

  • Processing of Sales order output type BA00 processes another Z output type for acknowledgement.

    Hi Friends,
    I am facing below mentioned issue and request your suggestion to solve it
    Via processing of sales order output type BA00 another Z output type is processed and acknowledgment is sent to SAP inbox( sost).
    This is working incase of manual addition of BA00 output type and via standard program " sd70av1a", but this functionality is not working when i am calling this standard program in a Z report via batch job.     
    with the below code-
    DATA: name TYPE tbtcjob-jobname.
             DATA: number  TYPE tbtcjob-jobcount.
             DATA: print_parameters TYPE pri_params.
             name = 'ORDER_PRINTING'.
             CLEAR: range1.
    *REFRESH: range.
             range1-sign = 'I'.
             range1-option = 'EQ'.
             range1-low = 'BA00'.
    *        range1-high = 'ZBA1'.
             APPEND range1 TO range.
             CALL FUNCTION 'JOB_OPEN'
               EXPORTING
                 jobname          = name
               IMPORTING
                 jobcount         = number
               EXCEPTIONS
                 cant_create_job  = 1
                 invalid_job_data = 2
                 jobname_missing  = 3
                 OTHERS           = 4.
             IF sy-subrc = 0.
               SUBMIT sd70av1a WITH  rg_kschl IN range
                               WITH  rg_vbeln IN order_tab
                               TO SAP-SPOOL
                               SPOOL PARAMETERS print_parameters
                               WITHOUT SPOOL DYNPRO
                               VIA JOB name NUMBER number
                               AND RETURN.
               IF sy-subrc = 0.
                 CALL FUNCTION 'JOB_CLOSE'
                   EXPORTING
                     jobcount             = number
                     jobname              = name
                     strtimmed            = 'X'
                   EXCEPTIONS
                     cant_start_immediate = 1
                     invalid_startdate    = 2
                     jobname_missing      = 3
                     job_close_failed     = 4
                     job_nosteps          = 5
                     job_notex            = 6
                     lock_failed          = 7
                     OTHERS               = 8.
                 IF sy-subrc <> 0.
                 ENDIF.
               ENDIF.
             ENDIF.
           ENDIF.
    In this case only BA00 is getting processed but Z output type created for sending acknowledgment is not triggered.
    Please suggest how can i achieve the required functionality.
    Thanks,
    Surya

    Solved myself..
    Thanks.
    Br,
    Surya

  • Regarding finding out Partner function based on Sales Order/Output Type

    Hi All,
    <b>I have a issue in finding out Partner function[PARVW],  Message partner[PARNR], Message transmission medium[NACHA], Teletex number[TELTX], User name[USNAM], Message processed manually[MANUE], Country Key[TLAND] and some other fields all are related to NAST table.</b>
    Actually we have one script which is already working when we run from from <b>VA02/03</b> for single order.
    When we execute from <b>VA02/03</b> all <b>NAST</b> table entries are filled up and by using those entries we are fetching remaining entries and displaying them in Output.
    Now we are developing another program where we will have a selection screen with <b>Sales order, Output Type & Order Type</b> and execute the program and then we will get list of sales orders in <b>ALV list output</b> with check boxes before every record.
    Now if we select one (or) multiple records from there and click on Print Prevview button i am calling above <b>SAP Script Print Program</b> but now in that P.Program we will not have any <b>NAST</b> table entries other than Sales Order and Output Type those can be moved to [<b>NAST-OBJKY, NAST-KSCHL</b>].
    But here what about other fields in <b>NAST</b> table like <b>PARVW, PARNR, NACHA, TELTX, USNAM, MANUE, TLAND</b> etc.
    How can we get them as we are exclusively using those other <b>NAST</b> table entries in above <b>SCRIPT/Print Program</b>.
    Can anybody solve this issue!
    Thanks in advance.
    Thanks & Regards,
    Prasad.

    Check this FM
    WFMC_MESSAGES_SELECT
    example
    tables : nase.
    constants: appl     like nase-kappl value 'V2'.
    select-options:
      rg_nacha  for nase-nacha default '1',
      rg_kschl  for nase-kschl.
    ranges: rg_objky for nast-objky.
    data:
    msgs_1 like msg0   occurs 100 with header line.
    *-Fill Object Key
    *-Execute fm
    call function 'WFMC_MESSAGES_SELECT'
         exporting
              pi_application = appl
              pi_processing  = '1'
         tables
              ri_medium      = rg_nacha
              ri_type        = rg_kschl
              ri_object      = rg_objky
              tx_messages    = msgs_1.

  • Open Sale Order Value (FD33) not getting diminished even after closing SO?

    Hi,
    Upon Executing FD33 and clicking the status view for a Customer say XYZ , and then choosing EXTRAS-Open Sale Order . Say the value of open sale orders being shown is 75000. Even after closing the open sale orders (By Selecting VA05 and Putting reason for Rejection), and then also the Open Sales Order value is not getting diminished.
    What could be the reason ?
    Pls help.
    Regrds,
    Binayak

    Hi Binayak,
    As mentioned by you, running of Credit re-org program 'RVKRED77' is the only solution for this problem and it is known problem in SAP.
    Some precautions
    1. Always run the program in background by scheduling a job.
    2. The idle time is around midnight when no user is working on SAP.
    3. Some time the job fails as some other program may be updating same tables as this program. In such cases re-schedule the job at different time.
    4. You may run the program 'RVKRED88' which will simulate without actual updation of credit values.
    Hope this clarifies..
    Regards,
    Madhu.

  • Email Sales order link from SAP Work Place

    Dear SAP Gurus,
    Well guys i have to mail the sales order link through the work place but its not working for the sales order. but its working for delivery order and billing document...so i want to know that why its not working?
    Regards,
    Mohsin

    Dear All,
    Can u please help me on this situation? I will be very thankful to u....
    Regards,
    Mohsin

  • Display invoice print (PDF) in sales order(Credit/Debit note) attachement for Validator

    Hello Expert,
    I would like to know if is there any possibility to display invoice print (PDF) in sales order (Credit/Debit note) as attachment.
    Issue:  Customer raise the credit note with the reference of invoice, sometimes user don't explain the reason for credit and don't attach any reference document in sales order(credit request).
    Customer requirement: Customer want to display reference invoice print (PDF)in sales order(Credit request) for validator so validator can cross check with invoice and validate the credit note.
    Could you suggest the best solution?
    I am thinking to give mandatory text box (Text determination)at sales order(Credit request)
    Vipin

    Hi,
    You can enable Document Management System (DMS)
    Please refer below links for details:
    http://scn.sap.com/thread/459101
    http://scn.sap.com/thread/2096563

  • Audio output will not work on external speakers.  Internal speakers will work.  What do i do to replace audio output slot

    audio output will not work on external speakers.  Internal speakers will work.  What do i do to replace audio output slot

    Right click your volume icon in the notification area and select "volume control options". From there, you should be able to select the external speakers.
    I hope that helps!
    Best of luck,
    Kyle
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

Maybe you are looking for

  • Adding an effect to a TextInput Control

    Is there any way to show the text in a TextInput control as though it was being typed in by a user? I have a TextInput defined as follows: <mx:TextInput id="message2Input"         width="100%" height="40"         text="Type Message Here..."         f

  • Database interaction in JSP - Error 500?

    Hi all, I made a page PAGE1,jsp which retrieves data(String S1, S2) from database. It has a submit button which on on clicking directs to PAGE2.jsp. PAGE2.jsp is shown below partially: <%!     InitialContext  ctx =null;      Connection conn= null;   

  • /apps/common/oracle/9.2.0.6.0/JRE/bin/java:  not found.

    I am trying to create DB with dbca and getting this error, need suggestions dbca/opt/oracle/9.2.0.6.0/bin/dbca[123]: /apps/common/oracle/9.2.0.6.0/JRE/bin/java: not found.

  • Setting up 802.11g WDS

    Hello, I have an older model Airport Extreme Base Station and an older model Airport Express that both use 802.11g. I am trying to set up the Airport Express to extend the range of my network. I reset both devices to their factory defaults, and then

  • BI installation is failing

    Hi, I was able to install followings: DB installed 11gr2 and configured [DB on server1] RCU loaded schemas Weblogic server installation [apps server2] Java 1.6_23 INSTALLATION [apps server2] OBIEE software ONLY installation is done. When I'm running