cancel
Showing results for 
Search instead for 
Did you mean: 

Performance related to BSAK

Former Member
0 Kudos

Hi Guys,

I have been using the BSAK table in the report. The table has 5.5 crore records. I'm using the simple select statement to get the records from it. But it's taking 45 minutes to get the records of 3 months (Around 15 lakhs). I tried with all the options (like secondary index) but there is no use.

Do you guys have any idea how to improve the performance of this select statement? Any sugestions would be really helpful. Thanks in advance.

SELECT BUKRS

GJAHR

BELNR

BUDAT

BLART

GSBER

DMBTT

INTO TABLE I_BSAK

FROM BSAK

WHERE BUKRS IN S_BUKRS

AND GJAHR IN S_GJAHR

AND BUDAT IN S_BUDAT

AND BLART IN S_BLART

AND GSBER IN S_GSBER.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hello Shrishti,

First and the foremost it is importatn that u access the table with full key otherwise it is going to be more or less sequentinal. So in ur select u are missing LIFNR field. If possible try and include this field also in the select statment and pass values this would restrict the seletion. Secondly u can run SQL trace which will in also indicate which index the database engine is using.

Former Member
0 Kudos

hi Shrishti,

WELCOME TO SDN

1. In u'r select statement <b>LIFNR</b> field is missing try including that ...

2. run transaction<b> ST05</b>( SQL trace ) and with which u can know as where and all the database access is done of more often ..

Regards,

Santosh

LucianoBentiveg
Active Contributor
0 Kudos

You can use abovesoft analizer to check performance of selects. You can try it for 15 days period:

www.abovesoft.com

Former Member
0 Kudos

HI

IF YOU WANT TO INCREASE THE PERFORMANC THAN I WOULD SAY YOU USE THE "CORRESPONDING FIELDS OF TABLE ITAB" WITH YOUR SELECT STATEMENTS,OTHER THINGS ARE OK IN YOUR SYNTAX.

I HOPE THIS WILL HELP YOU TO SOLVE YOUR PROBLEM.

THANKS

MRUTYUNJAYA TRIPATHY

abdul_hakim
Active Contributor
0 Kudos

hi shrishti

welcome to SDN.

Make use of all the key fields in BSAK in the WHERE clause to improve ur performance.

Your query should look something like the below one.

SELECT BUKRS

GJAHR

BELNR

BUDAT

BLART

GSBER

DMBTT

INTO TABLE I_BSAK

FROM BSAK

WHERE BUKRS IN S_BUKRS AND

LIFNR IN S_LIFNR AND

UMSKS IN S_UMSKS AND

UMSKZ IN S_UNZKZ AND

AUGDT IN S_AUGDT AND

AUGBL IN S_AUGBL AND

ZUONR IN S_ZUONR AND

GJAHR IN S_GJAHR AND

BELNR IN S_BELNR AND

BUZEI IN S_BUZEI.

Cheers,

Abdul Hakim

naimesh_patel
Active Contributor
0 Kudos

Hello,

Try like

SELECT BUKRS

GJAHR

BELNR

BUDAT

BLART

GSBER

DMBTT

INTO TABLE I_BSAK

FROM BSAK

WHERE BUKRS IN S_BUKRS

<b>and lifnr in s_lifnr</b>

AND GJAHR IN S_GJAHR

AND BUDAT IN S_BUDAT

AND BLART IN S_BLART

AND GSBER IN S_GSBER.

if you don't have to pass any values to s_lifnr left it blank.

Hope this will help.

Regards,

Naimesh.

PS: Reward points, if it is useful..!