新浪博客

OracleAssetsCommonInvoiceTransferAPI资产创建发票API

2026-03-17 17:14阅读:
Oracle Assets Common Invoice Transfer API 资产创建发票API
Common Invoice Transfer API Description
The Common Invoice Transfer API procedure is called the FA_INV_XFR_PUB.DO_TRANSFER () procedure. The following table provides the arguments, types, value, and descriptions of the elements of the FA_INV_XFR_PUB.DO_TRANSFER () procedure.
Each argument has a prefix of P, X, or PX. These prefixes mean the following:
P - indicates an In argument
X - indicates an Out argument
PX - indicates an argument that is both In and Out
Using the Invoice Transfer API
示例
set serveroutput on
declare
-- source
l_src_trans_rec FA_API_TYPES.trans_rec_type;
l_src_asset_hdr_rec FA_API_TYPES.asset_hdr_rec_type;
l_inv_tbl FA_API_TYPES.inv_tbl_type;
l_inv_rec FA_API_TYPES.inv_rec_type;
-- destination
l_dest_trans_rec FA_API_TYPES.trans_rec_type;
l_dest_asset_hdr_rec FA_API_TYPES.asset_hdr_rec_type;
l_return_status varchar2(1);
l_mesg_count number;
l_mesg varchar2(4000);
begin
dbms_output.enable(10000000);
FA_SRVR_MSG.Init_Server_Message;
-- get source / destination info
l_src_asset_hdr_rec.book_type_code := '&book';
l_dest_asset_hdr_rec.book_type_code := l_src_asset_hdr_rec.book_type_code;
l_src_asset_hdr_rec.asset_id := &source_asset_id
l_dest_asset_hdr_rec.asset_id := &destination_asset_id
-- get transaction_info
l_src_trans_rec.transaction_subtype := '&src_transaction_subtype';
l_dest_trans_rec.transaction_subtype := '&dest_transaction_subtype';
l_src_trans_rec.transaction_date_entered := '&src_transaction_date';
l_dest_trans_rec.transaction_date_entered := '&dest_transaction_date';

-- invoice info - source
l_inv_rec.source_line_id := &source_line_id
l_inv_rec.fixed_assets_cost := &delta_cost_to_transfer
-- set up the table for source
l_inv_tbl (1) := l_inv_rec;
-- call for source
FA_INV_XFR_PUB.do_transfer(
-- std parameters
p_api_version => 1.0,
p_init_msg_list => FND_API.G_FALSE,
p_commit => FND_API.G_FALSE,
p_validation_level => FND_API.G_VALID_LEVEL_FULL,
p_calling_fn => NULL,
x_return_status => l_return_status,
x_msg_count => l_mesg_count,
x_msg_data => l_mesg,
-- api parameters
px_src_trans_rec => l_src_trans_rec,
px_src_asset_hdr_rec => l_src_asset_hdr_rec,
px_dest_trans_rec => l_dest_trans_rec,
px_dest_asset_hdr_rec => l_dest_asset_hdr_rec,
p_inv_tbl => l_inv_tbl
);
--dump messages
l_mesg_count := fnd_msg_pub.count_msg;
if l_mesg_count > 0 then
l_mesg := chr(10) || substr(fnd_msg_pub.get
(fnd_msg_pub.G_FIRST, fnd_api.G_FALSE),
1, 250);
dbms_output.put_line(l_mesg);
for i in 1..(l_mesg_count - 1) loop
l_mesg :=
substr(fnd_msg_pub.get
(fnd_msg_pub.G_NEXT,
fnd_api.G_FALSE), 1, 250);
dbms_output.put_line(l_mesg);
end loop;
fnd_msg_pub.delete_msg();
end if;
if (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
rollback;
dbms_output.put_line('FAILURE');
else
dbms_output.put_line('SUCCESS');
dbms_output.put_line('THID_SRC' || to_char(l_src_trans_rec.transaction_header_id));
dbms_output.put_line('THID_DEST' || to_char(l_dest_trans_rec.transaction_header_id));
end if;
end;
/
-- 刘轶鹤

我的更多文章

下载客户端阅读体验更佳

APP专享