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 ||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 :

declare

l_count 		NUMBER;
l_return_status 	VARCHAR2(100);
l_msg_count 		NUMBER:= 0;
l_msg_data 		VARCHAR2(4000);
l_request_id 		NUMBER;
reclass_err 		EXCEPTION;
temp_str 		VARCHAR2(640);
i NUMBER		:= 0;
l_api_version 		CONSTANT number := 1.0;
l_msg_list 		VARCHAR2(5) := FND_API.G_FALSE;
l_commit_flag 		VARCHAR2(5) := FND_API.G_FALSE;
l_validation_level 	VARCHAR2(5) := FND_API.G_VALID_LEVEL_FULL;
l_debug_flag 		VARCHAR2(5) := FND_API.G_FALSE;
l_calling_fn 		VARCHAR2(20) := 'Reclass Script';
l_trans_rec 		FA_API_TYPES.trans_rec_type;
l_asset_hdr_rec 	FA_API_TYPES.asset_hdr_rec_type;
l_asset_cat_rec_new 	FA_API_TYPES.asset_cat_rec_type;
l_recl_opt_rec 		FA_API_TYPES.reclass_options_rec_type;


---- fetch and pass the asset id for asset which you want to reclassify

l_asset_id 		NUMBER := to_number();  

---- fetch and pass the target category id for asset which you want to reclassify

l_category_id 		NUMBER := to_number('');
-- select the options YES or NO  and flag depending upon how you want to copy the DFF's

l_copy_desc_flag 	VARCHAR2(3) := UPPER(substr('copy_category_desc_YES_NO',1,3));
l_redefault_flag 	VARCHAR2(3) := UPPER(substr('redef_deprn_rule_YES_NO',1,3));

begin
dbms_output.disable;
dbms_output.enable(1000000);
dbms_output.put_line('------***begin*****------');
fa_srvr_msg.init_server_message;
fa_debug_pkg.set_debug_flag(debug_flag => 'YES');
dbms_output.put_line('.');

-- Get standard who info...use APP INITIALIZATION

l_request_id := fnd_global.conc_request_id;
fnd_profile.get('LOGIN_ID', l_trans_rec.who_info.last_update_login);
fnd_profile.get('USER_ID', l_trans_rec.who_info.last_updated_by);

if (l_trans_rec.who_info.last_updated_by is null) then
l_trans_rec.who_info.last_updated_by := -1;
end if;
if (l_trans_rec.who_info.last_update_login is null) then
l_trans_rec.who_info.last_update_login := -1;
end if;

l_trans_rec.who_info.last_update_date 	:= sysdate;
l_trans_rec.who_info.creation_date 	:= l_trans_rec.who_info.last_update_date;
l_trans_rec.who_info.created_by 	:= l_trans_rec.who_info.last_updated_by;
l_asset_hdr_rec.asset_id 		:= l_asset_id;
l_asset_cat_rec_new.category_id 	:= l_category_id;
l_recl_opt_rec.copy_cat_desc_flag 	:= l_copy_desc_flag;
l_recl_opt_rec.redefault_flag 		:= l_redefault_flag;

dbms_output.put_line('calling FA_RECLASS_PUB.do_reclass');

FA_RECLASS_PUB.do_reclass (
-- std parameters
p_api_version 		=> l_api_version,
p_init_msg_list 	=> l_msg_list,
p_commit 		=> l_commit_flag,
p_validation_level 	=> l_validation_level,
p_calling_fn 		=> l_calling_fn,
x_return_status 	=> l_return_status,
x_msg_count 		=> l_msg_count,
x_msg_data 		=> l_msg_data,
-- api parameters
px_trans_rec 		=> l_trans_rec,
px_asset_hdr_rec 	=> l_asset_hdr_rec,
px_asset_cat_rec_new 	=> l_asset_cat_rec_new,
p_recl_opt_rec 		=> l_recl_opt_rec );

dbms_output.put_line('l_return_status '||l_return_status);

if l_return_status = 'E' then l_msg_count := fnd_msg_pub.count_msg;

if (l_msg_count > 0) then

dbms_output.put_line('l_msg_count '||to_char(l_msg_count));

temp_str := substr(fnd_msg_pub.get(fnd_msg_pub.G_FIRST, fnd_api.G_FALSE), 1, 230);

dbms_output.put_line(temp_str);

temp_str:= null;

for I in 1..(l_msg_count -1) loop
temp_str := fnd_msg_pub.get(fnd_msg_pub.G_NEXT, fnd_api.G_FALSE);
dbms_output.put_line(temp_str);
end loop;

else

dbms_output.put_line('dump: NO MESSAGE !');

end if;

return;

end if;
fa_srvr_msg.add_message
(	calling_fn => 'TOAD SCRIPT',
	name       => 'FA_SHARED_END_SUCCESS',
	token1 	   => 'PROGRAM',
	value1 	    => 'FA_RECLASS_PUB.do_reclass');
exception
when reclass_err then
ROLLBACK WORK;
fa_srvr_msg.add_message(
	calling_fn => 'TOAD SCRIPT',
	name 	   => 'FA_SHARED_PROGRAM_FAILED',
	token1     => 'PROGRAM',
	value1     => 'FA_RECLASS_PUB.do_reclass');
	
l_msg_count := fnd_msg_pub.count_msg;
if (l_msg_count > 0) then
temp_str := fnd_msg_pub.get(fnd_msg_pub.G_FIRST, fnd_api.G_FALSE);
dbms_output.put_line('dump: ' || temp_str);
for I in 1..(l_msg_count -1) loop
temp_str := fnd_msg_pub.get(fnd_msg_pub.G_NEXT, fnd_api.G_FALSE);
dbms_output.put_line('dump: ' || temp_str);
end loop;
else
dbms_output.put_line('dump: NO MESSAGE !');
end if;
end;
Related Posts

Posted in API Integration, Oracle Asset | No Comments »Email This Post Email 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.