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: 

performance of a report

Former Member
0 Kudos

SELECT AZBOL_NO AZFOLDERNO BZORDITEMNO BZMECAORDERNO B~ZBYRPARTID

BZQUANTITY BZQUANPERCASE B~ZNOOFCASE INTO TABLE INT_ZMNET FROM

ZMNETHDR AS A INNER JOIN ZMNETDTL AS B ON AZBOL_NO = BZBOL_NO AND

AZFOLDERNO = BZFOLDERNO AND AZINVOICENO = BZINVOICENO

AND AZACTIONID = BZACTIONID WHERE A~ZBOL_NO IN BOL AND

BZDATEPOSTED IN DATE AND BBUKRS IN BUKRS AND A~ZFOLDERNO IN ZFOLDER

AND BZINVLINENO IN ZINVLINE AND BZINVOICENO IN ZINVOICE.

SORT INT_ZMNET BY ZBOL_NO ZFOLDERNO ZORDITEM ZMECAORDERNO ZBYPART

ZQUANTITY ZQUANPERCASE ZNOOFCASE.

can anything be done to improve the performance of this select statement

4 REPLIES 4

Former Member
0 Kudos

Hi,

Just make sure conditions in where clause should have sequence similar to either primary index of table.

or try breaking the stamtemnt as first only inner join of tables.

then use this internal table to further filter records as per where conditions.

Thanks.

Mark points if helpful.

former_member181962
Active Contributor
0 Kudos

Are the fields that are specified in the where condition in the same order as they appear in the z table?

If not, order them as they appear in the table.

Pass the full key of possible.

Create an index for the table if there are not many.

Regards,

Ravi

Former Member
0 Kudos

Hi Priyanka,

You can improve the performance of the above query if

Fields ZBOL_NO,ZFOLDERNO and ZINVOICENO are part of the primary index of both tables ZMNETHDR and ZMNETDTL .

If so.. then change your where clause as below

WHERE A~ZBOL_NO IN BOL AND

A~ZFOLDERNO IN ZFOLDER AND

A~ZINVOICENO IN ZINVOICE AND

B~ZDATEPOSTED IN DATE AND

B~BUKRS IN BUKRS AND

B~ZINVLINENO IN ZINVLINE.

This will surely improve the performance of your query.

Let me know if you have any concerns.

Don't forget to award points to the helpfull reply.

Former Member
0 Kudos

Try after breaking the code into 2 internal table. i.e use two select queries. Select the data from ZMNETHDR first and using the for all entries select the data from ZMNETDTL. Check which is taking lot of time.

Regards,

Prakash.