Oracle Cloud offers a broad portfolio of software as a service applications, platform as a service, and social capabilities, all on a subscription basis. Oracle Cloud delivers instant value and productivity for end users, administrators, and developers alike through functionally rich, integrated, secure, enterprise cloud services.
 Get a Free Magzine ...Profit:The Executive's Guide to Oracle Applications

Subscribe to the OracleAppsHub to receive notifications when there are new posts:

 get RSS feed
 Oracle Fusion Applications (OFA) is a portfolio of next generation suite of software applications from Oracle Corporation. It is distributed across various product families; including financial management, human capital management, customer relationship management, supply chain management, procurement, governance, and project portfolio management
 Get a Free Magzine ...Profit:The Executive's Guide to Oracle Applications

Asset Reclass Programmatically

Posted on December 4th, 2010 by Sanjit Anand |Print This Post Print This Post |Email This Post Email This Post

Have you tried OracleappsHub in ipad/iphone/smart Phone? Don't wait. try it today

Last article you have seen some insight functionlity for Fixed asset Reclass functionality and Business need.

Majority of time whenever there is merger/acquisitions or Instance consolidation exercise reclassification plays an important role specially when you as project team not allow any new category . Mapping all assets and aligning with Parent's company existing Category is major challenge depending volume of assets. The more challenge come to IT when you did not find right fitment for Mass reclassification native screen to cater the requirement quickly thus Reclass via API's Programmatically is good options indeed.

dgreybarrow API availability for Reclass

You can use Reclass API that uses the FA_RECLASS_PUB.DO_RECLASS procedure

You can achieve

  • This API can also be used to automatically reclassify assets in all the tax books that are associated with the corporate book where the reclassification originated.
  • You can automatically reclassify assets to all of the reporting books when MRC is enabled and without generating any rounding issues.

Let take a quick look the API details and Usage part.

dgreybarrow API Usage

