使用Oe_Order_Pub.process_order更新SO数量失败,但更新承诺日期却可成功

[复制链接]
查看11 | 回复2 | 2011-8-8 09:30:40 | 显示全部楼层 |阅读模式
大家好!现在需要使用API Oe_Order_Pub.process_order来更新SO行的数量和承诺日期,发现更新承诺日期可以成功,但更新数量时就失败了,哪位高手可以指点一下?非常感谢!!
代码如下:
CREATE OR REPLACE PROCEDURE update_line_ssd(p_line_id IN NUMBER,

p_org_id IN NUMBER,

p_ssd IN Date/*,

p_qty IN number*/

)
Is
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_return_status VARCHAR2(1000);
l_msg_count NUMBER;
l_msg_dataVARCHAR2(1000);
x_header_val_recOe_Order_Pub.header_val_rec_type;
x_header_adj_tblOe_Order_Pub.header_adj_tbl_type;
x_header_adj_val_tblOe_Order_Pub.header_adj_val_tbl_type;
x_header_price_att_tblOe_Order_Pub.header_price_att_tbl_type;
x_header_adj_att_tblOe_Order_Pub.header_adj_att_tbl_type;
x_header_adj_assoc_tblOe_Order_Pub.header_adj_assoc_tbl_type;
x_header_scredit_tblOe_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_tblOe_Order_Pub.line_adj_val_tbl_type;
x_line_price_att_tblOe_Order_Pub.line_price_att_tbl_type;
x_line_adj_att_tblOe_Order_Pub.line_adj_att_tbl_type;
x_line_adj_assoc_tblOe_Order_Pub.line_adj_assoc_tbl_type;
x_line_scredit_tblOe_Order_Pub.line_scredit_tbl_type;
x_line_scredit_val_tblOe_Order_Pub.line_scredit_val_tbl_type;
x_lot_serial_tblOe_Order_Pub.lot_serial_tbl_type;
x_lot_serial_val_tblOe_Order_Pub.lot_serial_val_tbl_type;
Begin
Oe_Msg_Pub.initialize;
Oe_Debug_Pub.initialize;
Oe_Debug_Pub.debug_on;
Oe_Debug_Pub.setdebuglevel(5);
DBMS_APPLICATION_INFO.set_client_info(p_org_id);
l_line_tbl(1) := Oe_Order_Pub.g_miss_line_rec;
l_line_tbl(1).line_id := p_line_id;
l_line_tbl(1).promise_date := p_ssd;
-- l_line_tbl(1).ORDERED_QUANTITY := p_qty;
l_line_tbl(1).operation := Oe_Globals.g_opr_update;
Oe_Order_Pub.process_order
(p_api_version_number => 1.0,
p_init_msg_list => Fnd_Api.g_false,
p_return_values => Fnd_Api.g_false,
p_action_commit => Fnd_Api.g_false,
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,
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
);
IF l_msg_count > 0
THEN
FOR l_index IN 1 .. l_msg_count
LOOP
l_msg_data :=
Oe_Msg_Pub.get(p_msg_index => l_index,

p_encoded => 'F');
END LOOP;
END IF;
If l_return_status = Fnd_Api.g_ret_sts_success
Then
dbms_output.put_line('Update is Sucess');
Else
dbms_output.put_line('Update is False');
End If;
Exception
When Others Then
Null;
End;
回复

使用道具 举报

