Application Development and Automation 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: 
Read only

Facing problem in selecting from table vbrk

Former Member
0 Likes
1,553

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,391

Hi,

Make sure the VBRK select is using an index...OR using the primary key..

Thanks,

Naren

12 REPLIES 12
Read only

Former Member
0 Likes
1,392

Hi,

Make sure the VBRK select is using an index...OR using the primary key..

Thanks,

Naren

Read only

Former Member
0 Likes
1,391

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.

Read only

0 Likes
1,391

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

Read only

Former Member
0 Likes
1,391

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...

Read only

0 Likes
1,391

Hi Leonard

How to put in back ground?

Thanks ..

Nitin

Read only

0 Likes
1,391

hi,

put your program in BDC...

Read only

0 Likes
1,391

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

Read only

dev_parbutteea
Active Contributor
0 Likes
1,391

Hi,

try to add fields like GJAHR. it will restrict your select statement and improve performance.

Regards,

Sooness

Read only

0 Likes
1,391

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

Read only

Former Member
0 Likes
1,391

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??

Read only

Former Member
0 Likes
1,391

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

Read only

0 Likes
1,391

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