Oracle Assets CIP Capitalization and Reversal 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 CIP API uses the FA_CIP_PUB.DO_CAPITALIZATION () procedure to capitalize, and the FA_CIP_PUB.DO_REVERSE () to reverse capitalize. You can use this API if you have a custom interface that makes it difficult to use with the existing Oracle Assets interfaces for adjusting assets.

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 currencies.

Related Topics

CIP Capitalization API Description

CIP Reversal API Description

Sample Script: Using the CIP Capitalization API

Sample Script: Using the CIP Reversal API

CIP Capitalization API Description

The CIP Capitalization API procedure is called: FA_CIP_PUB.DO_CAPITALIZATION ().

The following table provides the arguments, types, value, and descriptions of the elements of the FA_CIP_PUB.DO_CAPITALIZATION () 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 Basic information about the API.
P_INIT_MSG_LIST VARCHAR2 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 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.
P_CALLING_FN VARCHAR2   Function that calls the API
X_RETURN_STATUS VARCHAR2 FND_API.G_RET_STS_ SUCCESS - Indicates a success.
FND_API.G_RET_STS_ ERROR - Indicates a failed transaction.
FND_API.G_RET_STS_ UNEXP_ERROR - Indicates an unexpected error.
Determines the API success.
X_MSG_COUNT NUMBER   Number of messages on the message stack.
X_MSG_DATA FA_API_ TYPES.MSG_REC_ TYPE   The API part that stores messages which is passed to the user.
PX_TRANS_REC FA_API_ TYPES.TRANS_REC_TYPE   Describes the transaction taking place.
PX_ASSET_HDR_REC FA_API_ TYPES.ASSET_HDR_REC_TYPE   Unique identifiers for the assets.
FX_ASSET_FIN_REC FA_API_TYPES. ASSET_FIN_REC_ TYPE   Financial information for the transaction

CIP Reversal API Description

The CIP Reversal API procedure is called: FA_CIP_PUB.DO_REVERSE ().

The following table provides the arguments, types, value, and descriptions of the elements of the FA_CIP_PUB.DO_REVERSE () 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 Basic information about the API.
P_INIT_MSG_LIST VARCHAR2 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 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.
P_CALLING_FN VARCHAR2   Function that calls the API
X_RETURN_STATUS VARCHAR2 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 FA_API_TYPES.MSG_REC_TYPE   The API part that stores messages which is passed to the user.
PX_TRANS_REC FA_API_ TYPES.TRANS_REC_TYPE   Describes the transaction taking place.
PX_ASSET_HDR_REC FA_API_ TYPES.ASSET_HDR_REC_TYPE   Unique identifiers for the assets.
FX_ASSET_FIN_REC FA_API_TYPES. ASSET_FIN_REC_ TYPE   Financial information for the transaction

Standard Types Used For Capitalizations and Reversals

One of the key benefits of this API is the use of structures instead of lists of scalar parameter types. Using structures instead of scalar parameter types makes it easier for calling interfaces to pass only the information required for the adjustment transaction, and no more.

