Oracle Assets Additions API

This appendix covers the following topics:

Introduction

You can use this API if you have a custom interface that makes it difficult to use with the existing interfaces in Oracle Assets. The Additions API uses the FA_ADDITION_PUB.DO_ADDITION procedure. You can use this API if you have a custom interface that makes it difficult to use with the existing asset additions interfaces in Oracle Assets.

Oracle Assets also allows you to add assets using any of the following methods:

Alternate Ledger Currency

If you have set up alternate ledger currency , when you add or modify assets using an Oracle Assets API, the API copies the transactions to the reporting currencies automatically. Invoice rounding issues are avoided by using the API to drive the alternate ledger currency accounting for both the ledger and reporting currenices.

CIP Assets

If you have checked the Allow CIP Assets check box on the Book Controls window of a tax book, when you add CIP assets using the Additions API, the API automatically adds those CIP assets to that tax book at the same time that they are added to the corporate book.

Passing Null Values

You must pass special values in order to null the values of BONUS_RULE, CEILING_NAME, or GROUP_ASSET_ID. If you pass a NULL value directly for these values, the API will automatically default to the value setup for the category. The following table shows the value that must be passed for the field value to be NULL.

Field Value to Pass for NULL Field
BONUS_RULE FND_API.G_MISS_CHAR
CEILING_NAME FND_API.G_MISS_CHAR
GROUP_ASSET_ID FND_API.G_MISS_NUM

Related Topics

Additions API Description

Sample Script: Using the Additions API via Invoices

Sample Script: Using the Additions API with No Invoices

Additions API Description

The Additions API procedure is called: FA_ADDITION_PUB.DO_ADDITION ().

The following table provides the arguments, types, value, and descriptions of the elements of the FA_ADDITION_PUB.DO_ADDITION procedure.

Each argument has a prefix of P, X, or PX. These prefixes mean the following:

Argument Type Value Description
P_API_VERSION NUMBER Internal use only Version of the API in use.
P_INIT_MSG_LIST VARCHAR2(1) FND_API.G_TRUE - Initialize the message stack.
FND_API.G_FALSE - Do not initialize the message stack (Default).
Determines whether the messages stack should be initialized and cleared.
P_COMMIT VARCHAR2(1) FND_API.G_TRUE - Commit automatically.
FND_API.G_FALSE - Do not commit automatically (Default)
Commits the transaction.
P_VALIDATION_LEVEL NUMBER FND_API.G_VALID_ LEVEL_NONE - Low level validation for a transaction.
FND_API.G_VALID_ LEVEL_FULL - High level validation for a transaction (Default).
Asset validation by the API.
X_RETURN_STATUS VARCHAR2(1) FND_API.G_RET_STS_ SUCCESS - Addition successful.
FND_API.G_RET_STS_ ERROR - Addition fails.
FND_API.G_RET_STS_ UNEXP_ERROR - Unexpected error.
Determines the API success.
X_MSG_COUNT NUMBER   Number of messages on the message stack.
X_MSG_DATA VARCHAR2(1024)   Message stack.
P_CALLING_FN VARCHAR2(30)   Function that calls the API.
PX_TRANS_REC FA_API_TYPES. TRANS_REC_TYPE   Transaction description.
PX_DIST_TRANS_REC FA_API_TYPES. DIST_TRANS_REC_ TYPE   Transaction distribution description.
PX_ASSET_HDR_REC FA_API_TYPES. ASSET_HDR_REC_ TYPE   Unique identifiers for the assets.
PX_ASSET_DESC_REC FA_API_TYPES. ASSET_DESC_REC_ TYPE   Description of the asset.
PX_ASSET_TYPE_REC FA_API_TYPES. ASSET_TYPE_REC_ TYPE   Asset type of the asset.
PX_ASSET_CAT_REC FA_API_TYPES. ASSET_CAT_REC_ TYPE   Category information of the asset.
PX_ASSET_HIERARCHY_REC FA_API_TYPES. ASSET_HIERARCHY_REC_TYPE   Hierarchy information of the asset.
PX_ASSET_FIN_REC FA_API_TYPES. ASSET_FIN_REC_ TYPE   Financial information of the asset.
PX_ASSET_DEPRN_REC FA_API_TYPES. ASSET_DEPRN_ REC_TYPE   Depreciation information of the asset.
PX_ASSET_DIST_TBL FA_API_TYPES. ASSET_DIST_TBL_ TYPE   Distribution information of the asset.
PX_INV_TBL FA_API_TYPES. INV_TBL_TYPE   Invoices for the asset.

TRANS_REC_TYPE Transaction Structure

