‎2008 Sep 30 2:11 PM
Experts!!
I've prepared a PS report that gives the cost status of an asset(under construction). It is a WBS element.
For this, I'm selecting all the projects(PROJ) as in selection criteria.
For each project, the hierarchy(all WBS elements of the project) with an FM.
With that, PRPS -> for WBS element details.
For some WBS elements, there could be asset numbers...means the asset is the WBS element
and the asset is under construction/ activity.
For those assets, I want to find the accounts data from BSEG(or some table).
Now this works fine output-wise.
But the problem is the poor performance.
When BSEG is accessed, I only have the asset number ANLN1(apart from bukrs/gjahr, which is of no great help).
I could not find an alternate table or a table where I can find the key(using the asset number) for BSEG.
Could someone help, please?
Thank you,
Santhosh.
‎2008 Sep 30 3:01 PM
>
When BSEG is accessed, I only have the asset number ANLN1(apart from bukrs/gjahr, which is of no great help).
I could not find an alternate table or a table where I can find the key(using the asset number) for BSEG.
Just make a select in table ANEP with bukrs/anln1/gjahr (all are key fields) and you'll get ANEP-BELNR (= BSEG-BELNR) and ANEP-BUZEI (= BSEG-BUZEI), so you have full key for BSEG
‎2008 Sep 30 2:17 PM
‎2008 Sep 30 2:20 PM
>
> create secondary index for the table
Rajeev - maybe you'd like to reconsider.
Rob
‎2008 Sep 30 2:25 PM
Thanks Rajeev.
That was the first idea which strikes anyone. However, we only have one field - ANLN1 - and so I thought it was not a good option.
‎2008 Sep 30 2:26 PM
‎2008 Sep 30 2:28 PM
Hi,
Normally BSEG table contains Huge data.
1.Goto BSEG table and search for the Index fields, and in where condition use the same order of the fields like index. it will improve the performance. other wise try to create the new index(secondary index ).
2.Try to write the more conditions for Where Condition.
Regards,
Bharani
‎2008 Sep 30 2:37 PM
PK,
Apart from the key fields, we need:
shkzg dmbtr bzdat hkont
these fields against the asset number ANLN1.
I could not find this combo in any other table.
Or as I said, with the asset number, I could not find the key for BSEG.
Bharani,
Your first point is done as much as possible.
For your 2nd, we have only the asset number.
‎2008 Sep 30 2:42 PM
Did you try BSAK?
It has shkzg, dmbtr, anln1, hkont.
If you do a where-used list on bzdat, you will find some 15 tables that has this field.
pk
‎2008 Sep 30 2:36 PM
Hello
1. fetch all documents from BKPF with BUKRS, GJAHR, BUDAT, BLART(if type is determined)
2. in loop/endloop fetch data from BSEG with BUKRS, BKPF-BELNR, GJAHR, PROJK.
‎2008 Sep 30 3:44 PM
Thanks Maroz.
Yes, the document type is known(but not sure how selective it will be - will work on it).
The report takes costs for the past 3 years...so I guess BUDAT won't help much.
Thanks,
Santhosh.
‎2008 Sep 30 2:38 PM
I think Casey Stengel would have had something to say about this.
Rob
‎2008 Sep 30 2:43 PM
>
> I think Casey Stengel would have had something to say about this.
>
> Rob
The Master of SELECT statements chooses words selectively.
pk
‎2008 Sep 30 2:52 PM
When BSEG is accessed, I only have the asset number ANLN1(apart from bukrs/gjahr, which is of no great help).Even Simple just search for ANL* tables and use this for asset master data .
‎2008 Sep 30 3:01 PM
>
When BSEG is accessed, I only have the asset number ANLN1(apart from bukrs/gjahr, which is of no great help).
I could not find an alternate table or a table where I can find the key(using the asset number) for BSEG.
Just make a select in table ANEP with bukrs/anln1/gjahr (all are key fields) and you'll get ANEP-BELNR (= BSEG-BELNR) and ANEP-BUZEI (= BSEG-BUZEI), so you have full key for BSEG
‎2008 Sep 30 3:33 PM
Eric,
There are data for the BUKRS/ANLN1/GJAHR criteria.
But ANEP-BELNR <> BSEG-BELNR.
Also, the correct BSEG-BELNR does not have a record in ANEP.
But in t-code FB03, for BSEG-BELNR -> Enter-> Display Header-> ANEP-BELNR is available in the 'Reference key' field.
Plus the fact that it was posted via t-code CJ88(??!!).
Thanks,
Santhosh.
‎2008 Sep 30 3:34 PM
ANEP-BELNR <> BSEG-BELNR
ANEP-BELNR (not equal to) BSEG-BELNR
‎2008 Sep 30 3:42 PM
this is what I remembered, but I just checked in our system and what I wrote is correct.
If you have BUKRS, GJAHR and ANLN1, then you can select from ANEP, through this select you get ANEP-BELNR and ANEP-BUZEI, with these two (plus BKPF and GJAHR) you can do a select on BSEG (which is the corresponding FI entry for the asset posting). Please note there could be more entries in ANEP for the above combinations, you need the one, where the depreciation area posts into FI (this is almost always AFABE = 01)
If you still can't find the rigth BELNR and BUZEI in ANEP, please also check ANEK (asset postings header data) as well, BELNR and BUZEI are also there.
‎2008 Sep 30 4:45 PM
That pretty much does it for me.
ANEP-belnr...which is not equal to BSEG-bELNR -> is a doc. that originates from the CJ88 transaction. F1 help says so.
This is available agaist BSEG-belnr in BKPF-AWKEY...and it's corresponding BELNR is what I've been looking for.
‎2008 Sep 30 4:46 PM
Thanks all.
Thank you Eric.
Reward points are yours.
Santhosh.
Edited by: Santhosh L. on Sep 30, 2008 5:54 PM
‎2008 Sep 30 3:57 PM
Try this:
Go to FB03 and display one of the documents you are interested in.
Open another sessions and turn on the performance trace (ST05).
Go back to the document display and go:
Environment -> Document Environment -> Accounting documents.
Select the asset document.
Go back to ST05 and turn off the trace and display it.
That should show you how SAP does it. (My bet is that it is pretty close to what Eric has been saying.)
Rob