Skip to main content
Solved

Fixed Asset-Import Object with 2 depreciation values

  • November 3, 2021
  • 1 reply
  • 268 views

Forum|alt.badge.img+10

Hi IFS gurus

IFS10-UPD9:
I am trying to create a script which is flexible to import 2 depreciation amount lines if ran at the end of the year or 1 depreciation line if run in the middle of the year.
From IFS screen, i can successfully save 2 lines like following:
 

with script IFSAPP.FA_OBJECT_TRANSACTION_API.NEW__( info_ , objid_, objversion_, attr_ , 'DO' ); is not adding second line and i get following error.
 

following is my sql script.  with count(*) cnt_ will get 2, as i have 2 lines for the same object_id with 2 depreciation amounts:
 

SELECT count(*)into cnt_

      FROM MACTAB_FA_OBJECT_IMPORT2 t where t.object_id =rec.object_id;

     

 loop

 client_SYS.clear_attr(attr_);

   client_SYS.add_to_attr('COMPANY', '01', attr_);

  

   client_SYS.add_to_attr('OBJECT_ID', rec.object_id, attr_);

   client_SYS.add_to_attr('BOOK_ID', 'INTERNAL', attr_);

   client_SYS.add_to_attr('FA_YEAR', rec.fa_year, attr_);

   client_SYS.add_to_attr('FA_PERIOD', rec.fa_period, attr_);

   client_SYS.add_to_attr('AMOUNT', rec.depreciation_amount, attr_);

   client_SYS.add_to_attr('TRANSACTION_REASON', 'DEPRECIATION', attr_);

   client_SYS.add_to_attr('OBJECT_TRANSACTION_ID', FA_OBJECT_TRANSACTION_API.Get_Next_Obj_Trans_Id, attr_); 

   client_SYS.add_to_attr('OBJECT_TRANSACTION_DATE', trunc(sysdate), attr_); --???

  

   client_SYS.add_to_attr('USER_ID', fnd_session_api.get_fnd_user(), attr_);

   client_SYS.add_to_attr('FA_OBJECT_TRANSACTION_TYPE', 'Import', attr_);

   client_SYS.add_to_attr('FA_OBJECT_TRANS_VALUE_TYPE', 'Acc. Depreciation', attr_);

   client_SYS.add_to_attr('EVENT_DATE', rec.event_date, attr

     

   IFSAPP.FA_OBJECT_TRANSACTION_API.NEW__( info_ , objid_, objversion_, attr_ , 'DO' );

   cnt_:=cnt_-1;

   exit when cnt_=0;

Best answer by OrangeCloud

No Problem.
I fixed this error. My loops need to be updated to bypass this error.

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

1 reply

Forum|alt.badge.img+10
  • Author
  • Sidekick (Customer)
  • 105 replies
  • Answer
  • November 4, 2021

No Problem.
I fixed this error. My loops need to be updated to bypass this error.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings