Views:

A client closed to divisional retained earnings and GP wouldn't close due to a missing retained earnings account. To determine which account is missing the following scripts can be run.

--This will determine which segment is being closed to.
select DIVACTSG from GL40000

--In this example they have four segments and segment one is being closed to. Define the values of the other segments then this script will show which value is missing a retained earnings account. It needs to be tweaked based upon the clients scenario.

select * from 
(select distinct(ACTNUMBR_1 ) from GL00100) SEG
left join
(select * from GL00100 where ACTNUMBR_2='000' and ACTNUMBR_3='00' and ACTNUMBR_4='3001' ) RE
on RE.ACTNUMBR_1=SEG.ACTNUMBR_1
where RE.ACTINDX is null