‎2007 Jun 13 6:28 AM
Hi,
I have developed a simple report for calculating the total logistic cost.
That program was working fine in the development server.
Now in production, its not working.
While debugging i found that its getting stuck at a select query where its fetching data from VBRK table and is getting timed out.
What should be done for reducing the time?
Please help.
Thanks in advance
Nitin
‎2007 Jun 13 6:29 AM
Hi,
Make sure the VBRK select is using an index...OR using the primary key..
Thanks,
Naren
‎2007 Jun 13 6:29 AM
Hi,
Make sure the VBRK select is using an index...OR using the primary key..
Thanks,
Naren
‎2007 Jun 13 6:31 AM
hi nitin,
use where condition in select statement to minimize the selection criteria if u dont use the same in select statement.
reward points if helpful.
regards,
seshu.
‎2007 Jun 13 6:36 AM
mention all the fields of a WHERE condition in order maintained in table....because data is filtered based on order of fields mentioned in condition ...in case if u mention a primary key as last condition in WHERE clause then performance will not be good
‎2007 Jun 13 6:40 AM
hi,
must include all necessary filtering fields, after select statements use COMMIT WORK, it will free the memory....and if it still take too long..then put it in background process...
‎2007 Jun 13 7:01 AM
‎2007 Jun 13 7:02 AM
‎2007 Jun 13 7:35 AM
HI,
put it in where condition! thu you will retrieve data of current fiscal year only. Try to put other fields that will filter out unwanted data.
Reagrds,
Sooness
‎2007 Jun 13 6:45 AM
Hi,
try to add fields like GJAHR. it will restrict your select statement and improve performance.
Regards,
Sooness
‎2007 Jun 13 6:59 AM
Hi sooness,
U suggested to add fields like GJAHR,in where condition or in the select statement itself?
If u dont mind plz clear my doubt.
Thanks in advance
Nitin
‎2007 Jun 13 6:49 AM
Hi Naren ,Seshu & Aarun
First of all thanks a lot for replying.
The structure of my select query is
START-OF-SELECTION.
SELECT cityc regiogroup bzirk INTO TABLE it_ztaluka_1
FROM ztaluka_1
WHERE regiogroup IN pregroup.
IF sy-subrc NE 0.
MESSAGE 'No records in ztaluka_1.' TYPE 'E'.
ENDIF.
I N I T I A L I S I N G IT_VBRK F R O M VBRK *******
IF NOT it_ztaluka_1[] IS INITIAL.
SELECT vbeln bzirk regio cityc zzwerks knumv
FROM vbrk
INTO TABLE it_vbrk
FOR ALL ENTRIES IN it_ztaluka_1
WHERE zzwerks IN pzzwerks
AND regio IN pregio
AND cityc = it_ztaluka_1-cityc.
IF sy-subrc NE 0.
MESSAGE 'No records in vbrk.' TYPE 'E'.
ENDIF.
SORT it_vbrk BY vbeln .
The key field is vbeln,but that not included in my where condition as its not in my selection criteria also in the previous tables which r used in the program.
i found the order in the select qusery is not in the order of vbrk table.
That i will change.But since the key field is not included it will again cause problems na??
‎2007 Jun 13 7:02 AM
hiii nitin
from ur source code it looks like u r slectiong data from vbrk on the basis of ur ztable on dev server. do you tranport the same structure on prod server along with your program code plz chk that
‎2007 Jun 13 7:10 AM
Hi Gaurav,
That ztable is created by me only and i transported that to the production at the same time.
And in production when i debugged na,the internal table it_ztaluka_1 is getting filled properly.
Thank
Nitin