获取ccid的标准方法

根据科目组合以及分类账等信息获取ccid,同时得到是否运行前台数据等信息。

FUNCTION get_code_combination_id(p_concatenated_segments IN VARCHAR2,
                                   p_chart_of_accounts_id  IN NUMBER,
                                   x_posting_allowed_flag  OUT VARCHAR2)
    RETURN NUMBER IS
    l_code_combination_id NUMBER NULL;
  BEGIN
    l_code_combination_id := apps.fnd_flex_ext.get_ccid(application_short_name => 'SQLGL',
                                                        key_flex_code          => 'GL#',
                                                        structure_number       => p_chart_of_accounts_id,
                                                        validation_date        => to_char(SYSDATE,
                                                                                          apps.fnd_flex_ext.date_format),
                                                        concatenated_segments  => p_concatenated_segments);
    BEGIN
      SELECT t.detail_posting_allowed
        INTO x_posting_allowed_flag
        FROM gl_code_combinations_kfv t
       WHERE t.code_combination_id = l_code_combination_id;
    EXCEPTION
      WHEN OTHERS THEN
        x_posting_allowed_flag := 'N';
    END;
    RETURN nvl(l_code_combination_id, -1);
  EXCEPTION
 
    WHEN OTHERS THEN
      IF fnd_flex_keyval.validate_segs(operation        => 'CREATE_COMBINATION',
                                       appl_short_name  => 'SQLGL',
                                       key_flex_code    => 'GL#',
                                       structure_number => p_chart_of_accounts_id,
                                       concat_segments  => p_concatenated_segments) THEN
        l_code_combination_id := fnd_flex_ext.get_ccid('SQLGL',
                                                       'GL#',
                                                       p_chart_of_accounts_id,
                                                       to_char(SYSDATE,
                                                               'YYYY-MM-DD'),
                                                       p_concatenated_segments);
        BEGIN
          SELECT t.detail_posting_allowed
            INTO x_posting_allowed_flag
            FROM gl_code_combinations_kfv t
           WHERE t.code_combination_id = l_code_combination_id;
        EXCEPTION
          WHEN OTHERS THEN
            x_posting_allowed_flag := 'N';
        END;
      ELSE
        l_code_combination_id  := -1;
        x_posting_allowed_flag := 'N';
      END IF;
      RETURN l_code_combination_id;
  END get_code_combination_id;


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值