使用以下两函数就可以不需要外关联 GL_CODE_COMBINATIONS 表来组合科目代码值或科目描述。
已知科目组合ID(CCID),查询科目组合值
-- 已知科目组合ID返回 科目组合值,如: 108.0.140321.0.0.0.0.0.0 select fnd_flex_ext.get_segs(application_short_name =>'SQLGL', -- IN VARCHAR2, key_flex_code =>'GL#', -- IN VARCHAR2, structure_number =>50368, -- IN NUMBER, -- CHART_OF_ACCOUNT_ID combination_id =>2568265 -- IN NUMBER -- code_Combination_id ) AS CONCATENATED_SEGMENTS from dual; -- 返回
108.0.140321.0.0.0.0.0.0'
-- 已知科目组合,返回 科目组合ID(CODE_COMBINATION_ID) select fnd_flex_ext.get_ccid(application_short_name =>'SQLGL', -- IN VARCHAR2,; key_flex_code =>'GL#', -- IN VARCHAR2,; structure_number =>50368, -- IN NUMBER, -- CHART_OF_ACCOUNT_ID ; validation_date =>'2012/01/01 01:01:01', -- IN VARCHAR2, 验证日期,其格式为:YYYY/MM/DD HH24:MI:SS;一般为科目启用的日期起,或者空值; concatenated_segments =>'108.0.140321.0.0.0.0.0.0' -- IN VARCHAR2; ) AS CODE_COMBINATION_ID FROM DUAL; -- 返回
-- 2568265
另一个获取科目组合值的函数
SELECT FA_RX_FLEX_PKG.get_value( p_application_id => 101,-- in number, p_id_flex_code =>'GL#', -- in varchar2, p_id_flex_num =>50368, -- in number default NULL, -- CHART_OF_ACCOUNT_ID p_qualifier => 'ALL', --in varchar2, p_ccid =>2568265 --in number -- code_Combination_id ) AS "物料" -- 会科:108.0.140321.0.0.0.0.0.0 FROM DUAL ;
以上两个函数
标签:flex,组合,--,0.0,EBS,ID,科目 From: https://www.cnblogs.com/samrv/p/16767935.html