The TRANS_REC_TYPE transaction structure contains information about the transaction, such as the transaction header ID and the transaction type code. The following table shows type and value information for each argument.

Argument Required / Optional Type Value
TRANSACTION_HEADER_ID Internal use only NUMBER(15) Optional OUT parameter
TRANSACTION_DATE_ENTERED Optional DATE Defaults to the date placed in service.
TRANSACTION_NAME Optional VARCHAR2(20) Description of the transaction.
MASS_REFERENCE_ID Optional NUMBER(15) Identifies the concurrent request that invokes the mass transaction.
TRANSACTION_SUBTYPE Optional   VARCHAR2(9) AMORTIZED - Amortize NBV addition.
NULL - Regular addition.
AMORTIZATION_START_ DATE Optional DATE Amortization start date
CALLING_INTERFACE Optional VARCHAR2(30) Defaults to CUSTOM
DESC_FLEX Optional DESC_FLEX_REC Descriptive flexfield segment
WHO_INFO Required STANDARD_ WHO_REC Standard Who columns

ASSET_HDR_REC_TYPE Asset Structure

The ASSET_HDR_REC_TYPE asset structure contains unique identification information for a given asset, such as the asset ID and book type code. The following table shows type and value information for each argument.

Argument Required / Optional Type Value
ASSET_ID Internal use only for addition to Corporate book. Required for addition to tax book for asset already existing in Corporate book. For a tax addition, the TRANS_REC_TYPE and the ASSET_HDR_REC_TYPE attributes are needed. The values in structures such as ASSET_DESC_REC_TYPE, ASSET_FIN_REC_TYPE, ASSET_TYPE_REC_TYPE, ASSET_CAT_REC_TYPE, etc., defaults from the Corporate book. NUMBER(15) IN / OUT parameter.
BOOK_TYPE_CODE Required VARCHAR2(15) Book name

ASSET_DESC_REC_TYPE Asset Structure

The ASSET_DESC_REC_TYPE asset structure contains descriptive information about the asset, such as the tag number, serial number, and manufacturer name. The following table shows type and value information for each argument.

Argument Required / Optional Type Value
ASSET_NUMBER Optional VARCHAR2(15) Defaults to asset_id. Optional OUT parameter.
DESCRIPTION Required VARCHAR2(80) Description of the asset.
TAG_NUMBER Optional VARCHAR2(15) Tag number of the asset.
SERIAL_NUMBER Optional VARCHAR2(35) Serial number of the asset.
ASSET_KEY_CCID Optional NUMBER(15) Identifies an asset key flexfield combination for the asset.
PARENT_ASSET_ID Optional NUMBER(15) Identifies a parent asset for subcomponents.
STATUS Optional VARCHAR2(150) Describes the status of the asset. (CRL Assets only)
MANUFACTURER_NAME Optional VARCHAR2(30) Name of the manufacturer.
MODEL_NUMBER Optional VARCHAR2(40) Model number of the asset.
WARRANTY_ID Optional NUMBER(15) Warranty identification number.
LEASE_ID Optional NUMBER(15) Lease identification number.
IN_USE_FLAG Optional VARCHAR2(3) Indicates if the asset is in use.
YES - In use (default).
NO - Not in use.
INVENTORIAL Optional VARCHAR2(3) Defaults to asset category.
YES - To include in physical inventory
NO - Do not include in physical inventory.
PROPERTY_TYPE_CODE Optional VARCHAR2(10) Indicates the property type. Defaults to asset category.
PROPERTY_1245_1250_CODE Optional VARCHAR2(4) 1245 - Personal
1250 - Real.
Defaults to asset category.
OWNED_LEASED Optional VARCHAR2(15) OWNED - Owned (Default).
LEASED - Leased
Defaults to asset category.
NEW_USED Optional VARCHAR2(4) NEW - New (Default)
USED - Used
CURRENT_UNITS Required NUMBER Current number of units for the asset.
LEASE_DESC_FLEX Optional DESC_FLEX_ REC_TYPE Lease descriptive flexfield segments.
GLOBAL_DESC_FLEX Optional DESC_FLEX_ REC_TYPE Global descriptive flexfield segments.
COMMITMENT Optional VARCHAR2(150) Current financial burdens recorded against the asset, such as existing mortgages or pre-notices of mortgages.
INVESTMENT_LAW Optional VARCHAR2(150) Incentives available to businesses, depending on the region and the nature of the investor’s business. The current incentives are direct subsidy, interest subsidy, leasing subsidy, and tax exemption.

ASSET_TYPE_REC_TYPE Asset Structure

