财务线下在excel核对、修改后的,物料成本及收入COA,批量修改脚本。
create global temporary table Temp_CCID(
vItemID varchar(100), --物料编码
vCostCOA varchar(100), --成本COA
vCostCCID varchar(100), --成本CCID
vSalesCOA varchar(100), --收入COA
vSalesCCID varchar(100) --收入CCID
) on commit preserve rows;
select rowid,t.vitemid,t.vcostcoa,t.vsalescoa from Temp_CCID t --将excel数据导入到该临时表中
DECLARE
l_ccid1 NUMBER; --成本
l_ccid2 NUMBER; --收入
cursor cur1
is select t.vitemid,t.vcostcoa,t.vsalescoa from Temp_CCID t;
c_item Temp_CCID.vitemid%type;
c_cost Temp_CCID.vCostCOA%type;
c_sale Temp_CCID.vSalesCOA%type;
BEGIN
open cur1;
fetch cur1 into c_item, c_cost, c_sale;
while cur1%found loop
l_ccid1 := APPS.fnd_flex_ext.get_ccid( --查找成本,科目组合对应的CCID,若无则新建
application_short_name => 'SQLGL'
,key_flex_code => 'GL#'
,structure_number => structure_number --查