EBS :从表 fnd_flex_values_vl 获取账户描述.sql

其中公司段、公司段、等对应的FLEX_VALUE_SET_ID 值得自己查询。

 

select he.order_number,
       he.order_date,
       ve.vendor_name,
       ve.vendor_number,
       ve.contact_name,
       ve.telephone,
       he.description hedescription,
       li.line_number,
       ite.item_number,
       ite.item_name,
       li.quantity,
       li.unit_price,
       li.quantity * li.unit_price,
       gccb.SEGMENT1 || '-' || gccb.SEGMENT2 || '-' || gccb.SEGMENT3 || '-' ||
       gccb.SEGMENT4 || '-' || gccb.SEGMENT5 segment, --费用账号
       ffvl1.Description || '.' || ffvl2.Description || '.' ||
       ffvl3.Description || '.' || ffvl4.Description || '.' ||
       ffvl5.Description accDESCRIPTION, --账号描述
       li.description lidescription
  from trn_order_headers_4040 he,
       trn_order_lines_4040   li,
       trn_vendors_4040       ve,
       trn_items_4040         ite,
       gl_code_combinations   gccb,
       fnd_flex_values_vl     ffvl1,
       fnd_flex_values_vl     ffvl2,
       fnd_flex_values_vl     ffvl3,
       fnd_flex_values_vl     ffvl4,
       fnd_flex_values_vl     ffvl5

 where he.header_id = li.header_id
   and he.vendor_id = ve.vendor_id
   and li.item_id = ite.item_id
   and gccb.code_combination_id = li.expense_account_id
   And (ffvl1.flex_value = gccb.segment1 And
       ffvl1.FLEX_VALUE_SET_ID = '1002470') -- 公司段
   And (ffvl2.flex_value = gccb.segment2 And
       ffvl2.FLEX_VALUE_SET_ID = '1002471') -- 部门段
   And (ffvl3.flex_value = gccb.segment3 And
       ffvl3.FLEX_VALUE_SET_ID = '1002472') -- 科目段
   And (ffvl4.flex_value = gccb.segment4 And
       ffvl4.FLEX_VALUE_SET_ID = '1002473') -- 子科目段
   And (ffvl5.flex_value = gccb.segment5 And
       ffvl5.FLEX_VALUE_SET_ID = '1002474') -- 公司间段
     
   and he.order_number = :p_order_number
   and he.order_date between
       nvl(to_date(:P_DATE_FROM, 'RRRR/MM/DD HH24:MI:SS'), He.ORDER_DATE) and
       nvl(to_date(:P_DATE_TO, 'RRRR/MM/DD HH24:MI:SS'), He.ORDER_DATE)
 order by li.line_number;

转载于:https://www.cnblogs.com/CiWEi-/archive/2011/12/21/2295465.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值