The ASSET_TYPE_REC_TYPE asset structure contains information about the asset type: CIP, capitalized, or expensed. The following table shows type and value information for each argument.

Argument Required / Optional Type Value
ASSET_TYPE Required VARCHAR2(15) CAPITALIZED - Capitalized asset (default).
CIP - CIP asset
EXPENSED - Expensed asset
Group - Group asset.

ASSET_CAT_REC_TYPE Asset Structure

The ASSET_CAT_REC_TYPE asset structure contains information about the asset category, such as the category ID and the category descriptive flexfield. The following table shows type and value information for each argument.

Argument Required / Optional Type Value
CATEGORY_ID Required NUMBER(15) Category identifier.
CATEGORY_DESC_FLEX Optional DESC_FLEX_ REC_TYPE Category descriptive flexfield segments.

ASSET_HIERARCHY_REC_TYPE Asset Structure

The ASSET_HIERARCHY_REC_TYPE asset structure contains information about whether the asset belongs to an asset hierarchy. This asset structure applies only to CRL Assets. The following table shows type and value information for each argument.

Argument Required / Optional Type Value
PARENT_HIERARCHY_ID Optional NUMBER(15) Identifies the hierarchy the asset belongs to. (CRL assets)

ASSET_FIN_REC_TYPE Asset Structure

The ASSET_FIN_REC_TYPE asset structure contains financial information for a given asset. The following table shows type and value information for each argument.

