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

Similar Messages

  • 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

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

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

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

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

  • In Oats Drag and Drop Api is not working in Firefox Browser

    To Write OAts test for Drag and Drop functionality
    we are using "dragTo" API.
    Ex :
    web.image("/web:window[@index='0' or @title='Fusion Applications']/web:document[@index='0' or @name='aqizmnwha_1']/web:img[@absoluteLocator='" + sourceIndex + "']")
                     .dragTo("/web:window[@index='0' or @title='Fusion Applications']/web:document[@index='0' or @name='aqizmnwha_1']/web:img[@absoluteLocator='" + targetIndex + "']");
    This Api is not working in firfox.(works in IE browser).
    Is there any other way we can test DnD functionality in firefox and IE?
    Thanks in Advance!
    Thanks,
    Siddi

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • 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

  • Sale order no . can not be displayed in md04

    HI ALL
    sale order no . can not be displayed in md04
    Surendra

    Hi
    What ever line items displayed in MD04 are relevent for MRP.
    If yoursales order is not displayed , it is not relevent for MRP. Pl. coordinate with your SD collegue for configuration of sales order .In that pl. chk schedule line category.
    Pl. chk these items.
    Regards
    YMREDDY

  • Why some times delivery  will created through vl10c even sale order stock is not available?

    Hi,
    why some times delivery  will created through vl10c in batchmode even sale order stock is not available?
    Thanks,
    Kalyan.

    the correct english name is : Replenishment leadtime
    Check with Replenishment lead time - Supply Chain Management (SCM) - SCN Wiki

  • Issue is TEXT_IO application API is not working in report builder 10g.

    Issue is TEXT_IO application API is not working in report builder 10g.
    TEXT_IO application api is working in report builder 6i. (Not working in upgrade from Oracle EBiz 11i to Oracle Ebiz R12)
    I saw that details in some forums, client_text_io is available for form builder 10g.
    Is any other api available for report builder 10g?
    If it is available what steps we need to do?

    All the CLIENT_% procedures are part of webutil in Forms. Forms uses the Java applet on the client PC to perform actions on the local PC via webutil. This is not possible for Reports.
    You can still use text_io on the server, but you need some other way to copy the files to/from the client PC.
    I wonder how you used the functionality in EBS R11. Even R11 uses web reports, so text_io already worked on the server, not the client PC.

  • Sales Order number is  not showing in MD04

    Hi Gurus  ,
    I have got one case where  Sales order number is not showing  in MD04 screen  . This sales order , line item  has already delivered , PGI &  billing document also been generated  . Moreover accounting document is also been created .As cheeked & found that it is not shwoing in MD04 screen  because at  the time sales order creation  availability check “01” was maintained  which has sum up all the  requirement in one  particular day ( Also as
    per SAP note -70408) .
    Now because  all the subsequent document has been generated  for sales order so we can not mark it for “Rejection for rejection “  & to create new  sales order  with  availability check “02” in material master .
    Please let  me know the possible solution for the same or  if any  sap note would  be required to get the sales order number in MD04  .
    Thanks  ,
    Aman

    Hi Kiran ,
    Actually  before running the  report in “SDRQCR21”  in PRD I wanted to  run it in “Quality “ .
    In quality I am not able to simulate the same  .
    Please refer below points related to my testing result .
    1.Mainatined availability check group “01” .
    2 . Created Sales order 
    3. Check in MD04 screen & as expected  sales order  was coming blank  with negative Qty .
    4. Run the MRP which generated PR
    5. PR converted to PO  & GRN was done which updated the stock
    6. Created delivery  & checked the same in MD04  . It was also coming blank  . No delivery  document  numbe was showing in screen  but  it was coming with negative  Qty .
    7. Done the PGI  & blank  delivery document number  was removed & it become  normal .
    In PRD .
    There are 3 sales order
    One sales order is already marked reason for rejection & two sales order delivery , PGI has been done  .
    But still it is showing  blank sales order with negative Qty  & after MRP run it is generating the PR also  .
    I don't why it was  showing with negative values  .
    Please refer attacehed screen shot  .
    Thanks,
    Regards ,
    Aman

  • In Sales order plant is not allowing to change

    Hi Guru's
    In Sales order plant is not allowing to change it's showing gray but some materials it's allowing to change plant. What is the reason for this error can any one please help me.
    dnr

    Hi friend,
    I suppose you cannot change the plant at order level if the material is created to a particular plant.
    As you say for few materials you are able to change, may be due to the fact that the material is extended to the other plants. You need to extend the material to the other plant in MM01 enter tha material and enter the industry sector and Material type and give the same material as the copy from material. A screen will pop up asking for the plant details. Here you can enter the other plant and tha material is extended to the other plant.
    Regards

  • Error in Sales order - Consumption account not found

    Hi Gurus,
    I am facing an error in Sales order - 'Consumption account not found'. The scenario is third party. In sales order, it says 'Consumption account not found'. the item category is TAS and scedule line category has general modification key 'VKA'. And as it is third party, thr is no movement type for the schedule line category. The valuation  class of the material is 3334 (software services). I was thinking In OBYC, under GBB key, this combination of my val. grping code+ 3334 + VKA and relevant GLs shud exist.
    But in my development client, i dont get any error for the same material. And in thr also, thr is no mention of entry like above combination in OBYC. So its making me think that its not config error. But its an issue of master data or GL data.
    Please help me . This is critical.
    -Prashant

    Hi,
    Your observation is perfectly write, the possible errors are
    1.  Check the combination of Account modifier of Purchase order account assignmnet or PR.  Based on the modifier and check the relevent combination in OBYC
    Valuation ClassAccount ModifierIf Groups is there + Transaction Event Key + Gl Accounts
    2.  If GL Account is available then check the GL Master through FS00 for validation of mandatory consumption is required and i feel there is no issue with material master.
    Rewards if it helps
    Regards
    Goutham

Maybe you are looking for

  • How do i transfer external hard drive content to macbook pro?

    How do i transfer external hard drive content back to my macbook pro? I do not see the hard drive icon or a back up icon, where should it be?

  • Limited navigation in projects with questions

    I have a project with special instruction slides provided to support a number of question slides.  The question slides and quiz preferences are set for one try and one retake.  Students use the skin to navigate back and forth in the project and use t

  • SAP ECO 5.0 B2B: No customer found with customer number

    Hello all, we´re using SAP E-Commerce for ERP 5.0 (SP9) with backend SAP ECC 6.0 EHP4. We have changed from SU05 to SU01 user concept. All existing SU05 users have been migrated to SU01. In SU01 (under references) for each SAP E-Commerce user the map

  • Performance Point Dashboard Designer filter and SSRS parameter problem

    I've created reports in SSRS, with parameters, but can't get the filter in Performancepoint to have any affect on the SSRS parameter/reports. My SSRS reports are using shared datasets I've created, with no cubes. My SSRS parameter is text data type.

  • Query on stock transfer between plants

    HI guys, In stock transfer storage location to storage location in one step, all stock types are allowed. Whereas, in two step, only unrestricted stock is allowed. Can I know the reason why!? In plant to plant stock transfer either one step or two st