R12中通过primary ledger 的CCID取得相对应的secondary ledger的CCID
--get ledger mapping id
BEGIN
SELECT coa_mapping_id
INTO vl_mapping_id
FROM gl_coa_mappings
WHERE NAME = vgc_mapping_name
AND rownum = 1;
END;
--Clear temp table
BEGIN
DELETE gl_accts_map_int_gt;
END;
--Insert R12 CCID
BEGIN
INSERT INTO gl_accts_map_int_gt
(from_ccid, coa_mapping_id)
VALUES
(pi_ccid, vl_mapping_id);
END;
-- call API
gl_accounts_map_grp.map(mapping_name => vgc_mapping_name,
create_ccid => TRUE,
debug => NULL);
COMMIT;
--get secondary ledger ccid
BEGIN
SELECT to_ccid INTO vl_convert_ccid FROM gl_accts_map_int_gt;
END;
--return ccid
RETURN vl_convert_ccid;
BEGIN
SELECT coa_mapping_id
INTO vl_mapping_id
FROM gl_coa_mappings
WHERE NAME = vgc_mapping_name
AND rownum = 1;
END;
--Clear temp table
BEGIN
DELETE gl_accts_map_int_gt;
END;
--Insert R12 CCID
BEGIN
INSERT INTO gl_accts_map_int_gt
(from_ccid, coa_mapping_id)
VALUES
(pi_ccid, vl_mapping_id);
END;
-- call API
gl_accounts_map_grp.map(mapping_name => vgc_mapping_name,
create_ccid => TRUE,
debug => NULL);
COMMIT;
--get secondary ledger ccid
BEGIN
SELECT to_ccid INTO vl_convert_ccid FROM gl_accts_map_int_gt;
END;
--return ccid
RETURN vl_convert_ccid;
成长
/ | \
学习 总结 分享
QQ交流群:122230156