Argument Required / Optional Type Value
DATE_PLACED_IN_SERVICE Optional DATE Date the asset is placed in service. Defaults to the current period close date for corporate and corporate cost for tax additions.
DEPRN_METHOD_CODE Optional VARCHAR2(12) The name of the depreciation method. Defaults as per asset category values.
LIFE_IN_MONTHS Optional NUMBER(4) Life of the asset in total months. Defaults as per asset category values.
COST Optional (if no invoices were populated) NUMBER Current cost of the asset. Defaults to 0 for cost and corporate cost for tax additions
ORIGINAL_COST Optional NUMBER Original cost of the asset. Defaults to cost.
SALVAGE_VALUE Optional NUMBER Asset salvage value. Defaults as per asset category values.
PRORATE_CONVENTION_CODE Optional VARCHAR2(10) Depreciation prorate convention. Defaults as per asset category values.
DEPRECIATE_FLAG Optional VARCHAR2(3) Indicates whether the asset is depreciating.
YES - Asset is depreciating.
NO - Asset is not depreciating.
Defaults as per asset category values.
ITC_AMOUNT_ID Optional NUMBER(15) Identifies the ITC rate.
BASIC_RATE Optional NUMBER Defaults as per asset category values.
ADJUSTED_RATE Optional NUMBER Defaults as per asset category values.
BONUS_RULE Optional NUMBER Bonus rule for an asset. Defaults as per asset category values. If a default value is defined, and you want the value to be NULL, you must pass FND_API.G_MISS_CHAR to the Addition API.
CEILING_NAME Optional VARCHAR2(30) Identifies a deprecation ceiling to be used in calculating deprecation. Defaults as per asset category values.. If a default value is defined, and you want the value to be NULL, you must pass FND_API.G_MISS_CHAR to the Addition API.
PRODUCTION_CAPACITY Optional NUMBER Capacity of a units of production asset. Defaults as per asset category values.
UNIT_OF_MEASURE Optional VARCHAR2(25) Unit of measure of a units of production asset. Defaults as per asset category values.
REVAL_CEILING Optional NUMBER Upper limit for revaluing asset cost.
UNREVALUED_COST Optional NUMBER Cost without regard to any revaluation.
SHORT_FISCAL_YEAR_ FLAG Optional   VARCHAR2(3) YES - Asset is in a short fiscal year.
NO - Asset is not in a short fiscal year.
CONVERSION_DATE Optional DATE Date short tax year asset added to the acquiring company.
ORIG_DEPRN_START_DATE Optional DATE Date short tax year asset begin depreciating in the acquired company's books.
GROUP_ASSET_ID Optional NUMBER(15) Group asset identification number. If a default value is defined, and you want the value to be NULL, you must pass FND_API.G_MISS_NUM to the Addition API.
GLOBAL_ATTRIBUTE1-20 Optional VARCHAR2(150) Reserved for country specific functionality.
GLOBAL_ATTRIBUTE_ CATEGORY Optional VARCHAR2(30) Reserved for country specific functionality.
DISABLED_FLAG Optional VARCHAR2(1) Indicates whether the group asset is disabled.
Y - Group asset is disabled.
N - Group asset is enabled.
Defaults to N.
SALVAGE_TYPE Optional VARCHAR2(30) Indicates the way to determine salvage value:
AMT - Manually enter the salvage value manually (Not available for group asset).
PCT - PERCENT_SALVAGE_VALUE field determines the Salvage value.
SUM - Salvage value is determined by sum of member asset’s salvage value amount (available only for group asset).
Defaults to PCT for group assets. For non-group assets defaults ti percent if percent default is defined in category, else defaults to AMT.
DEPRN_LIMIT_TYPE Optional VARCHAR2(30) Indicates how depreciation limit is determined. Defaults as per asset category values.
AMT - Manually enter the depreciation limit amount manually (Not available for group asset).
PCT - ALLOWED_DEPRN_LIMIT field determines the depreciation limit amount.
SUM - Depreciation limit amount is determined using sum of member asset’s depreciation limit amount (available only for group asset).
NONE - Depreciation limit is not used.
Defaults to PCT for group assets.
OVER_DEPRECIATE_OPTION Optional VARCHAR2(30) Indicates whether group asset should stop depreciating beyond its depreciation limit (recoverable cost if there is no depreciation limit defined).
NO - Stop depreciating when the depreciation reserve reaches its depreciation limit.
YES - Stop depreciating if depreciation reserve reaches its depreciation limit because of an increase in depreciation expense.
DEPRN - Group asset will not stop depreciating.
Defaults to NO.
SUPER_GROUP_ID Optional NUMBER Super group rule identification number.
REDUCTION_RATE Optional NUMBER Relevant for depreciable basis rule that is assigned to a depreciation method which uses reduction rate.
REDUCE_ADDITION_FLAG Optional VARCHAR2(1) Indicates whether reduction rate should be applied for member asset additions. This value is relevant for group assets only.
Y - Reduction rate is used for member asset additions.
N - Reduction rate is not used for member asset additions.
Defaults to N.
REDUCE_ADJUSTMENT_FLAG Optional VARCHAR2(1) Indicates whether reduction rate should be applied for member asset adjustments. This value is relevant for group assets only.
Y - Reduction rate is used for member asset adjustments.
N - Reduction rate is not used for member asset adjustments.
Defaults to N.
REDUCE_RETIREMENT_FLAG Optional VARCHAR2(1) Indicates whether reduction rate should be applied for member asset retirements. This value is relevant only with group asset.
Y - Reduction rate is used for member asset retirements.
N - Reduction rate is not used for member asset retirements.
Defaults to N.
RECOGNIZE_GAIN_LOSS Optional VARCHAR2(30) Indicates whether a member asset retirement should result in recognizing gain and loss amount.
YES - Recognize gain and loss amount.
NO - Do not recognize gain and loss amount.
Defaults to NO.
RECAPTURE_RESERVE_FLAG Optional VARCHAR2(1) Defaults to N.
LIMIT_PROCEEDS_FLAG Optional VARCHAR2(1) Defaults to N.
TERMINAL_GAIN_LOSS Optional VARCHAR2(30) Indicates whether to recognize gain and loss when the last member asset in a group asset is retired out of the group.
YES - Recognize gain and loss amount.
NO - Not recognizing gain and loss amount
END_OF_YEAR - Different recognition of gain and loss amount until the end of current fiscal year.
Defaults to YES.
TRACKING_METHOD Optional VARCHAR2(30) Member assets tracking option value.
ALLOCATE - Allocate group depreciation amount across it’s member assets.
CALCULATE - Uses member assets depreciation instead of group asset’s depreciation.
Defaults to null.
EXCESS_ALLOCATION_OPTION Optional VARCHAR2(30) Indicates whether excess from allocation of group depreciation expense across its member assets is reduced from group depreciation expense or reallocated to its member assets.
DISTRIBUTE - Reallocate the excess depreciation expense to its member assets.
REDUCE - Reduce the excess from group depreciation expense.
DEPRECIATION_OPTION Optional VARCHAR2(30) Indicates whether member asset’s depreciation expense is calculated using group or member asset depreciation information.
GROUP - Use group asset depreciation information to calculate member asset depreciation expense.
MEMBER - Use member asset depreciation information to calculate member asset depreciation expense.
Defaults to GROUP if TRACKING_METHOD is CALCULATE, otherwise defaults to null.
MEMBER_ROLLUP_FLAG Optional VARCHAR2(1) Indicates whether group asset depreciation amount is sum of member asset depreciation amount. This value is relevant if TRACKING_METHOD is CALCULATE and the value is not Y if RECOGNIZE_GAIN_LOSS or TERMINAL_GAIN_LOSS is NO.
Y - Sum member asset depreciation amount to group.
N - Group depreciation amount is calculated using the group asset information.
Defaults to N if TRACKING_METHOD is CALCULATE, otherwise defaults to null.
ALLOCATE_TO_FULLY_RSV_FLAG Optional VARCHAR2(1) Indicates whether to allocate group asset’s depreciation amount to a reserved member asset.
Y - Group depreciation expense is allocated to a reserved member assets.
N - Group depreciation expense is not allocated to fully reserved member assets.
Defaults to N if TRACKING_METHOD is ALLOCATE, otherwise defaults to null.

