‎2020 Jun 22 12:20 PM
Hello,
I want to avoid hitting the BSEG table.
My requirement is to get the individual sum of line items in a given PO.
Is there any way that i can avoid querying BSEG table?
My queries are like below :
EKBE -->BKPF(awkey = belnr+year)-->BSEG table
1) Getting BELNR from EKBE .
2) And then using BELNR+GJAHR from EKBE to query the BKPF tables and get the BKPF-BELNR
3) Hit BSEG-BELNR (using above BKPF-BELR) and sum up different items.
‎2020 Jun 23 7:16 AM
Hello ricky.shaw
Please check if you have an AWKEY index in the BKPF table. It's a standard one, so you should have it. This index contains 4 fields: MANDT, AWTYP, AWKEY and AWSYS. If you will query the BKPF table using these fields (MANDT - automatically added, AWTYP and AWKEY) then the selection should be quite fast (thanks to the DB index). Please make sure you have the AWTYP field in your conditions.
Then, query the BELNR using the PRIMARY KEY of the table, which is BUKRS, BELNR, GJAHR - and it should be fast too.
Kind regards,‎2020 Jun 22 12:30 PM
Are you using the BSEG-BUKRS and BSEG-GJAHR key fields too?
‎2020 Jun 22 5:08 PM
‎2020 Jun 22 11:23 PM
Hi Sandra,
No, we are not using S/4 HANA. Will that make a difference?
Hi mateuszadamus Yes..i am mentioning all those fields in the query.
But getting data from BKPF is also taking more time.
Can you pls suggest.
‎2020 Jun 23 7:11 AM
Please use "Comment" feature when providing more information or commenting.
‎2020 Jun 23 7:36 AM
Yes, that makes a difference because BSEG is a special type of table (clustered) in versions before S/4HANA and that makes a lot of differences (in performance, in ABAP, etc.) With S/4HANA, all clustered tables have been converted into normal tables (I don't talk about tables containing "data clusters", like STXL, INDX, etc.)
Yet, my first main question is still unanswered: Why do you want to avoid BSEG?
NB: please use "comment".
‎2020 Jun 23 7:50 AM
BSEG can be transparent, but it has to be converted during system upgrade. SAP OSS notes on the subject:
https://launchpad.support.sap.com/#/notes/1892354
https://launchpad.support.sap.com/#/notes/2227432
‎2020 Jun 23 2:31 PM
Mateusz Adamus I wonder how much percentage of customers dared converting BSEG, I mean NOT under the direct advice of SAP 😉
‎2020 Jun 23 7:16 AM
Hello ricky.shaw
Please check if you have an AWKEY index in the BKPF table. It's a standard one, so you should have it. This index contains 4 fields: MANDT, AWTYP, AWKEY and AWSYS. If you will query the BKPF table using these fields (MANDT - automatically added, AWTYP and AWKEY) then the selection should be quite fast (thanks to the DB index). Please make sure you have the AWTYP field in your conditions.
Then, query the BELNR using the PRIMARY KEY of the table, which is BUKRS, BELNR, GJAHR - and it should be fast too.
Kind regards,‎2020 Jun 24 10:10 PM
Let me add for the sake of completeness: with the assumption that there is everything OK with the indices, there is no bad need for a reorg etc.