Skip to Content
0

Performance Issue While fetching from BSEG Table.

Jan 17, 2017 at 06:03 AM

124

avatar image

Need Small information.

SELECT * INTO CORRESPONDING FIELDS OF TABLE it_bseg-debit FROM bseg WHERE shkzg EQ 'S' AND umskz EQ 'A' AND ebeln EQ i_ekko-ebeln.

The above Query i am Writing.Based on the Purchase order ebeln. I need to fetch the Data.
In Development the query is working fine, But in Quality Bseg is having much of data.So, performance is very slow.

In Where condition i mentioned ebeln. Actually i need to pass key fields. For getting key fields also, Again i need to write the query. May i know how could i reduce the time.
Po number wise i need to fetch data.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Raymond Giuseppi
Jan 17, 2017 at 06:49 AM
1

Use so called secondary indexes like BSIS/BSAS to read the data, then if some fields are missing you can then read BSEG with primary keys of RFBLG the actual db table. You could also consider using table EKBE to get invoice documents associated to Purchase Orders, filtering on BEWTP to restrict to thoze.

Regards,
Raymond

Share
10 |10000 characters needed characters left characters exceeded
Kali Charan Jan 17, 2017 at 06:57 AM
0

Ok, I will check it, EKBE i was forgotton.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 17, 2017 at 07:47 AM
0

Avoid using ''CORRESPONDING FIELDS OF..'' Instead

SELECT * FROM bseg INTO TABLE it_bseg-debit WHERE shkzg EQ 'S' AND umskz EQ 'A' AND ebeln EQ i_ekko-ebeln....

Also, to further enhance the performance use fields instead of 'Select *'

Furthermore you can use secondary indexes.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

How can we use secondary indexed in my case. Can you explain.

0
Former Member
Kali Charan

It depends on the queries you need to do.

For example my table has the following fields:

KEY1

KEY2

KEY3

FIELD1

FIELD2

FIELD3

If I often need to do a query using FIELD1 and FIELD2, I have to create an index with those two fields.

Every time I do a select like this:

SELECT * FROM <TABLE> WHERE FIELD1 = .....

AND FIELD2 = .....

The index'll be used.

But also if I do:

SELECT * FROM <TABLE> WHERE FIELD1 = .....

The index'll be used partially.

1