2006 Nov 17 7:45 PM
Hello! I am new to this forum, and to ABAP. Hope my question is not obvious.
I want to get sum amount from table BSIS, group by year, period an account. Normally I will try a SQL select like this:
SELECT gjahr monat hkont sum( wrbtr ) as wrbtr INTO CORRESPONDING FIELDS OF TABLE itab FROM BSIS WHERE (itabcond) GROUP BY gjahr monat hkont .
The problem is that the amount in field wrbtr is all positive. The result gets wrong. The debet/credit indicator shkzg determines what is positive/negative. How to solve this in the most efficient way? Should I read all accounting documents into an internal table, and loop through them, changing the sign, and then make some new select, or is there a better way?
Regards Dag-Egil
Message was edited by:
Dag-Egil Bull Sletholt
2006 Nov 17 7:56 PM
Have a look at table GLT0. This has account balances by GL and fiscal period.
Rob
2006 Nov 17 7:56 PM
Have a look at table GLT0. This has account balances by GL and fiscal period.
Rob
2006 Nov 17 8:00 PM
My table GLT0 contains no records. I tried looking it at using transactions SE16. Is there a special settings to make this table "active"?
2006 Nov 17 8:12 PM
That's odd. What happens when you execute transaction FBL3N?
Rob
2006 Nov 17 8:17 PM
This report displays the accounting documents correctly.
2006 Nov 17 8:30 PM
Can you run a performance trace (ST05) while you execute this transaction? It will show you what tables it's reading and how many records each returns.
Rob
2006 Nov 17 9:06 PM
Here are the objects in the trace list:
SKB1
USR05
TRDIR
SKA1
SKAT
SKB1
BSIS
PRPS
BSAS
V_LTDX
USR02
RFBLG
V_LTDX
LTDX
RTXTH
RTXTF
RTXTT
TRDIR
The most of this call to this tables returns 1-2 records, apart from BSIS, where it returns 10 records. This is the same as accounting documents in the transaction FBL3N. When i try this again with more records returned I still have no call to table GLT0.
2006 Nov 17 9:21 PM
That's interesting. I ran it as well and instead of BSIS and BSAS, it called GLT0. So somehow, this isn't being used in your system. You might check with your functional people to see if they have turned it off in customization.
But it's agood table to have because it allows this transaction to run quickly.
Rob
2006 Nov 17 9:24 PM
I'm really sorry - I gave you the wrong transaction. FBL3N displays documents. <b>FS10N</b> displays balances. Try running this (with a trace if necessary).
Sorry for the confusion.
Rob
2006 Nov 17 10:07 PM
I tried again with FS10N, and I found a call to table FAGLFLEXT that probably will do. I will need to do some more research to figure out if this will solve my problem. Thanks so far!
2006 Nov 17 10:14 PM
You're welcome.
Please close the post (solved on own).
In the future, you should probably post questions like this to ABAP General.
Rob
2006 Nov 20 8:49 AM
hello,
i met this problem before
use the into itab replec the into corronspording fields of table itab
then it will be corrert .
even now i donnot why strange