Skip to main content

Asset Addition API

High Level Steps are described below in brief for Asset Addition Through API:

1) Declare Record and Table Type Variables as below:
l_trans_rec Fa_Api_Types.trans_rec_type;
l_dist_trans_rec Fa_Api_Types.trans_rec_type;
l_asset_hdr_rec Fa_Api_Types.asset_hdr_rec_type;
l_asset_desc_rec Fa_Api_Types.asset_desc_rec_type;
l_asset_cat_rec Fa_Api_Types.asset_cat_rec_type;
l_asset_type_rec Fa_Api_Types.asset_type_rec_type;
l_asset_hierarchy_rec Fa_Api_Types.asset_hierarchy_rec_type;
l_asset_fin_rec Fa_Api_Types.asset_fin_rec_type;
l_asset_deprn_rec Fa_Api_Types.asset_deprn_rec_type;
l_asset_dist_rec Fa_Api_Types.asset_dist_rec_type;
l_asset_dist_tbl Fa_Api_Types.asset_dist_tbl_type;
l_inv_rec Fa_Api_Types.inv_rec_type;
l_inv_tbl Fa_Api_Types.inv_tbl_type;
l_inv_rate_tbl Fa_Api_Types.inv_rate_tbl_type;

2) Declare Cursor for Asset Data Staging Table

3) Open Cursor and Loop through Staging Table Records to assign values to Composite Variables

BEGIN

Fa_Srvr_Msg.Init_Server_Message;
Fa_Debug_Pkg.Initialize;
FOR rec_c_assets IN c_assets

LOOP
l_asset_desc_rec.asset_key_ccid := v_asset_key_ccid;
l_asset_desc_rec.asset_number := rec_c_assets.asset_number;
l_asset_desc_rec.manufacturer_name := rec_c_assets.manufacturer_name;
l_asset_desc_rec.serial_number := rec_c_assets.serial_number;
l_asset_desc_rec.model_number := rec_c_assets.model_number;
l_asset_desc_rec.tag_number := rec_c_assets.tag_number;
l_asset_cat_rec.category_id := v_asset_category_id;

--type info
l_asset_type_rec.asset_type := 'CAPITALIZED';

-- invoice info
l_inv_rec.fixed_assets_cost := rec_c_assets.cost;
l_inv_rec.description := 'Asset Conversion';
l_inv_rec.invoice_number:=rec_c_assets.invoice_number;
l_inv_rec.feeder_system_name := '11.5.8';
l_inv_tbl (1) := l_inv_rec;
l_asset_fin_rec.COST := rec_c_assets.cost;
l_asset_fin_rec.date_placed_in_service :=fnd_conc_date.string_to_date(rec_c_assets.date_placed_in_service);
l_asset_fin_rec.depreciate_flag := 'YES';
l_asset_fin_rec.deprn_method_code := rec_c_assets.depreciation_method;
l_asset_fin_rec.life_in_months := rec_c_assets.life_in_months;

-- deprn info
l_asset_deprn_rec.ytd_deprn := rec_c_assets.ytd_depreciation;
l_asset_deprn_rec.deprn_reserve := rec_c_assets.depreciation_reserve;

-- book / trans info
l_asset_hdr_rec.book_type_code := rec_c_assets.book_type_code;
l_trans_rec.transaction_date_entered := fnd_conc_date.string_to_date(rec_c_assets.date_placed_in_service);
l_trans_rec.who_info.last_updated_by := Fnd_Global.USER_ID;
l_trans_rec.who_info.last_update_date:= sysdate;
l_trans_rec.who_info.created_by:=Fnd_Global.USER_ID;
l_trans_rec.who_info.creation_date:= sysdate;
l_trans_rec.who_info.last_update_login:=Fnd_Global.USER_ID;

-- distribution info
l_asset_dist_rec.units_assigned := rec_c_assets.units;
l_asset_dist_rec.expense_ccid := v_expense_ccid;
l_asset_dist_rec.location_ccid := v_location_ccid;
l_asset_dist_rec.assigned_to := NULL;
l_asset_dist_rec.transaction_units := rec_c_assets.units;
l_asset_dist_tbl(1) := l_asset_dist_rec;

