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;