千问 | 2011-8-8 09:30:40 | 显示全部楼层
我将代码改成如下,运行时报错:程序包 OE_Line_Security 过程 Attributes 中出现错误 ORA-01403: 未找到数据
代码:
CREATE OR REPLACE PROCEDURE update_line_quantity(p_header_idIN NUMBER,

p_line_id IN NUMBER,

--p_org_id IN NUMBER,

--p_ssd IN Date,

p_qty IN number

)
Is
l_header_rec oe_order_pub.header_rec_type;
l_line_tbl oe_order_pub.line_tbl_type;
l_line_adj_tbl oe_order_pub.line_adj_tbl_type;
l_Header_Scredit_tbl oe_order_pub.Header_Scredit_Tbl_Type;
--OUT var
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;
--RETURN msg var.
x_return_status VARCHAR2(20) := NULL;
x_msg_count NUMBER := NULL;
x_msg_data VARCHAR2(255) := NULL;
line_i BINARY_INTEGER := 1;
i BINARY_INTEGER := 1;
BEGIN
FND_GLOBAL.APPS_INITIALIZE(13615,75058,300);
-- SETTING UP THE HEADER RECORD
-- Initialize record to missing
-- FIRST LINE RECORD
-- Initialize record to missing
l_line_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_REC;
-- Line attributes
l_line_tbl(1).header_id := p_header_id;
l_line_tbl(1).line_id := p_line_id;
l_line_tbl(1).ordered_quantity := p_qty;
l_line_tbl(1).change_reason := 'NOT PROVIDED';
l_line_tbl(1).operation := OE_GLOBALS.G_OPR_UPDATE;
--l_line_tbl(1).operation := 'CREATE';
/*-- SECOND LINE RECORD
-- Initialize record to missing
l_line_tbl(2) := OE_ORDER_PUB.G_MISS_LINE_REC;
-- Line attributes
l_line_tbl(2).header_id := 2293504;
l_line_tbl(2).line_id := 32915559;
l_line_tbl(2).ordered_quantity := 22;
l_line_tbl(2).operation := OE_GLOBALS.G_OPR_UPDATE;*/
-- CALL TO PROCESS ORDER
oe_order_pub.process_order(p_api_version_number => 1,
p_init_msg_list => NULL,
p_return_values => NULL,
-- Passing just the entity records that are a part of this order
-- p_header_rec => l_header_rec,
p_line_tbl => l_line_tbl,
-- p_line_adj_tbl => l_line_adj_tbl,
-- p_Header_Scredit_tbl => l_Header_Scredit_tbl,
-- OUT variables
x_header_rec => x_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 => x_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 => x_action_request_tbl,
--RETURN MSG
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data);
-- Retrieve messages
if x_msg_count > 0 THEN
--oe_msg_pub.Initialize;
for l_index in 1..x_msg_count loop
x_msg_data := oe_msg_pub.get(p_msg_index => l_index, p_encoded => 'F');
DBMS_OUTPUT.put_line(x_msg_data);
end loop;
oe_msg_pub.Initialize;
end if;
-- Check the return status
if x_return_status = FND_API.G_RET_STS_SUCCESS then
--success;
COMMIT;
DBMS_OUTPUT.put_line('success');
else
--failure;
ROLLBACK;
DBMS_OUTPUT.put_line('failure');
end if;
End;
回复

使用道具 举报

千问 | 2011-8-8 09:30:40 | 显示全部楼层
我再将修改代码如下,提示: 登记订单行需要 价目表价格。但我在画面上是可以成功修改数量的. 郁闷中......
CREATE OR REPLACE PROCEDURE update_line_quantity(--p_header_idIN NUMBER,

p_line_id IN NUMBER,--727203

--p_org_id IN NUMBER,

--p_ssd IN Date,

p_qty IN number --100

)
Is
l_header_rec oe_order_pub.header_rec_type;
l_line_tbl oe_order_pub.line_tbl_type;
l_line_adj_tbl oe_order_pub.line_adj_tbl_type;
l_Header_Scredit_tbl oe_order_pub.Header_Scredit_Tbl_Type;
p_Line_Price_Att_tbl oe_order_pub.p_Line_Price_Att_tbl
--OUT var
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;
--RETURN msg var.
x_return_status VARCHAR2(20) := NULL;
x_msg_count NUMBER := NULL;
x_msg_data VARCHAR2(255) := NULL;
line_i BINARY_INTEGER := 1;
i BINARY_INTEGER := 1;
BEGIN

FND_GLOBAL.APPS_INITIALIZE(13615,75058,300);
DBMS_APPLICATION_INFO.set_client_info(166);
l_line_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_REC;
l_line_tbl(1).ordered_quantity := p_qty;
l_line_tbl(1).line_id := p_line_id;
l_line_tbl(1).change_reason := 'NOT PROVIDED';
l_line_tbl(1).PRICE_LIST_ID := 7019;
l_line_tbl(1).UNIT_LIST_PRICE := 1;
l_line_tbl(1).unit_selling_price := 1;
l_line_tbl(1).operation := OE_GLOBALS.G_OPR_UPDATE;
-- CALL TO PROCESS ORDER
oe_order_pub.process_order(p_api_version_number => 1,
p_init_msg_list => NULL,
p_return_values => NULL,
-- Passing just the entity records that are a part of this order
-- p_header_rec => l_header_rec,
p_line_tbl => l_line_tbl,
-- p_line_adj_tbl => l_line_adj_tbl,
-- p_Header_Scredit_tbl => l_Header_Scredit_tbl,
-- OUT variables
x_header_rec => x_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 => x_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 => x_action_request_tbl,
--RETURN MSG
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data);
-- Retrieve messages
if x_msg_count > 0 THEN
--oe_msg_pub.Initialize;
for l_index in 1..x_msg_count loop
x_msg_data := oe_msg_pub.get(p_msg_index => l_index, p_encoded => 'F');
DBMS_OUTPUT.put_line(x_msg_data);
end loop;
oe_msg_pub.Initialize;
end if;
-- Check the return status
if x_return_status = FND_API.G_RET_STS_SUCCESS then
--success;
COMMIT;
DBMS_OUTPUT.put_line('success');
else
--failure;
ROLLBACK;
DBMS_OUTPUT.put_line('failure');
end if;
End;
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行