Oracle Assets Rollback Depreciation 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 Rollback Depreciation API restores assets to their state prior to running depreciation. The Rollback Depreciation API is called internally when there is a need to rollback depreciation if you have outstanding adjustments or transaction that you need to process for a period for which depreciation has run. However, in some cases you can manually rollback or rerun a depreciation due to a direct change in the embedded formula. Additionally, Subledger Accounting inter-product dependencies insure a need to for tighter integration during rollback of depreciation and the overhead in event processing and accounting impacts due to a blind rollback are expensive and should be avoided if possible.

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

Rollback Depreciation API Description

Sample Script: Using the Depreciation Rollback API

Rollback Depreciation API Description

The Rollback Depreciation API procedure is called the FA_DEPRN_ROLLBACK_PUB.DO_ROLLBACK () procedure. The following table provides the arguments, types, value, and descriptions of the elements of the FA_DEPRN_ROLLBACK_PUB.DO_ROLLBACK () 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_MESG_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 - Indicates a successful transaction.
FND_API.G_RET_STS_ ERROR - Indicates a failed transaction.
FND_API.G_RET_STS_ UNEXP_ERROR - Indicates an unexpected error.
Determines if the API is successful.
X_MSG_COUNT NUMBER   Number of messages on the message stack.
X_MSG_DATA VARCHAR2(1024)   Message stack.
P_CALLING_FN VARCHAR2(30)   Function calling the API
P_CALLING_FN VARCHAR2(30)   Function calling the API
PX_ASSET_HDR_REC FA_API_TYPES. ASSET_HDR_REC_TYPE   Unique identifiers for the assets.

ASSET_HDR_REC 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) Optional OUT parameter
BOOK_TYPE_CODE Required VARCHAR2(15) Book name.

Sample Script: Using the Depreciation Rollback API

set serveroutput on 

declare

   l_asset_hdr_rec            fa_api_types.asset_hdr_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';

   --call the api
   FA_DEPRN_ROLLBACK_PUB.do_rollback
      (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,
       px_asset_hdr_rec           => l_asset_hdr_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');
   end if;

end;
/