各位大虾,请问如何调用OM api 中的Process Order 这个Procedure?以下为我写的:
报错为:调用Process Order时参数个数或类型错误
哪位有写过的能否贴上来看看,万分感谢。
CREATE OR REPLACE PROCEDURE KO_process_order
(
p_header_id OUT NUMBER,
p_ret_code OUT VARCHAR2,
p_ret_msg OUT VARCHAR2)
IS
x_return_status VARCHAR2(1000);
x_msg_count NUMBER(20);
x_msg_data VARCHAR2(1000);
x_header_rec oe_order_pub.header_rec_type;
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_tbl oe_order_pub.line_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;
BEGIN
x_header_rec:= OE_ORDER_PUB.G_MISS_HEADER_REC;
x_header_rec.order_type_id := 1000;
x_header_rec.sold_to_org_id := 100;
x_header_rec.price_list_id := 10;
--x_header_rec.freight_term_code := NULL;
x_header_rec.operation := OE_GLOBALS.G_OPR_CREATE;
x_line_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_REC;
x_line_tbl(1).inventory_item_id := 311;
x_line_tbl(1).ordered_quantity := 1;
x_line_tbl(1).operation := OE_GLOBALS.G_OPR_CREATE;
x_line_tbl(2) := OE_ORDER_PUB.G_MISS_LINE_REC;
x_line_tbl(2).inventory_item_id := 312;
x_line_tbl(2).ordered_quantity := 2;
x_line_tbl(2).operation := OE_GLOBALS.G_OPR_CREATE;
x_line_adj_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_ADJ_REC;
x_line_adj_tbl(1).discount_id := 1;
x_line_adj_tbl(1).percent := 5;
x_line_adj_tbl(1).operation := OE_GLOBALS.G_OPR_CREATE;
x_line_adj_tbl(1).line_index := 2;
OE_Order_PUB.Process_Order(
p_header_rec =>x_header_rec
,p_line_tbl=>x_line_tbl
,p_line_adj_tbl=>x_line_adj_tbl
,x_header_rec=>x_header_rec
,x_header_scredit_tbl=>x_header_scredit_tbl
,x_header_adj_tbl=>x_header_adj_tbl
,x_line_tbl=> x_line_tbl
,x_line_scredit_tbl=> x_line_scredit_tbl
,x_line_adj_tbl=> x_line_adj_tbl
,x_return_status=> x_return_status
,x_msg_count=> x_msg_count
,x_msg_data=> x_msg_data
);
if x_msg_count > 0 then
for x_index in 1..x_msg_count loop
x_msg_data := oe_msg_pub.get(p_msg_index => x_index, p_encoded =>'F');
end loop;
end if;
if x_return_status = FND_API.G_RET_STS_SUCCESS then
dbms_output.put_line('success');
else
dbms_output.put_line('failure');
end if;
end;