Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How do improve SELECT in BKPF/BSEG table.

Hi everyone.

I'm using this SELECT in a report program but processing this taking about 10 minutes in these two commands:

select belnr

           awkey

      from bkpf

      into table t_bkpf

      for all entries in t_cobk

      where awkey eq t_cobk-awkey.

   select belnr

             vbeln

             vbel2

             kstar

             kostl

             buzei

             kunnr

             vorgn

      from bseg

      into table t_bseg

      for all entries in t_bkpf

      where kstar eq '0000464001'

      and belnr eq t_bkpf-belnr

      and shkzg eq 'S'.


There is another way of improving these SELECT, or another table to use instead of BSEG ?

Tks!

Former Member
Former Member replied

In addition to BELNR and AWKEY, you have to SELECT BUKRS and GJAHR as  well. Then use BUKRS, BELNR and GJAHR in your SELECT on BSEG. This is the only proper way to SELECT on BSEG.

For the SELECT on BKPF, you have to add AWTYP.

Rob

Message was edited by: Rob Burbank

1 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question