Skip to Content
0
Former Member
Aug 30, 2006 at 05:21 PM

How to write optimized select for this requirement

21 Views

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.