Attention: Columns that you do not enter directly, and are derived internally, can still be accessed. For example, if you wish to know the TRANSACTION_HEADER_ID (reference number) for the transaction, you can example or copy the contents of PX_TRANS_REC.TRANSACTION_HEADER_ID.

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
SOURCE_TRANSACTION_ HEADER_ID Optional NUMBER(15) Defaults to the source THID when using autocopy or CIP-IN-TAX
MASS_REFERENCE_ID Optional NUMBER(15) Defaults to CONC_REQUEST_ID.
TRANSACTION_NAME Optional VARCHAR2(20) Transaction description.
CALLING_INTERFACE Optional VARCHAR2(30) Defaults to CUSTOM
DESC_FLEX Optional DESC_FLEX_ REC_TYPE Descriptive flexfield segment
WHO_INFO Optional STANDARD_ WHO_REC_ TYPE 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 Required NUMBER(15) OUT parameter.
BOOK_TYPE_CODE Required VARCHAR2(15) Populate the book type code.

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 Required (if no invoices were populated) DATE Date the asset is placed in service.
DEPRN_METHOD_CODE Optional VARCHAR2(12) The name of the depreciation method. Defaults as per the asset category values.
LIFE_IN_MONTHS Optional NUMBER(4) Life of the asset in total months. Defaults as per the asset category values.
COST Required (if no invoices were populated) NUMBER Current cost of the asset.
ORIGINAL_COST Optional NUMBER Original cost of the asset. Defaults to cost.
SALVAGE_VALUE Optional NUMBER Asset salvage value. Defaults as per the asset category values.
PRORATE_CONVENTION_CODE Optional VARCHAR2(10) Depreciation prorate convention. Defaults as per the asset category values.
DEPRECIATE_FLAG Required   VARCHAR2(3) Indicates whether the asset is depreciating.
YES - Asset is depreciating
NO - Asset is not depreciating
ITC_AMOUNT_ID Optional NUMBER(15) Identifies the ITC rate.
BASIC_RATE Optional NUMBER Defaults as per the asset category values.
ADJUSTED_RATE Optional NUMBER Defaults as per the asset category values.
BONUS_RULE Optional NUMBER Bonus rule for an asset. Defaults as per the 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 the 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 the asset category values.
UNIT_OF_MEASURE Optional VARCHAR2(25) Unit of measure of a units of production asset. Defaults as per the 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. (CRL Asset). 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.
DEPRN_LIMIT_TYPE Optional VARCHAR2(30) Indicates how depreciation limit is determined .
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.
ALLOWED_DEPRN_LIMIT Optional NUMBER The default depreciation limit as a percentage of cost.
ALLOWED_DEPRN_LIMIT_AMOUNT Optional NUMBER Cost without regard to any revaluations.
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.

Sample Script: Using the CIP Capitalization API

The following example demonstrates the capitalization of a CIP asset. It populates the needed structures and then calls the CIP Capitalization API.

set serveroutput on

declare

   l_trans_rec FA_API_TYPES.trans_rec_type;
   l_asset_hdr_rec FA_API_TYPES.asset_hdr_rec_type;
   l_asset_fin_rec FA_API_TYPES.asset_fin_rec_type;
   l_return_status VARCHAR2(1);
   l_mesg_count number;
   l_mesg varchar2(512);

begin

    dbms_output.enable(1000000);

    FA_SRVR_MSG.Init_Server_Message;

    -- asset header info
    l_asset_hdr_rec.asset_id := &asset_id;
    l_asset_hdr_rec.book_type_code := '&book';

    -- fin info
    l_asset_fin_rec.date_placed_in_service := '&dpis';

    FA_CIP_PUB.do_capitalization(
           -- 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_asset_hdr_rec => l_asset_hdr_rec,
           px_asset_fin_rec => l_asset_fin_rec
      );

    --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));
        end if;

end;
/

Sample Script: Using the CIP Reversal API

The following example demonstrates reversing the capitalization of a CIP asset. It populates the needed structures and then calls the CIP Reversal API.

set serveroutput on

declare

    l_trans_rec FA_API_TYPES.trans_rec_type;
    l_asset_hdr_rec FA_API_TYPES.asset_hdr_rec_type;
    l_asset_fin_rec FA_API_TYPES.asset_fin_rec_type;
    l_return_status VARCHAR2(1);
    l_mesg_count number;
    l_mesg varchar2(4000);

begin

    dbms_output.enable(1000000);

    FA_SRVR_MSG.Init_Server_Message;

    -- asset header info
    l_asset_hdr_rec.asset_id := &asset_id;
    l_asset_hdr_rec.book_type_code := '&book';

    FA_CIP_PUB.do_reverse(
            -- 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_asset_hdr_rec => l_asset_hdr_rec,
            px_asset_fin_rec => l_asset_fin_rec
          );

    --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));
        end if;

end;
/