Message Boards

How to get GL opening balance by cost center from PostingHist using Query

Amit Paul, modified 3 Years ago.

How to get GL opening balance by cost center from PostingHist using Query

Post Date: 9/9/17 (Bronze, 1 Post) Recent Posts

I want to fetch GL opening balance for a period by cost center from database using a query. I explored PostingHist for this using following query but not being able to find the opening balance for the period.

for each PostingHist no-lock where PostingHist.GL_ID = 1124163
                        and (PostingHistYearPeriodFrom = 201707
                       /* or PostingHistYearPeriodTill = 201707*/ ),               
    first CostCentre no-lock where                                                              
        CostCentre.CostCentre_ID = PostingHist.CostCentre_ID,
    first si_mstr no-lock where si_domain = "D0002"
                                and si_site = "DP001"
                                and si__chr02 = CostCentreCode
                                break by CostCentreCode:

    display
        PostingHistYearPeriodFrom
        PostingHistYearPeriodTill
        PostingHistYTDDebitLC
        PostingHistYTDCreditLC
        with down frame d width 120.
        
end.

Any help or suggestion is highly appreciated.

thumbnail
Raymond Chin Kwie Joe, modified 8 Years ago.

Re: How to get GL opening balance by cost center from PostingHist using Que

Post Date: 9/11/17 (Rhodium, 825 Posts) Recent Posts
I have not studied the file structure and am not a developer. What I see is that you are searching for cc per site. A domain can have many entitities and or sites. Maybe the begin balance is the summary of all parts. It is also possible that a closed period is stored in another table. I do not have a solution, this was just my observation.

Message place holder