Use this script :

  1.  
  2.  
  3. l_count NUMBER;
  4. l_return_status VARCHAR2(100);
  5. l_msg_count NUMBER:= 0;
  6. l_msg_data VARCHAR2(4000);
  7. l_request_id NUMBER;
  8. reclass_err EXCEPTION;
  9. temp_str VARCHAR2(640);
  10. i NUMBER := 0;
  11. l_api_version CONSTANT NUMBER := 1.0;
  12. l_msg_list VARCHAR2(5) := FND_API.G_FALSE;
  13. l_commit_flag VARCHAR2(5) := FND_API.G_FALSE;
  14. l_validation_level VARCHAR2(5) := FND_API.G_VALID_LEVEL_FULL;
  15. l_debug_flag VARCHAR2(5) := FND_API.G_FALSE;
  16. l_calling_fn VARCHAR2(20) := 'Reclass Script';
  17. l_trans_rec FA_API_TYPES.trans_rec_type;
  18. l_asset_hdr_rec FA_API_TYPES.asset_hdr_rec_type;
  19. l_asset_cat_rec_new FA_API_TYPES.asset_cat_rec_type;
  20. l_recl_opt_rec FA_API_TYPES.reclass_options_rec_type;
  21.  
  22.  
  23. ---- fetch and pass the asset id for asset which you want to reclassify
  24.  
  25. l_asset_id NUMBER := TO_NUMBER(<asset_id>);
  26.  
  27. ---- fetch and pass the target category id for asset which you want to reclassify
  28.  
  29. l_category_id NUMBER := TO_NUMBER('<new_category_id>');
  30. -- select the options YES or NO and flag depending upon how you want to copy the DFF's
  31.  
  32. l_copy_desc_flag VARCHAR2(3) := UPPER(SUBSTR('copy_category_desc_YES_NO',1,3));
  33. l_redefault_flag VARCHAR2(3) := UPPER(SUBSTR('redef_deprn_rule_YES_NO',1,3));
  34.  
  35. DBMS_OUTPUT.disable;
  36. DBMS_OUTPUT.enable(1000000);
  37. DBMS_OUTPUT.put_line('------***begin*****------');
  38. fa_srvr_msg.init_server_message;
  39. fa_debug_pkg.set_debug_flag(debug_flag => 'YES');
  40. DBMS_OUTPUT.put_line('.');
  41.  
  42. -- Get standard who info...use APP INITIALIZATION
  43.  
  44. l_request_id := fnd_global.conc_request_id;
  45. fnd_profile.get('LOGIN_ID', l_trans_rec.who_info.last_update_login);
  46. fnd_profile.get('USER_ID', l_trans_rec.who_info.last_updated_by);
  47.  
  48. IF (l_trans_rec.who_info.last_updated_by IS NULL) THEN
  49. l_trans_rec.who_info.last_updated_by := -1;
  50. IF (l_trans_rec.who_info.last_update_login IS NULL) THEN
  51. l_trans_rec.who_info.last_update_login := -1;
  52.  
  53. l_trans_rec.who_info.last_update_date := SYSDATE;
  54. l_trans_rec.who_info.creation_date := l_trans_rec.who_info.last_update_date;
  55. l_trans_rec.who_info.created_by := l_trans_rec.who_info.last_updated_by;
  56. l_asset_hdr_rec.asset_id := l_asset_id;
  57. l_asset_cat_rec_new.category_id := l_category_id;
  58. l_recl_opt_rec.copy_cat_desc_flag := l_copy_desc_flag;
  59. l_recl_opt_rec.redefault_flag := l_redefault_flag;
  60.  
  61. DBMS_OUTPUT.put_line('calling FA_RECLASS_PUB.do_reclass');
  62.  
  63. FA_RECLASS_PUB.do_reclass (
  64. -- std parameters
  65. p_api_version => l_api_version,
  66. p_init_msg_list => l_msg_list,
  67. p_commit => l_commit_flag,
  68. p_validation_level => l_validation_level,
  69. p_calling_fn => l_calling_fn,
  70. x_return_status => l_return_status,
  71. x_msg_count => l_msg_count,
  72. x_msg_data => l_msg_data,
  73. -- api parameters
  74. px_trans_rec => l_trans_rec,
  75. px_asset_hdr_rec => l_asset_hdr_rec,
  76. px_asset_cat_rec_new => l_asset_cat_rec_new,
  77. p_recl_opt_rec => l_recl_opt_rec );
  78.  
  79. DBMS_OUTPUT.put_line('l_return_status '||l_return_status);
  80.  
  81. IF l_return_status = 'E' THEN l_msg_count := fnd_msg_pub.count_msg;
  82.  
  83. IF (l_msg_count > 0) THEN
  84.  
  85. DBMS_OUTPUT.put_line('l_msg_count '||to_char(l_msg_count));
  86.  
  87. temp_str := SUBSTR(fnd_msg_pub.get(fnd_msg_pub.G_FIRST, fnd_api.G_FALSE), 1, 230);
  88.  
  89. DBMS_OUTPUT.put_line(temp_str);
  90.  
  91. temp_str:= NULL;
  92.  
  93. FOR I IN 1..(l_msg_count -1) LOOP
  94. temp_str := fnd_msg_pub.get(fnd_msg_pub.G_NEXT, fnd_api.G_FALSE);
  95. DBMS_OUTPUT.put_line(temp_str);
  96.  
  97.  
  98. DBMS_OUTPUT.put_line('dump: NO MESSAGE !');
  99.  
  100.  
  101.  
  102. fa_srvr_msg.add_message
  103. ( calling_fn => 'TOAD SCRIPT',
  104. name => 'FA_SHARED_END_SUCCESS',
  105. token1 => 'PROGRAM',
  106. value1 => 'FA_RECLASS_PUB.do_reclass');
  107. WHEN reclass_err THEN
  108. fa_srvr_msg.add_message(
  109. calling_fn => 'TOAD SCRIPT',
  110. name => 'FA_SHARED_PROGRAM_FAILED',
  111. token1 => 'PROGRAM',
  112. value1 => 'FA_RECLASS_PUB.do_reclass');
  113.  
  114. l_msg_count := fnd_msg_pub.count_msg;
  115. IF (l_msg_count > 0) THEN
  116. temp_str := fnd_msg_pub.get(fnd_msg_pub.G_FIRST, fnd_api.G_FALSE);
  117. DBMS_OUTPUT.put_line('dump: ' || temp_str);
  118. FOR I IN 1..(l_msg_count -1) LOOP
  119. temp_str := fnd_msg_pub.get(fnd_msg_pub.G_NEXT, fnd_api.G_FALSE);
  120. DBMS_OUTPUT.put_line('dump: ' || temp_str);
  121. DBMS_OUTPUT.put_line('dump: NO MESSAGE !');
  122.  

Related Posts

Posted in API Integration, Oracle Asset | No Comments »Email This Post Email This Post | Print This Post Print This Post

Have you tried OracleappsHub in ipad/iphone/smart Phone? Don't wait. try it today
Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.