Process_Order API is not working in OM - r12.1.3
Hello,
I am writing a process_order API to create sales orders in Oracle from Blanket Sales Agreements. But below mentioned API is neither throwing any errors nor it is importing. Not sure what am I missing. Complete code is mentioned below.
Hope to get lucky in getting advise from gurus on this forum.
code
/* Formatted on 8/15/2013 2:54:52 PM (QP5 v5.252.13127.32867) */
CREATE OR REPLACE PACKAGE BODY XXCH_BSA_ORDER
IS
PROCEDURE BSA_PROCESS_ORDER (errbuf OUT VARCHAR2,
retcode OUT VARCHAR2,
p_blanket_number NUMBER,
p_blanket_line NUMBER,
p_select VARCHAR2,
p_order_type NUMBER,
p_copies NUMBER)
AS
v_error VARCHAR2 (2000);
BEGIN
INSERT INTO LOGFILE (STEPID, MODULE)
VALUES (1, 'VERIZON');
COMMIT;
FOR i IN 1 .. p_copies
LOOP
INSERT INTO LOGFILE (STEPID, MODULE)
VALUES (2, 'VERIZON');
BSA_API (p_blanket_number => p_blanket_number,
p_blanket_line => p_blanket_line,
p_select => p_select,
p_order_type => p_order_type);
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
v_error := SQLERRM;
RAISE_APPLICATION_ERROR (-20001, v_error);
END;
PROCEDURE BSA_API (p_blanket_number NUMBER,
p_blanket_line NUMBER,
p_select VARCHAR2,
p_order_type NUMBER)
AS
l_header_rec oe_order_pub.header_rec_type;
l_line_tbl oe_order_pub.line_tbl_type;
l_action_request_tbl oe_order_pub.request_tbl_type;
l_header_adj_tbl oe_order_pub.header_adj_tbl_type;
l_line_adj_tbl oe_order_pub.line_adj_tbl_type;
l_header_scr_tbl oe_order_pub.header_scredit_tbl_type;
l_line_scredit_tbl oe_order_pub.line_scredit_tbl_type;
l_request_rec oe_order_pub.request_rec_type;
l_return_status VARCHAR2 (3000);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (3000);
p_api_version_number NUMBER := 1.0;
p_init_msg_list VARCHAR2 (1000) := fnd_api.g_true;
p_return_values VARCHAR2 (1000) := fnd_api.g_true;
p_action_commit VARCHAR2 (1000) := fnd_api.g_true;
x_return_status VARCHAR2 (10);
x_msg_count NUMBER;
x_msg_data VARCHAR2 (3000);
p_header_rec oe_order_pub.header_rec_type
:= oe_order_pub.g_miss_header_rec;
p_old_header_rec oe_order_pub.header_rec_type
:= oe_order_pub.g_miss_header_rec;
p_header_val_rec oe_order_pub.header_val_rec_type
:= oe_order_pub.g_miss_header_val_rec;
p_old_header_val_rec oe_order_pub.header_val_rec_type
:= oe_order_pub.g_miss_header_val_rec;
p_header_adj_tbl oe_order_pub.header_adj_tbl_type
:= oe_order_pub.g_miss_header_adj_tbl;
p_old_header_adj_tbl oe_order_pub.header_adj_tbl_type
:= oe_order_pub.g_miss_header_adj_tbl;
p_header_adj_val_tbl oe_order_pub.header_adj_val_tbl_type
:= oe_order_pub.g_miss_header_adj_val_tbl;
p_old_header_adj_val_tbl oe_order_pub.header_adj_val_tbl_type
:= oe_order_pub.g_miss_header_adj_val_tbl;
p_header_price_att_tbl oe_order_pub.header_price_att_tbl_type
:= oe_order_pub.g_miss_header_price_att_tbl;
p_old_header_price_att_tbl oe_order_pub.header_price_att_tbl_type
:= oe_order_pub.g_miss_header_price_att_tbl;
p_header_adj_att_tbl oe_order_pub.header_adj_att_tbl_type
:= oe_order_pub.g_miss_header_adj_att_tbl;
p_old_header_adj_att_tbl oe_order_pub.header_adj_att_tbl_type
:= oe_order_pub.g_miss_header_adj_att_tbl;
p_header_adj_assoc_tbl oe_order_pub.header_adj_assoc_tbl_type
:= oe_order_pub.g_miss_header_adj_assoc_tbl;
p_old_header_adj_assoc_tbl oe_order_pub.header_adj_assoc_tbl_type
:= oe_order_pub.g_miss_header_adj_assoc_tbl;
p_header_scredit_tbl oe_order_pub.header_scredit_tbl_type
:= oe_order_pub.g_miss_header_scredit_tbl;
p_old_header_scredit_tbl oe_order_pub.header_scredit_tbl_type
:= oe_order_pub.g_miss_header_scredit_tbl;
p_header_scredit_val_tbl oe_order_pub.header_scredit_val_tbl_type
:= oe_order_pub.g_miss_header_scredit_val_tbl;
p_old_header_scredit_val_tbl oe_order_pub.header_scredit_val_tbl_type
:= oe_order_pub.g_miss_header_scredit_val_tbl;
p_line_tbl oe_order_pub.line_tbl_type
:= oe_order_pub.g_miss_line_tbl;
p_old_line_tbl oe_order_pub.line_tbl_type
:= oe_order_pub.g_miss_line_tbl;
p_line_val_tbl oe_order_pub.line_val_tbl_type
:= oe_order_pub.g_miss_line_val_tbl;
p_old_line_val_tbl oe_order_pub.line_val_tbl_type
:= oe_order_pub.g_miss_line_val_tbl;
p_line_adj_tbl oe_order_pub.line_adj_tbl_type
:= oe_order_pub.g_miss_line_adj_tbl;
p_old_line_adj_tbl oe_order_pub.line_adj_tbl_type
:= oe_order_pub.g_miss_line_adj_tbl;
p_line_adj_val_tbl oe_order_pub.line_adj_val_tbl_type
:= oe_order_pub.g_miss_line_adj_val_tbl;
p_old_line_adj_val_tbl oe_order_pub.line_adj_val_tbl_type
:= oe_order_pub.g_miss_line_adj_val_tbl;
p_line_price_att_tbl oe_order_pub.line_price_att_tbl_type
:= oe_order_pub.g_miss_line_price_att_tbl;
p_old_line_price_att_tbl oe_order_pub.line_price_att_tbl_type
:= oe_order_pub.g_miss_line_price_att_tbl;
p_line_adj_att_tbl oe_order_pub.line_adj_att_tbl_type
:= oe_order_pub.g_miss_line_adj_att_tbl;
p_old_line_adj_att_tbl oe_order_pub.line_adj_att_tbl_type
:= oe_order_pub.g_miss_line_adj_att_tbl;
p_line_adj_assoc_tbl oe_order_pub.line_adj_assoc_tbl_type
:= oe_order_pub.g_miss_line_adj_assoc_tbl;
p_old_line_adj_assoc_tbl oe_order_pub.line_adj_assoc_tbl_type
:= oe_order_pub.g_miss_line_adj_assoc_tbl;
p_line_scredit_tbl oe_order_pub.line_scredit_tbl_type
:= oe_order_pub.g_miss_line_scredit_tbl;
p_old_line_scredit_tbl oe_order_pub.line_scredit_tbl_type
:= oe_order_pub.g_miss_line_scredit_tbl;
p_line_scredit_val_tbl oe_order_pub.line_scredit_val_tbl_type
:= oe_order_pub.g_miss_line_scredit_val_tbl;
p_old_line_scredit_val_tbl oe_order_pub.line_scredit_val_tbl_type
:= oe_order_pub.g_miss_line_scredit_val_tbl;
p_lot_serial_tbl oe_order_pub.lot_serial_tbl_type
:= oe_order_pub.g_miss_lot_serial_tbl;
p_old_lot_serial_tbl oe_order_pub.lot_serial_tbl_type
:= oe_order_pub.g_miss_lot_serial_tbl;
p_lot_serial_val_tbl oe_order_pub.lot_serial_val_tbl_type
:= oe_order_pub.g_miss_lot_serial_val_tbl;
p_old_lot_serial_val_tbl oe_order_pub.lot_serial_val_tbl_type
:= oe_order_pub.g_miss_lot_serial_val_tbl;
p_action_request_tbl oe_order_pub.request_tbl_type
:= oe_order_pub.g_miss_request_tbl;
x_header_val_rec oe_order_pub.header_val_rec_type;
x_header_adj_tbl oe_order_pub.header_adj_tbl_type;
x_header_adj_val_tbl oe_order_pub.header_adj_val_tbl_type;
x_header_price_att_tbl oe_order_pub.header_price_att_tbl_type;
x_header_adj_att_tbl oe_order_pub.header_adj_att_tbl_type;
x_header_adj_assoc_tbl oe_order_pub.header_adj_assoc_tbl_type;
x_header_scredit_tbl oe_order_pub.header_scredit_tbl_type;
x_header_scredit_val_tbl oe_order_pub.header_scredit_val_tbl_type;
x_line_val_tbl oe_order_pub.line_val_tbl_type;
x_line_adj_tbl oe_order_pub.line_adj_tbl_type;
x_line_adj_val_tbl oe_order_pub.line_adj_val_tbl_type;
x_line_price_att_tbl oe_order_pub.line_price_att_tbl_type;
x_line_adj_att_tbl oe_order_pub.line_adj_att_tbl_type;
x_line_adj_assoc_tbl oe_order_pub.line_adj_assoc_tbl_type;
x_line_scredit_tbl oe_order_pub.line_scredit_tbl_type;
x_line_scredit_val_tbl oe_order_pub.line_scredit_val_tbl_type;
x_lot_serial_tbl oe_order_pub.lot_serial_tbl_type;
x_lot_serial_val_tbl oe_order_pub.lot_serial_val_tbl_type;
x_action_request_tbl oe_order_pub.request_tbl_type;
x_debug_file VARCHAR2 (100);
l_line_tbl_index NUMBER;
l_msg_index_out NUMBER;
l_user_id fnd_user.user_id%TYPE;
l_appl_id fnd_application.application_id%TYPE;
l_resp_id fnd_responsibility.responsibility_id%TYPE;
l_org_id hr_operating_units.organization_id%TYPE;
l_sold_to_org_id hz_cust_accounts.cust_account_id%TYPE;
l_ship_to_org_id hz_cust_site_uses_all.site_use_id%TYPE;
l_cust_acct_site_id hz_cust_acct_sites_all.cust_acct_site_id%TYPE;
l_party_id hz_parties.party_id%TYPE;
l_price_list_id qp_list_headers_b.list_header_id%TYPE;
l_primary_salesrep_id ra_salesreps.salesrep_id%TYPE;
l_order_type_id oe_transaction_types_all.transaction_type_id%TYPE;
l_order_line_type_id oe_transaction_types_all.transaction_type_id%TYPE;
l_order_category_code oe_transaction_types_all.order_category_code%TYPE;
l_inventory_item_id mtl_system_items_b.inventory_item_id%TYPE;
l_currency_code qp_list_headers.currency_code%TYPE;
l_party_site_id hz_party_sites.party_site_id%TYPE;
xbreak VARCHAR2 (33);
errorx VARCHAR2 (3000);
k INTEGER := 0;
CURSOR BlanketHeader
IS
SELECT *
FROM oe_blanket_headers_all
WHERE header_id = p_blanket_number;
CURSOR BlanketLines (
v_agreement_id NUMBER)
IS
SELECT *
FROM oe_blanket_lines_all
WHERE header_id = v_agreement_id
AND line_number = NVL (p_blanket_line, line_number);
BEGIN
-- Create Header
xbreak := '100';
fnd_global.apps_initialize (12647, 51839, 660);
-- pass in user_id, responsibility_id, and application_id
oe_msg_pub.initialize;
oe_debug_pub.initialize;
l_org_id := fnd_profile.VALUE ('ORG_ID');
xbreak := '101';
fnd_file.Put_line (
fnd_file.LOG,
'*********************************************** BOOK ORDER **************************');
fnd_file.put_line (fnd_file.LOG,
'Begining of the procedure Book Order');
-- Initialize header record
xbreak := '102';
FOR i IN BlanketHeader
LOOP
insert into logfile(stepid,module) values (23,'BPO:'||to_char(i.header_id));
l_header_rec := oe_order_pub.g_miss_header_rec;
xbreak := '103';
l_header_rec.cust_po_number := i.cust_po_number;
l_header_rec.ordered_date := SYSDATE;
l_header_rec.salesrep_id := i.salesrep_id;
l_header_rec.order_type_id := p_order_type;
l_header_rec.operation := oe_globals.g_opr_create; --Specifies that Order is getting created
--xbreak := '104';
l_header_rec.order_category_code := 'ORDER';
-- l_num_tbl_index := 1;
l_header_rec.booked_flag := 'Y';
xbreak := '105';
l_header_rec.sold_to_org_id := i.sold_to_org_id;
l_header_rec.invoice_to_org_id := i.invoice_to_org_id;
l_header_rec.ship_to_org_id := i.ship_to_org_id;
l_header_rec.price_list_id := i.price_list_id;
--Create Line record
FOR j IN BlanketLines(i.header_id)
LOOP
l_line_tbl_index := 1;
-- FIRST LINE RECORD
-- Initialize record to missing
l_line_tbl (l_line_tbl_index) := oe_order_pub.g_miss_line_rec;
-- Line attributes
l_line_tbl (l_line_tbl_index).inventory_item_id :=
j.inventory_item_id;
l_line_tbl (l_line_tbl_index).ordered_quantity := 1;
-- Set to 'N' when you need to pass unit_selling_price
l_line_tbl (l_line_tbl_index).calculate_price_flag := 'N';
l_line_tbl (l_line_tbl_index).unit_selling_price := NULL;
l_line_tbl (l_line_tbl_index).ship_from_org_id := j.org_id;
l_line_tbl (l_line_tbl_index).operation := oe_globals.g_opr_create;
END LOOP;
x_debug_file := oe_debug_pub.set_debug_mode ('FILE');
oe_debug_pub.setdebuglevel (5);
oe_order_pub.process_order (
p_org_id => l_org_id,
p_operating_unit => l_org_id,
p_api_version_number => 1.0,
p_init_msg_list => fnd_api.g_true,
p_return_values => fnd_api.g_true,
p_action_commit => fnd_api.g_true,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_header_rec => l_header_rec,
p_line_tbl => l_line_tbl,
p_action_request_tbl => l_action_request_tbl -- OUT PARAMETERS
x_header_rec => l_header_rec,
x_header_val_rec => x_header_val_rec,
x_header_adj_tbl => x_header_adj_tbl,
x_header_adj_val_tbl => x_header_adj_val_tbl,
x_header_price_att_tbl => x_header_price_att_tbl,
x_header_adj_att_tbl => x_header_adj_att_tbl,
x_header_adj_assoc_tbl => x_header_adj_assoc_tbl,
x_header_scredit_tbl => x_header_scredit_tbl,
x_header_scredit_val_tbl => x_header_scredit_val_tbl,
x_line_tbl => l_line_tbl,
x_line_val_tbl => x_line_val_tbl,
x_line_adj_tbl => x_line_adj_tbl,
x_line_adj_val_tbl => x_line_adj_val_tbl,
x_line_price_att_tbl => x_line_price_att_tbl,
x_line_adj_att_tbl => x_line_adj_att_tbl,
x_line_adj_assoc_tbl => x_line_adj_assoc_tbl,
x_line_scredit_tbl => x_line_scredit_tbl,
x_line_scredit_val_tbl => x_line_scredit_val_tbl,
x_lot_serial_tbl => x_lot_serial_tbl,
x_lot_serial_val_tbl => x_lot_serial_val_tbl,
x_action_request_tbl => l_action_request_tbl);
COMMIT;
INSERT INTO LOGFILE (STEPID, MODULE)
VALUES (
22,
TO_CHAR (l_header_rec.header_id)
|| '-'
|| l_msg_data);
COMMIT;
xbreak := '106';
END LOOP;
FOR i IN 1 .. l_msg_count
LOOP
k := k + 1;
xbreak := '108';
Oe_Msg_Pub.get (p_msg_index => k,
p_encoded => Fnd_Api.G_FALSE,
p_data => l_msg_data,
p_msg_index_out => l_msg_index_out);
INSERT INTO LOGFILE (STEPID, MODULE)
VALUES (
24,l_msg_data);
END LOOP;
/* Check if the process order goes through then it prints the success message, otherwise it prints failed message.*/
IF l_return_status = FND_API.G_RET_STS_SUCCESS
THEN
xbreak := '109';
fnd_file.put_line (
fnd_file.LOG,
'Return from the API:-'
|| 'return status'
|| l_return_status
|| '-'
|| l_header_rec.header_id);
ELSE
xbreak := '110';
fnd_file.put_line (
fnd_file.LOG,
'Return from the API'
|| 'return status'
|| l_return_status
|| '-'
|| TO_CHAR (l_header_rec.header_id));
END IF;
EXCEPTION
WHEN OTHERS
THEN
errorx := xbreak || '-' || SQLERRM;
raise_application_error (-20002, errorx);
END;
END;
Thanks
Darsh
Hussein,
As always - Thank you. I have passed the above issue but now in the same API, it is not importing lines. I need to enter multiple lines for a given sales order through this API. As per the note from you on this thread, I am now maintaining separate set of input and output variables.
When I searched metalink and google, there are countless examples of process_order APIs giving example of importing one sales order line along with header at the time of creation. Then, they ask to add subsequent lines through an UPDATE operations for existing order that was just created. Thus, forcing me to write process_order api call two times.
Can't I just create a loop and add multiple lines right at the time of order creation? Please see the revised code as shown below. This code is not working - it throws "no data found" for a weird reason. I know for a fact that data is fetched properly by blanketLines cursor.
/* Formatted on 8/16/2013 4:23:09 PM (QP5 v5.252.13127.32867) */
CREATE OR REPLACE PACKAGE BODY XXCH_BSA_ORDER
IS
PROCEDURE BSA_PROCESS_ORDER (errbuf OUT VARCHAR2,
retcode OUT VARCHAR2,
p_blanket_number NUMBER,
p_select VARCHAR2,
p_blanket_line NUMBER,
p_order_type NUMBER,
p_copies NUMBER)
AS
v_error VARCHAR2 (2000);
o_order_number NUMBER;
BEGIN
INSERT INTO LOGFILE (STEPID, MODULE)
VALUES (1, 'VERIZON');
COMMIT;
FOR i IN 1 .. p_copies
LOOP
INSERT INTO LOGFILE (STEPID, MODULE)
VALUES (2, 'VERIZON');
BSA_API (p_blanket_number => p_blanket_number,
p_blanket_line => p_blanket_line,
p_select => p_select,
p_order_type => p_order_type,
p_order_number => o_order_number);
fnd_file.put_line (fnd_file.OUTPUT,
'Order Number Created:-' || o_order_number);
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
v_error := SQLERRM;
RAISE_APPLICATION_ERROR (-20001, v_error);
END;
PROCEDURE BSA_API (p_blanket_number NUMBER,
p_blanket_line NUMBER,
p_select VARCHAR2,
p_order_type NUMBER,
p_order_number OUT NUMBER)
AS
l_header_rec oe_order_pub.header_rec_type;
l_header_rec_out oe_order_pub.header_rec_type;
l_line_tbl oe_order_pub.line_tbl_type;
l_line_tbl_out oe_order_pub.line_tbl_type;
l_action_request_tbl oe_order_pub.request_tbl_type;
l_header_adj_tbl oe_order_pub.header_adj_tbl_type;
l_line_adj_tbl oe_order_pub.line_adj_tbl_type;
l_header_scr_tbl oe_order_pub.header_scredit_tbl_type;
l_line_scredit_tbl oe_order_pub.line_scredit_tbl_type;
l_request_rec oe_order_pub.request_rec_type;
l_return_status VARCHAR2 (3000);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (3000);
p_api_version_number NUMBER := 1.0;
p_init_msg_list VARCHAR2 (1000) := fnd_api.g_true;
p_return_values VARCHAR2 (1000) := fnd_api.g_true;
p_action_commit VARCHAR2 (1000) := fnd_api.g_true;
x_return_status VARCHAR2 (10);
x_msg_count NUMBER;
x_msg_data VARCHAR2 (3000);
p_header_rec oe_order_pub.header_rec_type
:= oe_order_pub.g_miss_header_rec;
p_old_header_rec oe_order_pub.header_rec_type
:= oe_order_pub.g_miss_header_rec;
p_header_val_rec oe_order_pub.header_val_rec_type
:= oe_order_pub.g_miss_header_val_rec;
p_old_header_val_rec oe_order_pub.header_val_rec_type
:= oe_order_pub.g_miss_header_val_rec;
p_header_adj_tbl oe_order_pub.header_adj_tbl_type
:= oe_order_pub.g_miss_header_adj_tbl;
p_old_header_adj_tbl oe_order_pub.header_adj_tbl_type
:= oe_order_pub.g_miss_header_adj_tbl;
p_header_adj_val_tbl oe_order_pub.header_adj_val_tbl_type
:= oe_order_pub.g_miss_header_adj_val_tbl;
p_old_header_adj_val_tbl oe_order_pub.header_adj_val_tbl_type
:= oe_order_pub.g_miss_header_adj_val_tbl;
p_header_price_att_tbl oe_order_pub.header_price_att_tbl_type
:= oe_order_pub.g_miss_header_price_att_tbl;
p_old_header_price_att_tbl oe_order_pub.header_price_att_tbl_type
:= oe_order_pub.g_miss_header_price_att_tbl;
p_header_adj_att_tbl oe_order_pub.header_adj_att_tbl_type
:= oe_order_pub.g_miss_header_adj_att_tbl;
p_old_header_adj_att_tbl oe_order_pub.header_adj_att_tbl_type
:= oe_order_pub.g_miss_header_adj_att_tbl;
p_header_adj_assoc_tbl oe_order_pub.header_adj_assoc_tbl_type
:= oe_order_pub.g_miss_header_adj_assoc_tbl;
p_old_header_adj_assoc_tbl oe_order_pub.header_adj_assoc_tbl_type
:= oe_order_pub.g_miss_header_adj_assoc_tbl;
p_header_scredit_tbl oe_order_pub.header_scredit_tbl_type
:= oe_order_pub.g_miss_header_scredit_tbl;
p_old_header_scredit_tbl oe_order_pub.header_scredit_tbl_type
:= oe_order_pub.g_miss_header_scredit_tbl;
p_header_scredit_val_tbl oe_order_pub.header_scredit_val_tbl_type
:= oe_order_pub.g_miss_header_scredit_val_tbl;
p_old_header_scredit_val_tbl oe_order_pub.header_scredit_val_tbl_type
:= oe_order_pub.g_miss_header_scredit_val_tbl;
p_line_tbl oe_order_pub.line_tbl_type
:= oe_order_pub.g_miss_line_tbl;
p_old_line_tbl oe_order_pub.line_tbl_type
:= oe_order_pub.g_miss_line_tbl;
p_line_val_tbl oe_order_pub.line_val_tbl_type
:= oe_order_pub.g_miss_line_val_tbl;
p_old_line_val_tbl oe_order_pub.line_val_tbl_type
:= oe_order_pub.g_miss_line_val_tbl;
p_line_adj_tbl oe_order_pub.line_adj_tbl_type
:= oe_order_pub.g_miss_line_adj_tbl;
p_old_line_adj_tbl oe_order_pub.line_adj_tbl_type
:= oe_order_pub.g_miss_line_adj_tbl;
p_line_adj_val_tbl oe_order_pub.line_adj_val_tbl_type
:= oe_order_pub.g_miss_line_adj_val_tbl;
p_old_line_adj_val_tbl oe_order_pub.line_adj_val_tbl_type
:= oe_order_pub.g_miss_line_adj_val_tbl;
p_line_price_att_tbl oe_order_pub.line_price_att_tbl_type
:= oe_order_pub.g_miss_line_price_att_tbl;
p_old_line_price_att_tbl oe_order_pub.line_price_att_tbl_type
:= oe_order_pub.g_miss_line_price_att_tbl;
p_line_adj_att_tbl oe_order_pub.line_adj_att_tbl_type
:= oe_order_pub.g_miss_line_adj_att_tbl;
p_old_line_adj_att_tbl oe_order_pub.line_adj_att_tbl_type
:= oe_order_pub.g_miss_line_adj_att_tbl;
p_line_adj_assoc_tbl oe_order_pub.line_adj_assoc_tbl_type
:= oe_order_pub.g_miss_line_adj_assoc_tbl;
p_old_line_adj_assoc_tbl oe_order_pub.line_adj_assoc_tbl_type
:= oe_order_pub.g_miss_line_adj_assoc_tbl;
p_line_scredit_tbl oe_order_pub.line_scredit_tbl_type
:= oe_order_pub.g_miss_line_scredit_tbl;
p_old_line_scredit_tbl oe_order_pub.line_scredit_tbl_type
:= oe_order_pub.g_miss_line_scredit_tbl;
p_line_scredit_val_tbl oe_order_pub.line_scredit_val_tbl_type
:= oe_order_pub.g_miss_line_scredit_val_tbl;
p_old_line_scredit_val_tbl oe_order_pub.line_scredit_val_tbl_type
:= oe_order_pub.g_miss_line_scredit_val_tbl;
p_lot_serial_tbl oe_order_pub.lot_serial_tbl_type
:= oe_order_pub.g_miss_lot_serial_tbl;
p_old_lot_serial_tbl oe_order_pub.lot_serial_tbl_type
:= oe_order_pub.g_miss_lot_serial_tbl;
p_lot_serial_val_tbl oe_order_pub.lot_serial_val_tbl_type
:= oe_order_pub.g_miss_lot_serial_val_tbl;
p_old_lot_serial_val_tbl oe_order_pub.lot_serial_val_tbl_type
:= oe_order_pub.g_miss_lot_serial_val_tbl;
p_action_request_tbl oe_order_pub.request_tbl_type
:= oe_order_pub.g_miss_request_tbl;
l_header_val_rec_out oe_order_pub.header_val_rec_type;
l_header_adj_tbl_out oe_order_pub.header_adj_tbl_type;
l_header_adj_val_tbl_out oe_order_pub.header_adj_val_tbl_type;
l_header_price_att_tbl_out oe_order_pub.header_price_att_tbl_type;
l_header_adj_att_tbl_out oe_order_pub.header_adj_att_tbl_type;
l_header_adj_assoc_tbl_out oe_order_pub.header_adj_assoc_tbl_type;
l_header_scredit_tbl_out oe_order_pub.header_scredit_tbl_type;
l_header_scredit_val_tbl_out oe_order_pub.header_scredit_val_tbl_type;
l_line_val_tbl_out oe_order_pub.line_val_tbl_type;
l_line_adj_tbl_out oe_order_pub.line_adj_tbl_type;
l_line_adj_val_tbl_out oe_order_pub.line_adj_val_tbl_type;
l_line_price_att_tbl_out oe_order_pub.line_price_att_tbl_type;
l_line_adj_att_tbl_out oe_order_pub.line_adj_att_tbl_type;
l_line_adj_assoc_tbl_out oe_order_pub.line_adj_assoc_tbl_type;
l_line_scredit_tbl_out oe_order_pub.line_scredit_tbl_type;
l_line_scredit_val_tbl_out oe_order_pub.line_scredit_val_tbl_type;
l_lot_serial_tbl_out oe_order_pub.lot_serial_tbl_type;
l_lot_serial_val_tbl_out oe_order_pub.lot_serial_val_tbl_type;
l_action_request_tbl_out oe_order_pub.request_tbl_type;
x_debug_file VARCHAR2 (100);
l_line_tbl_index INTEGER := 0;
l_msg_index_out NUMBER;
l_user_id fnd_user.user_id%TYPE;
l_appl_id fnd_application.application_id%TYPE;
l_resp_id fnd_responsibility.responsibility_id%TYPE;
l_org_id hr_operating_units.organization_id%TYPE;
l_sold_to_org_id hz_cust_accounts.cust_account_id%TYPE;
l_ship_to_org_id hz_cust_site_uses_all.site_use_id%TYPE;
l_cust_acct_site_id hz_cust_acct_sites_all.cust_acct_site_id%TYPE;
l_party_id hz_parties.party_id%TYPE;
l_price_list_id qp_list_headers_b.list_header_id%TYPE;
l_primary_salesrep_id ra_salesreps.salesrep_id%TYPE;
l_order_type_id oe_transaction_types_all.transaction_type_id%TYPE;
l_order_line_type_id oe_transaction_types_all.transaction_type_id%TYPE;
l_order_category_code oe_transaction_types_all.order_category_code%TYPE;
l_inventory_item_id mtl_system_items_b.inventory_item_id%TYPE;
l_currency_code qp_list_headers.currency_code%TYPE;
l_party_site_id hz_party_sites.party_site_id%TYPE;
xbreak VARCHAR2 (33);
errorx VARCHAR2 (3000);
k INTEGER := 0;
ln_kount INTEGER := 0;
v_order NUMBER;
CURSOR BlanketHeader
IS
SELECT *
FROM oe_blanket_headers_all
WHERE header_id = p_blanket_number;
CURSOR BlanketLines (
v_agreement_id NUMBER)
IS
SELECT *
FROM oe_blanket_lines_all
WHERE header_id = v_agreement_id
AND line_number = NVL (p_blanket_line, line_number);
BEGIN
-- Create Header
xbreak := '100';
l_org_id := fnd_profile.VALUE ('ORG_ID');
INSERT INTO logfile (stepid, module)
VALUES (1, 'orgid:' || TO_CHAR (l_org_id));
oe_msg_pub.initialize;
oe_debug_pub.initialize;
mo_global.set_policy_context ('S', l_org_ID);
mo_global.init ('ONT');
fnd_global.apps_initialize (12647, 51839, 660);
-- pass in user_id, responsibility_id, and application_id
oe_debug_pub.setdebuglevel (5);
x_debug_file := oe_debug_pub.set_debug_mode ('FILE');
INSERT INTO logfile (stepid, module)
VALUES (25, 'debug:' || x_debug_File);
COMMIT;
l_org_id := fnd_profile.VALUE ('ORG_ID');
xbreak := '101';
fnd_file.Put_line (
fnd_file.LOG,
'*********************************************** BOOK ORDER **************************');
fnd_file.put_line (fnd_file.LOG,
'Begining of the procedure Book Order');
-- Initialize header record
xbreak := '102';
FOR i IN BlanketHeader
LOOP
INSERT INTO logfile (stepid, module)
VALUES (23, 'BPO:' || TO_CHAR (i.header_id));
l_header_rec := oe_order_pub.g_miss_header_rec;
xbreak := '103';
l_header_rec.cust_po_number := i.cust_po_number;
l_header_rec.ordered_date := SYSDATE;
l_header_rec.salesrep_id := i.salesrep_id;
l_header_rec.order_type_id := p_order_type;
l_header_rec.operation := oe_globals.g_opr_create; --Specifies that Order is getting created
--xbreak := '104';
l_header_rec.order_category_code := 'ORDER';
-- l_num_tbl_index := 1;
l_header_rec.booked_flag := 'N';
l_header_rec.flow_status_code := 'ENTERED';
xbreak := '105';
l_header_rec.sold_to_org_id := i.sold_to_org_id;
l_header_rec.invoice_to_org_id := i.invoice_to_org_id;
l_header_rec.ship_to_org_id := i.ship_to_org_id;
l_header_rec.price_list_id := i.price_list_id;
l_header_rec.shipping_instructions := i.shipping_instructions;
l_header_rec.freight_terms_code := i.freight_terms_code;
l_header_rec.attribute10 := i.attribute1;
l_header_rec.salesrep_id := i.salesrep_id;
l_action_request_tbl (1) := OE_ORDER_PUB.G_MISS_REQUEST_REC;
INSERT INTO logfile (stepid, module)
VALUES (53, 'BPO:' || TO_CHAR (i.header_id)); -- Create Lines .
xbreak := '206';
FOR j IN BlanketLines (i.header_id)
LOOP
xbreak := '205';
ln_kount := ln_kount + 1;
l_line_tbl_index := 1;
l_line_tbl (l_line_tbl_index) := oe_order_pub.g_miss_line_rec;
l_line_tbl (l_line_tbl_index).operation := oe_globals.g_opr_create;
l_line_tbl (l_line_tbl_index).inventory_item_id :=
j.inventory_item_id;
INSERT INTO logfile (stepid, module)
VALUES (57, 'BPO:' || TO_CHAR (j.inventory_item_id));
l_line_tbl (l_line_tbl_index).order_quantity_uom := 'EA';
l_line_tbl (l_line_tbl_index).payment_term_id := 1000;
l_line_tbl (l_line_tbl_index).schedule_arrival_date := SYSDATE + 1;
l_line_tbl (l_line_tbl_index).schedule_ship_date := SYSDATE + 1;
l_line_tbl (l_line_tbl_index).request_date := SYSDATE;
l_line_tbl (l_line_tbl_index).promise_date := SYSDATE;
l_line_tbl (l_line_tbl_index).shipping_method_code := NULL;
l_line_tbl (l_line_tbl_index).freight_terms_code := NULL;
l_line_tbl (l_line_tbl_index).line_number := 1;
l_line_tbl (l_line_tbl_index).ordered_quantity := 1;
l_line_tbl (l_line_tbl_index).calculate_price_flag := 'N';
l_line_tbl (l_line_tbl_index).unit_selling_price := NULL;
l_line_tbl (l_line_tbl_index).ship_from_org_id := j.org_id;
l_line_tbl (l_line_tbl_index).ship_to_org_id := j.ship_to_org_id;
END LOOP;
oe_order_pub.process_order (
p_org_id => l_org_id,
p_operating_unit => NULL,
p_api_version_number => 1.0,
-- p_init_msg_list => fnd_api.g_true,
-- p_return_values => fnd_api.g_true,
-- p_action_commit => fnd_api.g_true,
p_header_rec => l_header_rec,
p_line_tbl => l_line_tbl,
p_action_request_tbl => l_action_request_tbl -- OUT PARAMETERS
x_header_rec => l_header_rec_out,
x_header_val_rec => l_header_val_rec_out,
x_header_adj_tbl => l_header_adj_tbl_out,
x_header_adj_val_tbl => l_header_adj_val_tbl_out,
x_header_price_att_tbl => l_header_price_att_tbl_out,
x_header_adj_att_tbl => l_header_adj_att_tbl_out,
x_header_adj_assoc_tbl => l_header_adj_assoc_tbl_out,
x_header_scredit_tbl => l_header_scredit_tbl_out,
x_header_scredit_val_tbl => l_header_scredit_val_tbl_out,
x_line_tbl => l_line_tbl_out,
x_line_val_tbl => l_line_val_tbl_out,
x_line_adj_tbl => l_line_adj_tbl_out,
x_line_adj_val_tbl => l_line_adj_val_tbl_out,
x_line_price_att_tbl => l_line_price_att_tbl_out,
x_line_adj_att_tbl => l_line_adj_att_tbl_out,
x_line_adj_assoc_tbl => l_line_adj_assoc_tbl_out,
x_line_scredit_tbl => l_line_scredit_tbl_out,
x_line_scredit_val_tbl => l_line_scredit_val_tbl_out,
x_lot_serial_tbl => l_lot_serial_tbl_out,
x_lot_serial_val_tbl => l_lot_serial_val_tbl_out,
x_action_request_tbl => l_action_request_tbl_out,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);
COMMIT;
FND_FILE.PUT_LINE (
FND_FILE.LOG,
'OM Debug file: '
|| oe_debug_pub.g_dir
|| '/'
|| oe_debug_pub.g_file);
INSERT INTO LOGFILE (STEPID, MODULE)
VALUES (
22,
TO_CHAR (l_header_rec_out.header_id)
|| '-'
|| l_msg_data);
COMMIT;
xbreak := '106';
SELECT order_number
INTO v_order
FROM oe_order_headerS_all
WHERE header_id = l_header_rec_out.header_id;
p_order_number := v_order;
END LOOP;
FOR i IN 1 .. l_msg_count
LOOP
k := k + 1;
xbreak := '108';
Oe_Msg_Pub.get (p_msg_index => k,
p_encoded => Fnd_Api.G_FALSE,
p_data => l_msg_data,
p_msg_index_out => l_msg_index_out);
INSERT INTO LOGFILE (STEPID, MODULE)
VALUES (24, l_msg_data);
fnd_file.put_line (
fnd_file.LOG,
'Return from the API:-'
|| 'return status:-'
|| l_return_status
|| '-'
|| l_msg_data);
END LOOP;
/* Check if the process order goes through then it prints the success message, otherwise it prints failed message.*/
IF l_return_status = FND_API.G_RET_STS_SUCCESS
THEN
xbreak := '109';
fnd_file.put_line (
fnd_file.LOG,
'Return from the API:-'
|| 'return status:-'
|| l_return_status
|| '-'
|| l_header_rec_out.header_id);
ELSE
xbreak := '110';
fnd_file.put_line (
fnd_file.LOG,
'Return from the API:-'
|| 'return status:-'
|| l_return_status
|| '-'
|| TO_CHAR (l_header_rec_out.header_id));
END IF;
EXCEPTION
WHEN OTHERS
THEN
errorx := xbreak || '-' || SQLERRM;
raise_application_error (-20002, errorx);
END;
END;
Similar Messages
-
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. -
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,
SiddiPlease 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. -
Login page not working in EBS R12 after autoconfig.
Hi,
We are using EBS R12 on windows 2003 server 32 on a test machine. As we were making some changes using autoconfig,
as the Login page not working in EBS R12 after running autoconfig.
Kindly help us.
Thanks in advance.Hi,
Rollback the changes and run AutoConfig, see if you get the same error or not then -- See (Note: 387859.1 - Using AutoConfig to Manage System Configurations in Oracle E-Business Suite Release 12) for details "2.5. Rolling Back an AutoConfig Session".
Regards,
Hussein -
MAIL API : MessageCountListener not working
Dear friends
I'm having a problem with mail API. I added a messagecountlistener to my INBOX folder. But it is not responding to new mails. I tried using the monitor example that comes along with the samples in mail API but that too is not working.. Following is the code of monitor.java sample
public static void main(String argv[])
if (argv.length != 5) {
System.out.println("Usage: monitor <host> <user> <password> <mbox> <freq>");
System.exit(1);
System.out.println("\nTesting monitor\n");
try {
Properties props = System.getProperties();
// Get a Session object
Session session = Session.getDefaultInstance(props, null);
// session.setDebug(true);
// Get a Store object
Store store = session.getStore("imap");
// Connect
store.connect(argv[0], argv[1], argv[2]);
// Open a Folder
Folder folder = store.getFolder(argv[3]);
if (folder == null || !folder.exists()) {
System.out.println("Invalid folder");
System.exit(1);
folder.open(Folder.READ_WRITE);
// Add messageCountListener to listen for new messages
folder.addMessageCountListener(new MessageCountAdapter() {
public void messagesAdded(MessageCountEvent ev) {
Message[] msgs = ev.getMessages();
System.out.println("Got " + msgs.length + " new messages");
// Just dump out the new messages
for (int i = 0; i < msgs.length; i++) {
try {
DataHandler dh = msgs.getDataHandler();
InputStream is = dh.getInputStream();
int c;
while ((c = is.read()) != -1)
System.out.write(c);
} catch (IOException ioex) {
ioex.printStackTrace();
} catch (MessagingException mex) {
mex.printStackTrace();
// Check mail once in "freq" MILLIseconds
int freq = Integer.parseInt(argv[4]);
for (; ;) {
Thread.sleep(freq); // sleep for freq milliseconds
// This is to force the IMAP server to send us
// EXISTS notifications.
int i = folder.getMessageCount();
System.out.println(i);
} catch (Exception ex) {
ex.printStackTrace();
Problem is that inspite of new mails coming in , the count is not incrementing and no listener is getting activated.. Please give me a solution for this
Regards
DST
Can anyone tell me whyHello!
I've the same problem, using protocol pop3 insteadof imap.
I use jdk1.4 and the last release of mail.jar and activation.jar.
Please help !
Thanx.
Fabien. -
BC Next API call not working on webapp detail page
Hi all
I'm trying to get the CRM data for a specific record using the front end API call...here's the code (fields minimal for posting here)
{module_data resource="customers" version="v3" fields="id,firstName,lastName,email1" skip="0" limit="10" where="\{'id':'10734478'\}" order="id" collection="myData"}
<pre>{{myData|json}}</pre>
This code works fine on a normal page, rendering the expected JSON output, but the exact same code does not work on a webapp detail page, instead I get this result rendered on the page, obviously failing on the where clause for some reason.
{'id':'10734478'\}" order="id" collection="myData"}
Anyone know how to make this work? or is it a BCNext bug?
Thanks
DaveHi Dave, if you make this as an Idea so BC can track - its a bug.
It has happened with other things as well where it is not render properly, I thought they had fixed it, but looks to be back
As a side note...
<script>console.log({{myData|json}});</script> Is a lot nicer to manage -
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
ShagulHi 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 -
ADF JS API methods not working for the newly created rows in table
Hi All,
We need to make sure the focus goes back to the newly created rows first column's first component.
Used findComponent and findComponentByAbsoulteId and even hard coded the id, but still the methods are returning null.
Even tried ADFRichTable.getRowKey(index), by passing index as 0 for the first row, still the method is returning null.
Tried ADFUITable.findComponent(Object scopedId, Object rowKey), but unable to pass client side rowKey as the above method is returning null.
All our requirement is to make the focus back to the first row's component when the user clicks on the cancel button instead of save button. Appreciate your help. Thanks.
P.S.: Rows will be created using CreateInsert method.
JDEV Version: 11.1.2.0.0 and Table is in a region and we are using UI Shell Tab Template to launch regions.
Raja.
Edited by: RajaRamasamy on Feb 10, 2013 4:30 PM
Edited by: RajaRamasamy on Feb 10, 2013 4:30 PMThanks Frank,
But some times even we use findComponentByAbsoulteLocator, its not working. So i followed the approach where you will get the rowID like the below and construct the client ID and pushing the JS to client using Service class. And it worked.
String rowId = table.getClientRowKeyManager().getClientRowKey(facesContext, table, rowKey);
But i am worried that even though we hard coded the client and executing the js function from the command button by keeping client listener's type as click, the focus is not setting. And i tried giving the id as tableId[rowIndex]:componentId in the findComponentByAbsoulteLocator.
Can you let me know is there another way to make focus only using JS on click of command button, where the button does not have any action or actionListener.
Raja. -
GetEdgeCurrentSlice API does not work
Hi
I am trying to use the dataAccess.getEdgeCurrentSlice API to get the current selected value of a drop down box in the Page Item. However, every time when I pressed the "Go" button, the return value of the getEdgeCurrentSlice API does not return the current selected value but instead it display the previous value of the drop down box.
For example: The first time I selected the 3rd element in the drop down list and pressed "Go", the return value is 0 and the second time I selected the 4th element of the drop down list and pressed "Go", it returned 3 and the third time when I selected the 2nd element and pressed "Go", it returned 4.
I am not sure if this API is returning the current slice value or it returns the previous slice value.
Thanks
ByronTry using this code sample:
String pgDim, pgDimMbr;
int pgLayerCount = DataAccess.getLayerCount(DataDirector.PAGE_EDGE);
int pgCurrSlice =
DataAccess.getEdgeCurrentSlice(DataDirector.PAGE_EDGE);
for (int i = 0; i++; i < pgLayerCount)
pgDim =
(String)DataAccess.getLayerMetadata(DataDirector.PAGE_EDGE, i,
LayerMetadataMap.LAYER_METADATA_NAME);
pgDimMbr =
(String)DataAccess.getMemberMetadata(DataDirector.PAGE_EDGE, i,
pgCurrSlice, METADATA_VALUE); -
Hi,
For one of the web control,I am using ExecuteScript API to get the UITestControl as explained in this link (http://blogs.msdn.com/b/visualstudioalm/archive/2013/01/18/introducing-jscript-execution-on-internetexplorer-and-crossbrowser-in-coded-ui-test.aspx
)and trying to perform click action on the control.It is not performing the click action on the control but script status is success.
Problem is seen only with specific Overload of Mouse.Click().Here I am constructing the control using bounding rectangle dynamically.
The API I am using is
Microsoft.VisualStudio.TestTools.UITesting.Mouse.Click(UITestControl, MouseButtons.Left, ModifierKey.None, clickablePoint );
Point Caluculation is shown below:
clickablePoint = return new Point(boundingRect.Width / 5, boundingRect.Height / 4);
I tried to debug the code and found that Selenium web driver is throwing null reference exception while using this API for Left button click action.Could you please check the problem and fix it.So that I can
use this API as per my requirement.
Regards,
Nagasree.Hi Nagasree,
Latest version of Chrome and Firefox supported by cross browser testing are Chrome version 38.0.2125.111 and
Firefox 33. So please make sure the Chrome and Firefox is supported by cross browser testing
Whether this API: Microsoft.VisualStudio.TestTools.UITesting.Mouse.Click(UITestControl, MouseButtons.Left, ModifierKey.None, clickablePoint ) worked fine with IE browser when
you run this test?
If the same API worked fine on IE browser but not on Chrome or Firefox browser, “Q AND A” tab in this link:
Selenium components for Coded UI Cross Browser Testing is a better place for resolving this problem.
It seems that you want to click the control using bounding rectangle, then you don't neet to use MouseButtons.Left and ModifierKey.None, you can use such API:
Click(UITestControl, Point) or
Click(Point) directly.
You also can try to use the following code snippet, maybe it can help you.
Rectangle r = TargetControl.BoundingRectangle.
Mouse.Click(new Point(r.X + r.Width/2, r.Y + r.Height/2));
Thanks,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Sales Api Is not working After Intializing(Please help it's urgent)
Hi all,
When i am executing an sales api to create lead in sql+ it s executing fine,but when i am executing the same api after intializing in SQL+ or in concurrent request,it is troughing an error like
AS_SALES_MEMBER_PVT Using Fn....
Please help Me and also look into the code...
DECLARE
q_sales_lead_id NUMBER (8);
q_sales_lead_line_out_tb VARCHAR2 (300);
q_sales_lead_cnt_out_tbl VARCHAR2 (500);
q_return_status VARCHAR2 (10);
q_msg_count NUMBER (10);
q_msg_data VARCHAR2 (800);
a_return_status VARCHAR2 (10);
a_msg_count NUMBER (10);
a_msg_data VARCHAR2 (800);
q_noteid NUMBER (4);
x_sales_lead_line_out_tbl as_sales_leads_pub.sales_lead_line_out_tbl_type;
x_sales_lead_cnt_out_tbl as_sales_leads_pub.sales_lead_cnt_out_tbl_type;
l_sales_lead_rec as_sales_leads_pub.sales_lead_rec_type;
l_sales_lead_line_tb1 as_sales_leads_pub.sales_lead_line_tbl_type;
v_party_id NUMBER (10);
v_resource_id NUMBER (10);
v_group_id NUMBER (10);
v_person_id NUMBER (10);
v_org_id NUMBER (10);
v_customer_id NUMBER (10);
v_primary_application VARCHAR2 (150);
v_secondary_application VARCHAR2 (150);
v_lead_provider_type VARCHAR2 (150);
v_nomenclature_final VARCHAR2 (150);
v_segment VARCHAR2 (150);
v_nomenclature VARCHAR2 (150);
v_nomenclature_1 VARCHAR2 (150);
v_segment_1 VARCHAR2 (150);
v_fleet_mix VARCHAR2 (150);
v_category_set_id NUMBER (10);
v_category_id NUMBER (10);
e_msg VARCHAR2 (500);
v_party_name VARCHAR2(150);
out_param VARCHAR2(150);
CURSOR c1 IS
SELECT a.*, ROWID
FROM al_vendor_sms_crmlead_in a
WHERE a.msg_flag = 'N' AND a.customer_code IS NOT NULL
AND a.models IS NOT NULL
AND a.fleet_mix IS NOT NULL
AND a.segments IS NOT NULL
AND a.lead_provider IS NOT NULL
AND a.secondary_app IS NOT NULL
AND a.cp_mobile_no IS NOT NULL
AND a.id='L';
BEGIN
For i in c1 LOOP
BEGIN
out_param :='phone validation';
SELECT ppf.party_id
INTO v_party_id
FROM per_phones pp, per_all_people_f ppf
WHERE ppf.person_id = pp.parent_id
AND pp.phone_type = 'M'
AND pp.phone_number = i.cp_mobile_no
and rownum<=1;
out_param:='Resource_invalid';
SELECT jtf.resource_id, jtm.GROUP_ID, jtf.source_business_grp_id,
jtf.source_id
INTO v_resource_id, v_group_id, v_org_id,
v_person_id
FROM apps.jtf_rs_resource_extns jtf, apps.jtf_rs_group_members jtm
WHERE jtf.resource_id = jtm.resource_id
AND jtf.end_date_active IS NULL
AND jtm.delete_flag = 'N'
AND jtf.user_name NOT LIKE 'ALM%'
--AND jtf.attribute5='Sales'
AND jtf.person_party_id = v_party_id
AND ROWNUM <= 1;
out_param:='Party_invalid';
SELECT party_id,party_name
INTO v_customer_id,v_party_name
FROM apps.hz_parties
WHERE status = 'A' AND party_number = i.customer_code;
out_param:='Sec_prim_application_invalid';
SELECT parent_flex_value_low, flex_value
INTO v_primary_application, v_secondary_application
FROM apps.fnd_flex_values_vl
WHERE parent_flex_value_low IN (
SELECT flex_value
FROM apps.fnd_flex_values_vl
WHERE flex_value_set_id = 1009667
AND enabled_flag = 'Y')
AND enabled_flag = 'Y'
AND TO_NUMBER (TRUNC (SUBSTR (attribute1, 1, 2))) =
i.secondary_app ;
out_param:='Segment_map_invalid';
SELECT Upper(REPLACE (regexp_replace (i.models, '(\s*[[:punct:]])'), ' '))
INTO v_nomenclature
FROM DUAL;
SELECT flex_value
INTO v_nomenclature_final
FROM apps.fnd_flex_values_vl
WHERE flex_value_set_id = 1009798
AND enabled_flag = 'Y'
AND end_date_active IS NULL
AND REPLACE (regexp_replace (flex_value, '(\s*[[:punct:]])'), ' ') =
v_nomenclature
AND ROWNUM <= 1;
SELECT flex_value
INTO v_segment
FROM apps.fnd_flex_values_vl
WHERE flex_value_set_id = 1009632
AND enabled_flag = 'Y'
AND end_date_active IS NULL
AND TO_NUMBER (TRUNC (SUBSTR (flex_value, 1, 2))) = i.SEGMENTS;
SELECT ffvh.flex_value, ffv.flex_value
INTO v_nomenclature_1, v_segment_1
FROM apps.fnd_flex_values_vl ffvh, apps.fnd_flex_values_vl ffv
WHERE ffv.flex_value = ffvh.parent_flex_value_low
AND ffvh.enabled_flag = 'Y'
AND ffv.flex_value_set_id = 1009632
AND ffv.enabled_flag = 'Y'
AND ffvh.flex_value_set_id = 1009798
AND ffvh.parent_flex_value_low = v_segment
AND ffvh.flex_value = v_nomenclature_final;
out_param:='Lead_provider_invalid';
SELECT flex_value
INTO v_lead_provider_type
FROM apps.fnd_flex_values_vl
WHERE flex_value_set_id = 1009718
AND end_date_active IS NULL
AND TO_NUMBER (TRUNC (SUBSTR (flex_value, 1, 2))) =
i.lead_provider;
out_param:='vehicle_res_invalid';
SELECT lookup_code
INTO v_fleet_mix
FROM apps.fnd_lookup_values_vl
WHERE lookup_type = 'VEHICLE_RESPONSE_CODE'
AND enabled_flag = 'Y'
AND TO_NUMBER (TRUNC (SUBSTR (description, 1, 2))) = i.fleet_mix;
out_param:='Category_invalid';
SELECT mic.category_set_id, mic.category_id
INTO v_category_set_id, v_category_id
FROM apps.mtl_item_categories mic, apps.mtl_categories_tl mc
WHERE mic.category_id = mc.category_id
AND organization_id = 106
AND description = v_nomenclature_final
AND ROWNUM <= 1;
out_param:='api-Error';
l_sales_lead_rec.customer_id := v_customer_id;
l_sales_lead_rec.status_code := 'NEW';
l_sales_lead_rec.attribute15 := v_segment_1;
l_sales_lead_rec.attribute12:=To_Char( i.expected_closedate,'YYYY/MM/DD HH24:MI:SS');
l_sales_lead_rec.attribute10 := v_lead_provider_type;
l_sales_lead_rec.attribute9 := v_secondary_application;
l_sales_lead_rec.attribute8 := v_primary_application;
l_sales_lead_rec.assign_to_salesforce_id := v_resource_id;
l_sales_lead_rec.assign_sales_group_id := v_group_id;
l_sales_lead_rec.assign_to_person_id := v_person_id;
l_sales_lead_rec.vehicle_response_code := v_fleet_mix;
l_sales_lead_rec.description:=v_party_name||' '||v_nomenclature;
l_sales_lead_line_tb1 (1).category_id := v_category_id;
l_sales_lead_line_tb1 (1).category_set_id := v_category_set_id;
l_sales_lead_line_tb1 (1).organization_id := v_org_id;
l_sales_lead_line_tb1 (1).quantity:=1;
as_sales_leads_pub.create_sales_lead
(p_api_version_number => 2.0,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_true,
p_validation_level => fnd_api.g_valid_level_full,
p_check_access_flag => 'Y',
p_admin_flag => 'Y',
p_admin_group_id => v_group_id,
p_identity_salesforce_id => v_resource_id,
p_sales_lead_profile_tbl => as_utility_pub.g_miss_profile_tbl,
p_sales_lead_rec => l_sales_lead_rec,
p_sales_lead_line_tbl => l_sales_lead_line_tb1,
p_sales_lead_contact_tbl => as_sales_leads_pub.g_miss_sales_lead_contact_tbl,
x_sales_lead_id => q_sales_lead_id,
x_sales_lead_line_out_tbl => x_sales_lead_line_out_tbl,
x_sales_lead_cnt_out_tbl => x_sales_lead_cnt_out_tbl,
x_return_status => q_return_status,
x_msg_count => q_msg_count,
x_msg_data => q_msg_data);
as_sales_leads_pub.Build_Lead_Sales_Team (
P_Api_Version_Number =>2.0,
P_Init_Msg_List=>FND_API.G_TRUE,
p_Commit=>FND_API.G_TRUE,
p_Validation_Level=> FND_API.G_VALID_LEVEL_FULL,
P_Admin_Group_Id =>v_group_id,
P_identity_salesforce_id=>v_resource_id,
P_salesgroup_id=> v_group_id,
P_Sales_Lead_Id=>q_sales_lead_id,
X_Return_Status=>q_return_status,
X_Msg_Count=>a_msg_count,
X_Msg_Data =>a_msg_data);
IF q_return_status = 'S'
THEN
UPDATE al_vendor_sms_crmlead_in
SET conv_status = 'S'
WHERE unique_identifier = i.unique_identifier AND ROWID = i.ROWID;
ELSE
UPDATE al_vendor_sms_crmlead_in
SET conv_status = 'E' WHERE unique_identifier = i.unique_identifier AND ROWID = i.ROWID;
END IF;
EXCEPTION
WHEN No_Data_Found THEN
UPDATE al_vendor_sms_crmlead_in a
SET a.conv_status = 'ERROR',error_description=out_param
WHERE unique_identifier = i.unique_identifier AND ROWID = i.ROWID;
COMMIT;
END;
UPDATE al_vendor_sms_crmlead_in SET msg_flag='Y' WHERE unique_identifier = i.unique_identifier AND ROWID = i.ROWID;
END LOOP;
END;Please post this question in the CRM On Demand Integration Development forum.
-
Google API font not working in all places
Hi guys,
I'm working on a site and on one of my pages, google's api font will only work on one header (I have them as a paragraphs) in safari. I've only checked firefox and they look fine there. I'm unable to find a fix or a discussion about this issue and I was hoping someone here could take a look. On my index page, it works fine with two headers and I have it done on other pages as well. I'm only having problems with my FAQ page. I have tried a couple different ways to achieve this with my css but I keep getting the same problem and I'm sure you know how frustrating it can get.
Maybe a fresh set of eyes will see the problem.
http://huntingtonbbq.com/New/faq.html
Thanks in advance.Hi
A lot has to do with how the css file is parsed, I normally include the @font-face with the h1 declarations first, (or whichever is the highest in the document) and get this working. One must remember that the font-family rule in the @font-face must also be included in the font-family for, (say) the h1, exactly as given, (I have also found that using double quotes where necessary in the h1's font-family works better).
If you are updating a page from the old none web fonts to use the @font-face it is often necessary to at least reload the page, also watch the linking to the various font files as the download links often require changing, (hopefully cs6 will have the use of @font-face built-in and correctly functioning).
It does take some practice, especially when updating an old css file to get the @font-face working correctly, (like finding the more specific rules that are overwriting the one you have modified!!) but once you have done this two or three times you will wonder what the problem was.
If you wish to look at an example of the @font-face rule in operation view the code on any of the pages of my site at - http://www.pziecina.com. The homepage has it on the actual html page.
PZ -
Discoverer report not working on R12 !
We have just migrated to R12 from 11i and some of the discoverer query is not working, but the same is working fine when we ran thru SQL Developer or TOAD.
Is there any context (mo_global.set_policy_context) needs to be set in Discoverer report to get the data?
ThanksThanks Srini,
There is no any specific error message, the strange thing is if I run the Discoverer report is not returning any data, but if I set the mo_global.set_policy_context ('S',111) in SQL Developer or TOAD and then run the discoverer report it return data...
Any pointers? -
File- Export not working after upgrade from 11i to R12
Hi,
File -> Export not working after upgrade from 11i to R12.1.3 in few systems. Can you please let me know what could be the issue.
If export record count more than 200 it is working fine in all the systems and if change the profile option "Export MIME type” value to ‘text/tab-separated-values’ from application/excel also it is wokring.
Thanks and Regards,
JagadeeshaEnabled the FRD. Below are few last lines. Can you please let me know what i can in this log file contents.
In Argument 1 - Type: String Value: global.frd_debug
Executing GET_ITEM_PROPERTY/FIELD_CHARACTERISTIC Built-in:
In Argument 0 - Type: Integer Value: 196613
In Argument 1 - Type: Number Value: 54
Out Argument 0 - Type: String Value: 12
Executing COPY Built-in:
In Argument 0 - Type: String Value: Entering app_menu.set_prop.
In Argument 1 - Type: String Value: global.frd_debug
Executing FIND_MENU_ITEM Built-in:
In Argument 0 - Type: String Value: FILE.EXPORT
Out Argument 0 - Type: Integer Value: 19
Executing GET_MENU_ITEM_PROPERTY Built-in:
In Argument 0 - Type: Integer Value: 19
In Argument 1 - Type: Number Value: 79
Out Argument 0 - Type: String Value: TRUE
Executing COPY Built-in:
In Argument 0 - Type: String Value: Completed app_menu.set_prop.
In Argument 1 - Type: String Value: global.frd_debug
Executing COPY Built-in:
In Argument 0 - Type: String Value: Completed app_synch.menu_toolbar_sync. Event is WHEN-NEW-ITEM-INSTANCE.
In Argument 1 - Type: String Value: global.frd_debug
Executing NAME_IN Built-in:
In Argument 0 - Type: String Value: GLOBAL.APP_CUSTOM_MODE
Out Argument 0 - Type: String Value: NORMAL
Executing NAME_IN Built-in:
In Argument 0 - Type: String Value: GLOBAL.APP_CUSTOM_MODE
Out Argument 0 - Type: String Value: NORMAL
Executing COPY Built-in:
In Argument 0 - Type: String Value: NULL
In Argument 1 - Type: String Value: GLOBAL.OUT
Executing USER_EXIT Built-in:
In Argument 0 - Type: String Value: FND GETPROFILE NAME="UPK_RECORDING_ENABLED" FIELD="GLOBAL.OUT" N
FNDCPVCM, 11, Built-In, Entry, 316509814, USER_EXIT
FNDCPVCM, 11, Built-In, Exit, 316509814, USER_EXIT
Executing NAME_IN Built-in:
In Argument 0 - Type: String Value: GLOBAL.OUT
Out Argument 0 - Type: String Value: N
Executing NAME_IN Built-in:
In Argument 0 - Type: String Value: system.current_form
Out Argument 0 - Type: String Value: FNDCPVCM
Executing NAME_IN Built-in:
In Argument 0 - Type: String Value: system.current_block
Out Argument 0 - Type: String Value: MASTER
Executing NAME_IN Built-in:
In Argument 0 - Type: String Value: system.current_form
Out Argument 0 - Type: String Value: FNDCPVCM
Executing NAME_IN Built-in:
In Argument 0 - Type: String Value: system.current_block
Out Argument 0 - Type: String Value: MASTER
Executing GET_APPLICATION_PROPERTY Built-in:
In Argument 0 - Type: Number Value: 75
Out Argument 0 - Type: String Value: IHR40P
Executing COPY Built-in:
In Argument 0 - Type: String Value: Completed call_all_libraries. Event is WHEN-NEW-ITEM-INSTANCE.
In Argument 1 - Type: String Value: global.frd_debug
Executing COPY Built-in:
In Argument 0 - Type: String Value: Completed app_standard.event. Event is WHEN-NEW-ITEM-INSTANCE.
In Argument 1 - Type: String Value: global.frd_debug
FNDCPVCM, 10, Prog Unit, Exit, 316509814, /FNDCPVCM-3/P45_30_DEC_201223_28_33
FNDCPVCM, 9, Trigger, Exit, 316509814, WHEN-NEW-ITEM-INSTANCE
FNDCPVCM, 8, Prog Unit, Exit, 316509814, /DMU-4/P8_30_DEC_201223_23_12
# 15 - FNDCPVCM:MASTER.USER_CONCURRENT_QUEUE_NAME.1359399301498413820
WINDOW FNDCPVCM PROGRESS_INDICATOR RESIZE 4198 1500 3
# 16 - FNDCPVCM:MASTER.USER_CONCURRENT_QUEUE_NAME.1359399301512613925
WINDOW FNDCPVCM PROGRESS_INDICATOR RESIZE 4198 1500 3 -
Discoverer Reports does not work in Multi-org Environment after R12 Upgrade
Discoverer Reports does not work in Multi-org Environment after R12 Upgrade. Created a simple report using the below query:
SELECT po_header_id, segment1, type_lookup_code
FROM po_headers
WHERE segment1 = '5000002'
Query works perfectly fine; when i set the ORG_CONTEXT in the database using the command:
EXEC mo_global.set_policy_context('S',129)
But the report doesn't fetch any data when ran from an Org based responsibility. We've ensured that the MO: Operting Unit is set accurately and general Oracle reports (PLSQL Program OR XML Publisher) are working perfectly fine.
===========
I followed the steps provided in Metalink Note: 732826.1 - It works for some responsibilities where the MO: Security Profile is not set; but fails for those responsibilities where the MO: Security Profile is set.
I am looking for specific solution that works irrespective of either the MO: Operating Unit profile is set of not.
Please suggest. Appreciate your response.
Thanks,
Kesava ChunduriHi Hussein,
Thanks for the quick response.
Yes, I've gone thru both the notes specified below:
Discoverer Workbooks Based On Organization Enabled Views Are Not Populated [ID 1293438.1]
- Tried this option; but this option is messing up a couple of Oracle Standard Functionalities.
- For ex: If i set this profile option; we are not able to create any receipts using Custom Responsibilities.
I am able to create the receipt, when i remove this profile option.
No Data Shows for Reports in Discoverer 10g with Applications Release 12 [ID 1054380.1]
- I see that the products i am running these reports from AR/GL - already exists in these tables.
Anything other options??
Thanks,
Kesava
Maybe you are looking for
-
Applying BASIS support package 14 on IDES (DB2 & Windows)
Hi all, I am trying to apply BASIS support package on IDES. Currently process is running on IMPORT 2 step. I run in diaglog and it was continuously showing MOVE NAMETABS at the end. and in ST22 I see thousands of dumps being generated and almos
-
Header and footer in a BW report
Hi Gurus, I need to create a reportin BEx for which I need to have header information like Address of the customer and the remit to address. Can anyone please advice me as to how should I go about creating a header and footer
-
New ipod touch 5 not turning on
Hello! recently, i have bought a brand new ipod touch 5th generation. i used it for two days and it was working quite well and the next day, my sister took it to her school but it was taken away by the principal since her school is very strict and do
-
HP Scanjet 4890 and MBP - HP software crashes
I bought this Scanjet via Applestore. It was easy to set up. It will happily scan a small photo and it will also work, using the HP copy utility, as a photocopier with my HP printer via the MBP. However, if I try to scan a whole A4 page of handwritin
-
My payment option not work and my visa card not show help me