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: 

number of transactions posted

Former Member
0 Kudos

Hi Friends,

Could you please provide an optimized select for this case.

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.

If you need any more details for writing an optimized select, Please do let me know.

Thanks,

Prakash.

1 REPLY 1

Former Member
0 Kudos

Hi Surya,

Is this what you wanted?

If p_bukrs, p_budat and p_monat are parameters in the selection.

select * from bkpf into table it_bkpf where bukrs eq p_bukrs and budat eq p_budat.

or

select * from bkf into table it_bkpf where bukrs eq p_bukrs and gjahr eq p_gjahr and monat eq p_monat.

select * from bseg into table it_bseg for all entries in it_bkpf where bukrs = it_bkpf-bukrs and belnr = it_bkpf-belnr and gjahr = it_bkpf-gjahr.

describe table it_bseg lines zindx.

-


If p_bukrs, p_budat and p_monat are select-options in the selection.

select * from bkpf into table it_bkpf where bukrs in p_bukrs and budat in p_budat.

or

select * from bkf into table it_bkpf where bukrs in p_bukrs and gjahr in p_gjahr and monat in p_monat.

select * from bseg into table it_bseg for all entries in it_bkpf where bukrs = it_bkpf-bukrs and belnr = it_bkpf-belnr and gjahr = it_bkpf-gjahr.

describe table it_bseg lines zindx.

Hope this will help you.

Regards,

Vivek