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: 

How to write optimized select for this requirement

Former Member
0 Kudos

Hi friends,

Could you please provide me detailed optimized selects for these cases.

1) G/L Account No. Info: Get all the list of G/L Account no. , company code and the corresponding long description from SKB1 & SKAT tables based on the G/L Account no. and company code values entered in the selection screen.

2) No. of transactions posted: For each of the Company code & Posting date or fiscal year/ period combination, select all document numbers from BKPF table into an internal table. For each of the company code, GL Account no combination find out no. of distinct records in the BSEG table (or combination of BSIK, BSAK, BSID, BSAD, BSIS & BSAS tables) to get the No. of transactions posted.

3) For Last posting FY/period: for each G/L account, Company code combination, determine the MAX (Doc. No) in BSEG, and look up the corresponding document in BKPF table to get the last posting FY/Period.

Please provide me a detail answer to this one and let me know if you need any more details for writing the selects.

Thanks,

Prakash.

1 REPLY 1

sunilachyut
Contributor
0 Kudos

If you post what you have, someone might help you identifying performance enhancing suggestions. Also looks like a simple inner join for the first one would do.

hith

Sunil Achyut