Application Development and Automation 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: 
Read only

Performance issue in PS report

Former Member
0 Likes
1,827

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.

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,776

>

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

19 REPLIES 19
Read only

Former Member
0 Likes
1,776

create secondary index for the table

Read only

0 Likes
1,776

>

> create secondary index for the table

Rajeev - maybe you'd like to reconsider.

Rob

Read only

0 Likes
1,776

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.

Read only

Former Member
0 Likes
1,776

Why only BSEG?

pk

Read only

BH2408
Active Contributor
0 Likes
1,776

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

Read only

Former Member
0 Likes
1,776

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.

Read only

Former Member
0 Likes
1,776

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

Read only

Former Member
0 Likes
1,776

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.

Read only

0 Likes
1,776

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.

Read only

Former Member
0 Likes
1,776

I think Casey Stengel would have had something to say about this.

Rob

Read only

0 Likes
1,776

>

> I think Casey Stengel would have had something to say about this.

>

> Rob

The Master of SELECT statements chooses words selectively.

pk

Read only

Former Member
0 Likes
1,776
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 .

Read only

JozsefSzikszai
Active Contributor
0 Likes
1,777

>

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

Read only

0 Likes
1,776

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.

Read only

0 Likes
1,776

ANEP-BELNR <> BSEG-BELNR

ANEP-BELNR (not equal to) BSEG-BELNR

Read only

0 Likes
1,776

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.

Read only

0 Likes
1,776

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.

Read only

0 Likes
1,776

Thanks all.

Thank you Eric.

Reward points are yours.

Santhosh.

Edited by: Santhosh L. on Sep 30, 2008 5:54 PM

Read only

Former Member
0 Likes
1,776

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