Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABST2, AR01 and FAGLB03 into one report

Former Member
0 Kudos

I have a report to write where I need to reconcile Sub ledger to ledger balances.

The report needs to be based on transaction ABST2 and it needs to be able to show the differences at profit center and GL account level. Currently, the report can only be executed at company code level.

Our current process involves running 3 separate transactions:

  1. ABST2 that shows the differences at company code level
  2. AR01 to identify Asset Ledger balance, and
  3. FAGLb03 to identify subledger balance and manually reconcile balances on Asset Ledger and Subledger.

Has anyone written anything like this before?

This is my SQL query so far but I don't think that the keys between the tables are strong enough.:

SELECT ANEK~BUKRS WERT KOSTL PRCTR ANEK~ANLN1 ANEK~ANLN2 KONTO ANEK~GJAHR ANEK~BUDAT FROM ANEK
JOIN ANLP ON
ANEK~BUKRS = ANLP~BUKRS AND
ANEK~ANLN1 = ANLP~ANLN1 AND
ANEK~ANLN2 = ANLP~ANLN2
JOIN EWUFIAASUM ON
ANEK~BUKRS = EWUFIAASUM~BUKRS AND
ANEK~GJAHR = EWUFIAASUM~GJAHR AND
ANEK~PARGB = EWUFIAASUM~GSBER
INTO CORRESPONDING FIELDS OF TABLE WA
WHERE ANLP~PRCTR IN SO_PRCTR AND
EWUFIAASUM~KONTO IN SO_GLACC AND
ANLP~KOSTL IN SO_KOSTL AND
ANEK~BUDAT IN SO_PDate.

LOOP AT wa.
    CALL FUNCTION 'BAPI_GL_ACC_GETPERIODBALANCES'
      EXPORTING
        companycode                   = wa-bukrs "'1000'
        glacct                        = wa-konto
        fiscalyear                    = wa-gjahr "'2018'
        currencytype                  = '10'
      IMPORTING
        return                        = ret
      TABLES
        account_balances              = bal3.
    IF sy-subrc = 0.
      READ TABLE bal3 with KEY fis_period = '01'.
      IF sy-subrc = 0.
        wa-gl = bal3-balance - bal3-per_sales.
        wa-valuediff = wa-wert - wa-gl .
        MODIFY wa.
      ENDIF.
    ENDIF.
    ENDLOOP.

This is what the report should show at the end of the day:

Profit Center: PRCTR

Asset Number: ANLN1

Sub Asset Number: ANLN2

Sub Ledger Value: ABST2 Calculation

Ledger Value: ABST2 calculation

2 REPLIES 2

Former Member
0 Kudos

How do I combine ABST2, AR01 and FAGLB03 into one report.

I guess that this is what it comes down to.

Any help will be greatly appreciated.

Former Member
0 Kudos

Can anyone help please?

Is more clarification needed?