The following are relevant to group assets:

REDUCTION_RATE is for group and member assets.

ASSET_DEPRN_REC_TYPE Asset Structure

The ASSET_DEPRN_REC_TYPE asset structure contains depreciation information for a given asset. The following table shows type and value information for each argument.

Argument Required / Optional Type Value
YTD_DEPRN Optional NUMBER Year-to-date depreciation expense.
DEPRN_RESERVE Optional NUMBER Total depreciation taken since the beginning of the asset's life.
REVAL_DEPRN_RESERVE Optional NUMBER Period when an asset is revalued: The value is the change in net book value due to revaluation of asset cost, and sometimes the revaluation of depreciation reserve also. For other periods: the value is the revaluation reserve amount after running the depreciation.

ASSET_DIST_REC_TYPE Asset Structure

The ASSET_DIST_REC_TYPE asset structure contains information that represents a single source or destination distribution line. All the ASSET_DIST_REC_TYPE records comprising a single transfer transaction are contained in the ASSET_DIST_TBL_TYPE table. At least one source line and at least one destination line are required for each transfer transaction. The following table shows type and value information for each argument.

Argument Required / Optional Type Value
UNITS_ASSIGNED Required NUMBER Number of units assigned to the distribution.
ASSIGNED_TO Optional NUMBER(15) Employee identification number.
EXPENSE_CCID Required NUMBER(15) Depreciation expense account identification number.
LOCATION_CCID Required NUMBER(15) Location flexfield identification number.

INV_REC_TYPE Invoice Structure

The INV_REC_TYPE invoice structure contains invoice information for a single invoice associated with an asset. The INV_TBL_TYPE is a table of INV_REC_TYPE records. These records contain all invoices that have been applied to the asset. The following table shows type and value information for each argument.

Argument Required / Optional Type Value
FIXED_ASSETS_COST Optional (when the record is populated) NUMBER Cost of asset in Oracle Assets.
PO_VENDOR_ID Optional NUMBER(15) Supplier identification number.
PO_NUMBER Optional VARCHAR2(20) Purchase order number.
INVOICE_NUMBER Optional VARCHAR2(50) Invoice number.
PAYABLES_BATCH_NAME Optional VARCHAR2(50) Payables batch name in the invoice
PAYABLES_CODE_ COMBINATION_ID Optional NUMBER(15) Clearing account number which is posted in accounts payable.
FEEDER_SYSTEM_NAME Optional VARCHAR2(40) Name of the feeder system that creates the FA_MASS_ADDITIONS row.
CREATE_BATCH_DATE Optional DATE Mass additions batch date when creating this row.
CREATE_BATCH_ID Optional NUMBER(15) Mass additions create request identification number for this row.
INVOICE_DATE Optional DATE Invoice date from accounts payable.
PAYABLES_COST Optional NUMBER Invoice cost from accounts payable.
POST_BATCH_ID Optional NUMBER(15) Mass Additions Post request identification number for this row.
INVOICE_ID Optional NUMBER(15) Invoice identification number.
AP_DISTRIBUTION_LINE_ NUMBER Optional NUMBER(15) Distribution line identification number.
PAYABLES_UNITS Optional NUMBER Units from AP_INVOICE_DISTRIBUTIONS row.
DESCRIPTION Optional VARCHAR2(80) Invoice line description.
DELETED_FLAG Optional VARCHAR2(3) Indicates whether this row is deleted in the CIP Adjustments form. Defaults to NO, which it should be for all addition transactions.
PROJECT_ASSET_LINE_ID Optional NUMBER(15) Identifier of the summarized asset cost line transferred from Oracle Projects to create this line.
PROJECT_ID Optional NUMBER(15) Identifier of the project from which the costs are collected, summarized, and transferred from Oracle Projects.
TASK_ID Optional NUMBER(15) Identifier of the task from which costs are collected, summarized, and transferred from Oracle Projects. This column is populated only if the costs were summarized by task.
ATTRIBUTE1 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE2 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE3 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE4 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE5 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE6 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE7 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE8 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE9 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE10 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE11 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE12 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE13 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE14 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE15 Optional VARCHAR2(150) Descriptive flexfield segment.
ATTRIBUTE_CATEGORY_ CODE Optional VARCHAR2(30) Descriptive flexfield structure defining column.
YTD_DEPRN Optional NUMBER Year-to-date deprecation expense.
DEPRN_RESERVE Optional NUMBER Total deprecation taken since beginning of asset life.
BONUS_YTD_DEPRN Optional NUMBER Bonus year-to-date depreciation expense.
BONUS_DEPRN_RESERVE Optional NUMBER Total bonus depreciation taken since beginning of asset life.
REVAL_AMORTIZATION_ BASIS Optional NUMBER Revaluation reserve for calculating the amortization of a revaluation reserve. This value is updated when the asset is revalued or has an amortized adjustment.
REVAL_YTD_DEPRN Optional NUMBER Year-to-date deprecation expense due to revaluation.
REVAL_DEPRN_RESERVE Optional NUMBER For the period when the asset is revalued, it is change in net book value due to revaluation of asset cost and sometimes revaluation of depreciation reserve. For other periods it is revaluation reserve amount after depreciation run.
INVOICE_DISTRIBUTION_ID Optional VARCHAR2(1) Invoice distribution identifier.
INVOICE_LINE_NUMBER Optional VARCHAR2(30) Invoice line number.
PO_DISTRIBUTION_ID Optional VARCHAR2(30) Purchase order distribution identifier.
INV_RATE_TBL Optional INV_RATE_REC_TYPE If using an alternate ledger currency, you may optionally provide either rates or converted amounts directly for each ledger through this member.