4) Finally Call API

Fa_Addition_Pub.do_addition
(p_api_version => 1.0,
p_init_msg_list => FND_API.G_TRUE,
p_commit => Fnd_Api.G_FALSE,
p_validation_level => Fnd_Api.G_VALID_LEVEL_FULL,
x_return_status => x_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_calling_fn => NULL,
px_trans_rec => l_trans_rec,
px_dist_trans_rec => l_dist_trans_rec,
px_asset_hdr_rec => l_asset_hdr_rec,
px_asset_desc_rec => l_asset_desc_rec,
px_asset_type_rec => l_asset_type_rec,
px_asset_cat_rec => l_asset_cat_rec,
px_asset_hierarchy_rec => l_asset_hierarchy_rec,
px_asset_fin_rec => l_asset_fin_rec,
px_asset_deprn_rec => l_asset_deprn_rec,
px_asset_dist_tbl => l_asset_dist_tbl,
px_inv_tbl => l_inv_tbl
);

END LOOP;
END

Comments

Popular posts from this blog

Create Accounting for a Payment generates errors 95333 and 95359

Create Accounting for a Payment generates errors 95333 and 95359 Error: 95333: A conversion rate does not exist to convert USD to AUD for the conversion type Corporate and conversion date 20-MAR-09 for line -25. Please use the Daily Rates form in General Ledger to enter a conversion rate for these currencies, conversion date and conversion type. 95359: There is no accounted amount for the subledger journal entry line. Please inform your system administrator or support representative that: The source assigned to the accounting attribute Accounted Amount has no value for extract line number 88547. Please make sure the source assigned to the accounting attribute Accounted Amount has a valid value, or assign a different source to this accounting attribute. Solution: 1. Specify a conversion rate for the currencies and conversion date mentioned in the error message 95333 Navigation under the General Ledger responsibility: Setup > Currencies > Currency Rates Manager > Daily Rates ...

Public API’s for FA Transactions

Public API’s for FA Transactions So far Oracle FA is have all the good things except the lack on reporting.Oracle FA is now offer lot of public API's that can be used to interfacing with third party or Oracle application other modules. Here are some of transaction's API's:   Additions API if you have requirement to add assets directly via PL/SQL then use  FA_ADDITION_PUB.DO_ADDITION. If you have selected the Allow CIP Assets check box on the Book Controls window of a tax book when adding CIP assets using the Additions API, the this API automatically adds those CIP assets to that tax book at the same time that they are added to the corporate book. Adjustments API you can make cost adjustments to your assetsdirectly via PL/SQL using  FA_ADJUSTMENT_PUB.DO_ADJUSTMENT  for any  process adjustment. Detail can be found in appendix H) You can use this API if you have a custom interface that makes it difficult to use with the existing Oracle Assets interfaces for adjusti...

AP Table Relation Oracle Apps

AP Table Relation Oracle Apps ORACLE PAYABLE TABLE RELATION Source Table Dependent Table Condition AP_INVOICE_LINES_ALL AIL ZX_LINES_SUMMARY ZLS AIL.invoice_id = ZLS.trx_id and  ZLS.application_id  = 200 and  ZLS.entity_code  = 'AP_INVOICES' and  ZLS.event_class_code  in ('STANDARD INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS') and  AIL.summary_tax_line_id = ZLS.summary_tax_line_id AP_INVOICE_LINES_ALL AIL ZX_LINES ZL AIL.invoice_id = ZL.trx_id and  ZL.application_id  = 200 and  ZL.entity_code  = 'AP_INVOICES' and  ZL.event_class_code  in ('STANDARD INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS') and  AIL.line_number = ZL.trx_line_number AP_INVOICE_DISTRIBUTIONS_ALL AID ZX_REC_NREC_DIST ZD AID.invoice_id = ZD.trx_id and  ZD.application_id  = 200 and  ZD.entity_code  = 'AP_INVOICES' and  ZD.event_class_code  in ('STANDARD INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS') and...