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: 

BSEG & Purchase order (EKKO-EBELN)

Former Member
0 Kudos

Hello Gurus,

I need to read BSEG table but not using key fields. I have to read it using only company code (BUKRS), purchase order number (EBELN), purchase order item number (EBELP) and material (MATNR) because I need to find the G/L account assigned to this purchase order. I cannot use BSIK/BSAK.

And as you know the performance is very very poor.

Do you have any idea?

Regards,

M.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

you can get the G/L account number by using EKKN and EKPO-matnr , why are you using BSEG for getting G/L account? it will be much faster if you use EKKN and EKPO as a join .

Please reward if you find the answer useful.

Thanks & Regards,

Kamesh Bathla

6 REPLIES 6

Former Member
0 Kudos

hi,

Try making use of all the key fields in the where condition of your select statement....

Regards,

Santosh

JozsefSzikszai
Active Contributor
0 Kudos

yes, I have... read table EKKN (postings of purchasing documents). This table you can read with EBELN and EBELP. The G/L account will be in field SAKTO. (If you want to restrict your selection based on Company code and material number, than you have to read EKKO (for company code) and EKPO (for material number) tables first)

christine_evans
Active Contributor
0 Kudos

BSEG is a cluster table. You can't create secondary indexes on cluster tables.

Why can't you get the PO GL code from the PO account assignment table EKKN?

Just for clarification. My mentioning that you can't create secondary indexes on BSEG, which now appears to have nothing to do with this thread at all, was in reponse to Santosh Kumar Patha's suggestion that you can do that very thing. He has since edited his post to remove that suggestion.

Edited by: Christine Evans on Jul 25, 2008 1:02 PM

Former Member
0 Kudos

hi,

why cant u try fpr BSIK and BSAK and den make relation with table BKPF and then take the AWTYP = RMRP and u get a/c no in RSEG

and there u can have ur requiered PO no.. and PO Item.........

Bseg will be more complex as it contains the data which will be heavier and it might also effect your report performance.....

Former Member
0 Kudos

Please see:

[Quickly Retrieving FI document Data from BSEG|]

Rob

Former Member
0 Kudos

Hi,

you can get the G/L account number by using EKKN and EKPO-matnr , why are you using BSEG for getting G/L account? it will be much faster if you use EKKN and EKPO as a join .

Please reward if you find the answer useful.

Thanks & Regards,

Kamesh Bathla