Oracle EBS 总账科目类型

FUNCTION get_acc_type(p_sob_id IN NUMBER, p_account_code IN VARCHAR2)
    RETURN VARCHAR2 IS
    l_acc_type VARCHAR2(1);
  BEGIN
    SELECT substr(ffvl.compiled_value_attributes, -1)
      INTO l_acc_type
      FROM gl_sets_of_books          sob,
           fnd_id_flex_structures_vl fifstv,
           fnd_id_flex_segments      fifsg,
           fnd_flex_values_vl        ffvl
     WHERE sob.chart_of_accounts_id = fifstv.id_flex_num
       AND fifsg.id_flex_code = fifstv.id_flex_code
       AND fifsg.id_flex_num = fifstv.id_flex_num
       AND fifsg.application_id = fifstv.application_id
       AND ffvl.flex_value_set_id = fifsg.flex_value_set_id
       AND sob.set_of_books_id = p_sob_id --帐套
       AND fifsg.application_column_name = 'SEGMENT3'
       AND ffvl.flex_value = p_account_code; --科目账户
    RETURN l_acc_type;
  EXCEPTION
    WHEN OTHERS THEN
      log_msg('get_acc_type error:' || SQLCODE || substr(SQLERRM, 1, 200));
      RAISE fnd_api.g_exc_error;
  END get_acc_type;

 

  --A 资产
  --L 负债
  --O 所有权/股东权利/资金余额
  --R 收入
  --E 费用
posted @ 2012-12-13 11:40  carlo-z  阅读(6468)  评论(0编辑  收藏  举报