|
|
|
Re: insert line in sales order by api [message #569628 is a reply to message #569231] |
Tue, 30 October 2012 07:50 |
hany_marawan
Messages: 198 Registered: April 2005 Location: Cairo - Egypt
|
Senior Member |
|
|
Hello,
I found the API and tried it, it's working very good.
for every one wants it, there's the code.
PROCEDURE ins_so_line
IS
l_api_version_number NUMBER := 1;
l_return_status VARCHAR2(2000);
l_msg_count NUMBER;
l_msg_data VARCHAR2(2000);
l_line_in_tbl oe_order_pub.line_tbl_type;
l_line_out_tbl oe_order_pub.line_tbl_type;
index_dtl number:=1;
BEGIN
mo_global.init('ONT');
MO_GLOBAL.SET_POLICY_CONTEXT('S', 81);
fnd_global.apps_initialize( 1112
,50647
,660);
l_line_in_tbl(index_dtl) := OE_ORDER_PUB.G_MISS_LINE_REC;
l_line_in_tbl(index_dtl).operation := OE_GLOBALS.G_OPR_CREATE;
l_line_in_tbl(index_dtl).header_id:=48936;
l_line_in_tbl(index_dtl).inventory_item_id := 3028;
l_line_in_tbl(index_dtl).line_type_id := 1044;
l_line_in_tbl(index_dtl).ordered_quantity := 1;
--l_line_in_tbl(index_dtl).ship_from_org_id := 162;
--l_line_in_tbl(index_dtl).tax_code := '0%';--'STANDARD RATE' ;
OE_Order_PUB.Process_Line ( p_line_tbl => l_line_in_tbl
,p_org_id => 81
,p_operating_unit => 'Al-Bardi_OU'
,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('l_return_status: '||l_return_status);
IF l_return_status IN ('E', 'U') THEN
DBMS_OUTPUT.PUT_LINE('# of Errors '||l_msg_count);
IF l_msg_count = 1 THEN
DBMS_OUTPUT.PUT_LINE('Error '||l_msg_data);
ELSE
FOR i IN 1..l_msg_count LOOP
DBMS_OUTPUT.PUT_LINE('Error '||FND_MSG_PUB.GET(i, 'F'));
END LOOP;
END IF;
END IF;
END; -- Procedure
[EDITED by LF: applied [code] tags]
[Updated on: Tue, 30 October 2012 13:03] by Moderator Report message to a moderator
|
|
|
Re: insert line in sales order by api [message #569654 is a reply to message #569628] |
Tue, 30 October 2012 13:02 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
I'm glad you found the answer and decided to share it with the rest of the community.
Please, be so kind and click here: it will not take more than several seconds of your time, but will significantly improve your future messages that contain program code.
|
|
|