INV_RATE_REC_TYPE Invoice Rate Structure

The INV_RATE_REC_TYPE invoice structure contains rate information for an invoice. Each INV_RATE_REC_TYPE record contains one conversion rate. The INV_RATE_TBL_TYPE is a table of INV_RATE_REC_TYPE records. This table is used by alternative ledger currencies to determine the conversion rates for an asset. The following table shows type and value information for each argument.

Argument Required / Optional Type Value
SET_OF_BOOKS_ID Required - When using alternative ledger currency. NUMBER(15) Ledger identification number.
EXCHANGE_RATE Optional (required if cost is not specified) NUMBER Exchange rate for the currency.
COST Optional (required if EXCHANGE_RATE is not specified) Number Provide converted cost directly rather than an exchange rate.

Sample Script: Using the Additions API via Invoices

The following sample script shows how you can use the Additions API via invoices:

set serveroutput on

declare

   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_tbl                  FA_API_TYPES.inv_tbl_type;
   l_inv_rate_tbl             FA_API_TYPES.inv_rate_tbl_type;
   l_inv_rec                  FA_API_TYPES.inv_rec_type;

   l_return_status            VARCHAR2(1);          
   l_mesg_count               number;
   l_mesg                     varchar2(4000);

begin

   dbms_output.enable(10000000);

   FA_SRVR_MSG.Init_Server_Message;

   -- desc info
   l_asset_desc_rec.description               := '&description';

   -- cat info
   l_asset_cat_rec.category_id                := &category_id

   --type info
   l_asset_type_rec.asset_type                := '&ASSET_TYPE';

   -- invoice info
   l_inv_rec.fixed_assets_cost                := 2500;
   l_inv_rec.deleted_flag                     := 'NO';
   l_inv_rec.description                      := l_asset_desc_rec.description;
   l_inv_rec.unrevalued_cost                  := 5555;
   l_inv_rec.create_batch_id                  := 1000;
   l_inv_rec.payables_code_combination_id     := 13528;
   l_inv_rec.feeder_system_name               := 'ACK';
   l_inv_rec.payables_cost                    := 5555;
   l_inv_rec.payables_units                   := 1;
   l_inv_rec.po_vendor_id                     := 1;
   l_inv_rec.inv_indicator                    := 1;

   l_inv_tbl (1)                              := l_inv_rec;

   -- fin info
   l_asset_fin_rec.date_placed_in_service     := '&DPIS';
   l_asset_fin_rec.depreciate_flag            := 'YES';


   -- book / trans info
   l_asset_hdr_rec.book_type_code             := '&book';

   -- distribution info 
   l_asset_dist_rec.units_assigned            := 1;
   l_asset_dist_rec.expense_ccid              := &ccid
   l_asset_dist_rec.location_ccid             := &location_id
   l_asset_dist_rec.assigned_to               := null;
   l_asset_dist_rec.transaction_units         := l_asset_dist_rec.units_assigned;
   l_asset_dist_tbl(1)                        := l_asset_dist_rec;

   -- call the api
   fa_addition_pub.do_addition(
           -- std parameters
           p_api_version             => 1.0,
           p_init_msg_list           => FND_API.G_FALSE,
           p_commit                  => FND_API.G_FALSE,
           p_validation_level        => FND_API.G_VALID_LEVEL_FULL,
           p_calling_fn              => null,
           x_return_status           => l_return_status,
           x_msg_count               => l_mesg_count,
           x_msg_data                => l_mesg,
           -- api parameters
           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
          );
 
   dbms_output.put_line(l_return_status);

   --dump messages
   l_mesg_count := fnd_msg_pub.count_msg;

   if l_mesg_count > 0 then

      l_mesg := chr(10) || substr(fnd_msg_pub.get
                                    (fnd_msg_pub.G_FIRST, fnd_api.G_FALSE),
                                     1, 250);
      dbms_output.put_line(l_mesg);

      for i in 1..(l_mesg_count - 1) loop
         l_mesg :=
                     substr(fnd_msg_pub.get
                            (fnd_msg_pub.G_NEXT,
                             fnd_api.G_FALSE), 1, 250);

         dbms_output.put_line(l_mesg);
      end loop;

      fnd_msg_pub.delete_msg();

   end if;


   if (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
     dbms_output.put_line('FAILURE');
   else
     dbms_output.put_line('SUCCESS');
     dbms_output.put_line('THID' || to_char(l_trans_rec.transaction_header_id));
     dbms_output.put_line('ASSET_ID' || to_char(l_asset_hdr_rec.asset_id));
     dbms_output.put_line('ASSET_NUMBER' || l_asset_desc_rec.asset_number);
   end if;

end;
/

Sample Script: Using the Additions API with No Invoices

The following sample script shows how you can use the Additions API to test a manual change, when no invoice information is used:

set serveroutput on

declare

   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_tbl                  FA_API_TYPES.inv_tbl_type;
   l_inv_rate_tbl             FA_API_TYPES.inv_rate_tbl_type;

   l_return_status            VARCHAR2(1);     
   l_mesg_count               number;
   l_mesg                     varchar2(4000);

begin

   dbms_output.enable(10000000);

   FA_SRVR_MSG.Init_Server_Message;

   -- desc info
   l_asset_desc_rec.description                  := '&description';
   l_asset_desc_rec.asset_key_ccid               := null;

   -- cat info 
   l_asset_cat_rec.category_id                   := &category_id

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

   -- fin info
   l_asset_fin_rec.cost                          := &cost
   l_asset_fin_rec.date_placed_in_service        := '&DPIS';
   l_asset_fin_rec.depreciate_flag               := 'YES';

   -- deprn info
   l_asset_deprn_rec.ytd_deprn                   := &ytd
   l_asset_deprn_rec.deprn_reserve               := &reserve
   l_asset_deprn_rec.bonus_ytd_deprn             := 0;
   l_asset_deprn_rec.bonus_deprn_reserve         := 0;

   -- book / trans info
   l_asset_hdr_rec.book_type_code                := '&book';

   -- distribution info
   l_asset_dist_rec.units_assigned               := 1;
   l_asset_dist_rec.expense_ccid                 := &ccid
   l_asset_dist_rec.location_ccid                := &location_id
   l_asset_dist_rec.assigned_to                  := null;
   l_asset_dist_rec.transaction_units            := l_asset_dist_rec.units_assigned;
   l_asset_dist_tbl(1)                           := l_asset_dist_rec;

   -- call the api 
   fa_addition_pub.do_addition(
           -- std parameters
           p_api_version             => 1.0,
           p_init_msg_list           => FND_API.G_FALSE,
           p_commit                  => FND_API.G_FALSE,
           p_validation_level        => FND_API.G_VALID_LEVEL_FULL,
           p_calling_fn              => null,
           x_return_status           => l_return_status,
           x_msg_count               => l_mesg_count,
           x_msg_data                => l_mesg,
           -- api parameters
           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
          );

   --dump messages
   l_mesg_count := fnd_msg_pub.count_msg;

   if l_mesg_count > 0 then

      l_mesg := chr(10) || substr(fnd_msg_pub.get
                                    (fnd_msg_pub.G_FIRST, fnd_api.G_FALSE),
                                     1, 250);
      dbms_output.put_line(l_mesg);

      for i in 1..(l_mesg_count - 1) loop
         l_mesg :=
                     substr(fnd_msg_pub.get
                            (fnd_msg_pub.G_NEXT,
                             fnd_api.G_FALSE), 1, 250);

         dbms_output.put_line(l_mesg);
      end loop;

      fnd_msg_pub.delete_msg();

   end if;

   if (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
     dbms_output.put_line('FAILURE');
   else
     dbms_output.put_line('SUCCESS');
     dbms_output.put_line('THID' || to_char(l_trans_rec.transaction_header_id));
     dbms_output.put_line('ASSET_ID' || to_char(l_asset_hdr_rec.asset_id));
     dbms_output.put_line('ASSET_NUMBER' || l_asset_desc_rec.asset_number);
   end if;

end;
/

Sample Script: Using the Additions API via Invoices with Alternative Ledger Currency

set serveroutput on

declare

   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_tbl                  FA_API_TYPES.inv_tbl_type;
   l_inv_rate_tbl             FA_API_TYPES.inv_rate_tbl_type;
   l_inv_rec                  FA_API_TYPES.inv_rec_type;

   l_return_status            VARCHAR2(1);          
   l_mesg_count               number;
   l_mesg                     varchar2(4000);

begin

   dbms_output.enable(10000000);

   FA_SRVR_MSG.Init_Server_Message;

   -- desc info
   l_asset_desc_rec.description               := '&description';

   -- cat info
   l_asset_cat_rec.category_id                := &category_id

   --type info
   l_asset_type_rec.asset_type                := '&ASSET_TYPE';

   -- invoice info
   l_inv_rec.fixed_assets_cost                := 2500;
   l_inv_rec.deleted_flag                     := 'NO';
   l_inv_rec.description                      := l_asset_desc_rec.description;
   l_inv_rec.unrevalued_cost                  := 5555;
   l_inv_rec.create_batch_id                  := 1000;
   l_inv_rec.payables_code_combination_id     := 13528;
   l_inv_rec.feeder_system_name               := 'ACK';
   l_inv_rec.payables_cost                    := 5555;
   l_inv_rec.payables_units                   := 1;
   l_inv_rec.po_vendor_id                     := 1;
   l_inv_rec.inv_indicator                    := 1;

   l_inv_tbl (1)                              := l_inv_rec;

   -- rate info
   l_inv_rec.inv_rate_tbl(1).set_of_books_id  := 102;
   l_inv_rec.inv_rate_tbl(1).exchange_rate    := 2;
   l_inv_rec.inv_rate_tbl(1).cost             := 2001;

   -- fin info
   l_asset_fin_rec.date_placed_in_service     := '&DPIS';
   l_asset_fin_rec.depreciate_flag            := 'YES';


   -- book / trans info
   l_asset_hdr_rec.book_type_code             := '&book';

   -- distribution info 
   l_asset_dist_rec.units_assigned            := 1;
   l_asset_dist_rec.expense_ccid              := &ccid
   l_asset_dist_rec.location_ccid             := &location_id
   l_asset_dist_rec.assigned_to               := null;
   l_asset_dist_rec.transaction_units         := l_asset_dist_rec.units_assigned;
   l_asset_dist_tbl(1)                        := l_asset_dist_rec;

   -- call the api
   fa_addition_pub.do_addition(
           -- std parameters
           p_api_version             => 1.0,
           p_init_msg_list           => FND_API.G_FALSE,
           p_commit                  => FND_API.G_FALSE,
           p_validation_level        => FND_API.G_VALID_LEVEL_FULL,
           p_calling_fn              => null,
           x_return_status           => l_return_status,
           x_msg_count               => l_mesg_count,
           x_msg_data                => l_mesg,
           -- api parameters
           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
          );
 
   dbms_output.put_line(l_return_status);

   --dump messages
   l_mesg_count := fnd_msg_pub.count_msg;

   if l_mesg_count > 0 then

      l_mesg := chr(10) || substr(fnd_msg_pub.get
                                    (fnd_msg_pub.G_FIRST, fnd_api.G_FALSE),
                                     1, 250);
      dbms_output.put_line(l_mesg);

      for i in 1..(l_mesg_count - 1) loop
         l_mesg :=
                     substr(fnd_msg_pub.get
                            (fnd_msg_pub.G_NEXT,
                             fnd_api.G_FALSE), 1, 250);

         dbms_output.put_line(l_mesg);
      end loop;

      fnd_msg_pub.delete_msg();

   end if;


   if (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
     dbms_output.put_line('FAILURE');
   else
     dbms_output.put_line('SUCCESS');
     dbms_output.put_line('THID' || to_char(l_trans_rec.transaction_header_id));
     dbms_output.put_line('ASSET_ID' || to_char(l_asset_hdr_rec.asset_id));
     dbms_output.put_line('ASSET_NUMBER' || l_asset_desc_rec.asset_number);
   end if;

end;
/