Saturday, December 28, 2024

Query to get Asset Details in Oracle Fusion

SELECT asset_number
      ,fab.asset_id
      ,fat.description
      ,fab.asset_type
      ,fcb.segment1||'-'||fcb.segment2 category
      ,fab.tag_number
      ,fb.book_type_code
      ,fabc.book_class
      ,fb.cost
      ,fb.recoverable_cost
      ,(SELECT SUM(deprn_reserve)
  FROM fa_deprn_detail
         WHERE asset_id = fab.asset_id
   AND deprn_run_date = (SELECT MAX(deprn_run_date)
   FROM fa_deprn_detail
  WHERE asset_id = fab.asset_id
) depriciation_cost
  FROM fa_additions_b fab
      ,fa_additions_tl fat
      ,fa_categories_b fcb
      ,fa_books fb
      ,fa_book_controls fabc
 WHERE 1=1
   AND fab.asset_id = fat.asset_id 
   AND fat.language = USERENV('LANG')
   AND fcb.category_id=fab.asset_category_id
   AND fb.asset_id=fab.asset_id
   AND fb.depreciate_flag = 'NO'
   AND fab.asset_number = 123456789

No comments:

Post a Comment

Query to get Parent and Child Accounts in Oracle APPS R12

SELECT ffv1.flex_value parent_account       ,ffvt1.description parent_account_desc   ,ffv2.flex_value child_account   ,ffvt2.description...