Yes, in such a case I would recommend to execute script with cursor and api calls. something like that:
DECLARE
a_ VARCHAR2(32000) := NULL; -- i_hWndFrame.dlgFinalYearEnd.lsTemp
c_ NUMBER := 1977; -- i_hWndFrame.dlgFinalYearEnd.dfFromAccYear
d_ NUMBER := 1978; -- i_hWndFrame.dlgFinalYearEnd.dfToAccYear
e_ VARCHAR2(32000) := NULL; -- i_hWndFrame.dlgFinalYearEnd.dfCalculateAll
f_ NUMBER := NULL; -- i_hWndFrame.dlgFinalYearEnd.dfRate
g_ NUMBER := NULL; -- i_hWndFrame.dlgFinalYearEnd.dfConvFactor
h_ VARCHAR2(32000) := 'FB'; -- i_hWndFrame.dlgFinalYearEnd.sClBal
i_ VARCHAR2(32000) := NULL; -- i_hWndFrame.dlgFinalYearEnd.dfUserGroup
j_ VARCHAR2(32000) := NULL; -- i_hWndFrame.dlgFinalYearEnd.dfVoucherType
BEGIN
for rec_ in
(select * from ifsapp.accounting_period where accounting_year <= 2016
and company = '&Company'
and period_status = 'Open'
)
loop
ifsapp.Accounting_Period_API.Close_Period(rec_.objid, rec_.objversion);
end loop;
for rec_ in
(select * from ifsapp.acc_Year where accounting_year <= 2016 and company = '&Company' and Year_status = 'Open')
loop
IFSAPP.Accounting_Year_Closing_API.Update_Opening_Balances__(a_ ,
rec_.company, rec_.accounting_year, rec_.accounting_year + 1, e_,
f_, g_,h_, i_,j_);
IFSAPP.Accounting_year_API.Final_Year_End(
rec_.company, rec_.accounting_year, rec_.accounting_year + 1);
end loop;
END;