DECLARE
l_input_details oks_qp_pkg.input_details;
l_output_details oks_qp_pkg.price_details;
l_modif_details qp_preq_grp.line_detail_tbl_type;
l_pb_details oks_qp_pkg.g_price_break_tbl_type;
l_return_status VARCHAR2 (20);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (2000);
l_status_tbl oks_qp_int_pvt.pricing_status_tbl;
l_final_status_tbl oks_qp_int_pvt.pricing_status_tbl;
l_count NUMBER;
l_msg_index_out NUMBER;
l_num NUMBER;
l_error_message VARCHAR2 (2000);
BEGIN
l_num := 10;
l_input_details.intent := 'SP'; --> Subline
l_input_details.chr_id := 1549063; -->Contract Id
l_input_details.currency := 'USD';
l_input_details.line_id := 364326736554344799961890872824534166768; --> Service Line id
l_input_details.subline_id := 364326736554364142775004706891329465584; --> Product Line id
l_num := 20;
oks_qp_pkg.calc_price (p_detail_rec => l_input_details,
x_price_details => l_output_details,
x_modifier_details => l_modif_details,
x_price_break_details => l_pb_details,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data
);
l_num := 30;
IF l_return_status <> fnd_api.g_ret_sts_success
THEN
l_num := 40;
IF l_msg_count > 0
THEN
FOR i IN 1 .. l_msg_count
LOOP
l_num := 50;
apps.fnd_msg_pub.get (p_msg_index => i,
p_encoded => fnd_api.g_false,
p_data => l_msg_data,
p_msg_index_out => l_msg_index_out
);
IF l_error_message IS NULL
THEN
l_error_message := SUBSTR (l_msg_data, 1, 250);
ELSE
l_error_message :=
l_error_message || ' /' || SUBSTR (l_msg_data, 1, 250);
END IF;
END LOOP;
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line ('API Error : ' || l_error_message);
DBMS_OUTPUT.put_line ('*****************************************');
ELSE
apps.fnd_msg_pub.get (p_msg_index => 1,
p_encoded => fnd_api.g_false,
p_data => l_msg_data,
p_msg_index_out => l_msg_index_out
);
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line ('API Error : ' || l_msg_data);
DBMS_OUTPUT.put_line ('*****************************************');
END IF;
ELSE
l_num := 60;
DBMS_OUTPUT.put_line ('API Success');
DBMS_OUTPUT.put_line('***************************************************');
DBMS_OUTPUT.put_line('Product Quantity : ' || l_output_details.prod_qty);
DBMS_OUTPUT.put_line('Product Quantity UOM : '
|| l_output_details.prod_qty_uom);
DBMS_OUTPUT.put_line('Service Quantity : ' || l_output_details.serv_qty);
DBMS_OUTPUT.put_line('Service Quantity UOM : '
|| l_output_details.serv_qty_uom);
DBMS_OUTPUT.put_line('Product Price List Id : '
|| l_output_details.prod_price_list_id);
DBMS_OUTPUT.put_line('Service Price List Id : '
|| l_output_details.serv_price_list_id);
DBMS_OUTPUT.put_line('Product Price List Line Id : '
|| l_output_details.prod_price_list_line_id);
DBMS_OUTPUT.put_line('Service Price List Line Id : '
|| l_output_details.serv_price_list_line_id);
DBMS_OUTPUT.put_line('Product List Unit Price : '
|| l_output_details.prod_list_unit_price);
DBMS_OUTPUT.put_line('Service List Unit Price : '
|| l_output_details.serv_list_unit_price);
DBMS_OUTPUT.put_line('Product Adjustment Unit Price : '
|| l_output_details.prod_adj_unit_price);
DBMS_OUTPUT.put_line('Service Adjustment Unit Price : '
|| l_output_details.serv_adj_unit_price);
DBMS_OUTPUT.put_line('Product Priced Quantity : '
|| l_output_details.prod_priced_qty);
DBMS_OUTPUT.put_line('Product Priced UOM : '
|| l_output_details.prod_priced_uom);
DBMS_OUTPUT.put_line('Product Extension Amount : '
|| l_output_details.prod_ext_amount);
DBMS_OUTPUT.put_line('Service Priced Quantity : '
|| l_output_details.serv_priced_qty);
DBMS_OUTPUT.put_line('Service Priced UOM : '
|| l_output_details.serv_priced_uom);
DBMS_OUTPUT.put_line('Service Extended Amount : '
|| l_output_details.serv_ext_amount);
DBMS_OUTPUT.put_line('Service OPerand : '
|| l_output_details.serv_operand);
DBMS_OUTPUT.put_line('Service Operator : '
|| l_output_details.serv_operator);
DBMS_OUTPUT.put_line ('Status Code : ' || l_output_details.status_code);
DBMS_OUTPUT.put_line ('Status Text : ' || l_output_details.status_text);
DBMS_OUTPUT.put_line('**********************************************');
END IF;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line( l_num
|| ' Unexpected Error : '
|| SUBSTR (SQLERRM, 1, 250));
END;
l_input_details oks_qp_pkg.input_details;
l_output_details oks_qp_pkg.price_details;
l_modif_details qp_preq_grp.line_detail_tbl_type;
l_pb_details oks_qp_pkg.g_price_break_tbl_type;
l_return_status VARCHAR2 (20);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (2000);
l_status_tbl oks_qp_int_pvt.pricing_status_tbl;
l_final_status_tbl oks_qp_int_pvt.pricing_status_tbl;
l_count NUMBER;
l_msg_index_out NUMBER;
l_num NUMBER;
l_error_message VARCHAR2 (2000);
BEGIN
l_num := 10;
l_input_details.intent := 'SP'; --> Subline
l_input_details.chr_id := 1549063; -->Contract Id
l_input_details.currency := 'USD';
l_input_details.line_id := 364326736554344799961890872824534166768; --> Service Line id
l_input_details.subline_id := 364326736554364142775004706891329465584; --> Product Line id
l_num := 20;
oks_qp_pkg.calc_price (p_detail_rec => l_input_details,
x_price_details => l_output_details,
x_modifier_details => l_modif_details,
x_price_break_details => l_pb_details,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data
);
l_num := 30;
IF l_return_status <> fnd_api.g_ret_sts_success
THEN
l_num := 40;
IF l_msg_count > 0
THEN
FOR i IN 1 .. l_msg_count
LOOP
l_num := 50;
apps.fnd_msg_pub.get (p_msg_index => i,
p_encoded => fnd_api.g_false,
p_data => l_msg_data,
p_msg_index_out => l_msg_index_out
);
IF l_error_message IS NULL
THEN
l_error_message := SUBSTR (l_msg_data, 1, 250);
ELSE
l_error_message :=
l_error_message || ' /' || SUBSTR (l_msg_data, 1, 250);
END IF;
END LOOP;
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line ('API Error : ' || l_error_message);
DBMS_OUTPUT.put_line ('*****************************************');
ELSE
apps.fnd_msg_pub.get (p_msg_index => 1,
p_encoded => fnd_api.g_false,
p_data => l_msg_data,
p_msg_index_out => l_msg_index_out
);
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line ('API Error : ' || l_msg_data);
DBMS_OUTPUT.put_line ('*****************************************');
END IF;
ELSE
l_num := 60;
DBMS_OUTPUT.put_line ('API Success');
DBMS_OUTPUT.put_line('***************************************************');
DBMS_OUTPUT.put_line('Product Quantity : ' || l_output_details.prod_qty);
DBMS_OUTPUT.put_line('Product Quantity UOM : '
|| l_output_details.prod_qty_uom);
DBMS_OUTPUT.put_line('Service Quantity : ' || l_output_details.serv_qty);
DBMS_OUTPUT.put_line('Service Quantity UOM : '
|| l_output_details.serv_qty_uom);
DBMS_OUTPUT.put_line('Product Price List Id : '
|| l_output_details.prod_price_list_id);
DBMS_OUTPUT.put_line('Service Price List Id : '
|| l_output_details.serv_price_list_id);
DBMS_OUTPUT.put_line('Product Price List Line Id : '
|| l_output_details.prod_price_list_line_id);
DBMS_OUTPUT.put_line('Service Price List Line Id : '
|| l_output_details.serv_price_list_line_id);
DBMS_OUTPUT.put_line('Product List Unit Price : '
|| l_output_details.prod_list_unit_price);
DBMS_OUTPUT.put_line('Service List Unit Price : '
|| l_output_details.serv_list_unit_price);
DBMS_OUTPUT.put_line('Product Adjustment Unit Price : '
|| l_output_details.prod_adj_unit_price);
DBMS_OUTPUT.put_line('Service Adjustment Unit Price : '
|| l_output_details.serv_adj_unit_price);
DBMS_OUTPUT.put_line('Product Priced Quantity : '
|| l_output_details.prod_priced_qty);
DBMS_OUTPUT.put_line('Product Priced UOM : '
|| l_output_details.prod_priced_uom);
DBMS_OUTPUT.put_line('Product Extension Amount : '
|| l_output_details.prod_ext_amount);
DBMS_OUTPUT.put_line('Service Priced Quantity : '
|| l_output_details.serv_priced_qty);
DBMS_OUTPUT.put_line('Service Priced UOM : '
|| l_output_details.serv_priced_uom);
DBMS_OUTPUT.put_line('Service Extended Amount : '
|| l_output_details.serv_ext_amount);
DBMS_OUTPUT.put_line('Service OPerand : '
|| l_output_details.serv_operand);
DBMS_OUTPUT.put_line('Service Operator : '
|| l_output_details.serv_operator);
DBMS_OUTPUT.put_line ('Status Code : ' || l_output_details.status_code);
DBMS_OUTPUT.put_line ('Status Text : ' || l_output_details.status_text);
DBMS_OUTPUT.put_line('**********************************************');
END IF;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line( l_num
|| ' Unexpected Error : '
|| SUBSTR (SQLERRM, 1, 250));
END;
No comments:
Post a Comment