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: 

ZVGSPVVG0370 prg taking long time to execute

Former Member
0 Kudos

hi,

In ZVGSPVVG0370 prg taking 10 min to execute and finally it going for dump becase of the following select query.

SELECT knumv kposn knumh kmxaw kinak

FROM konv

INTO CORRESPONDING FIELDS OF TABLE gt_konv

FOR ALL ENTRIES IN lt_s971

WHERE knumv = lt_s971-knumv

AND kschl = pa_kschl

AND kappl = 'V'.

i am geting values for the internal table lt_s971 by using follwing query

SELECT s971vbeln s971knumv s971auart s971vbtyp s971~matnr

s971vkorg s971vtweg s971spart s971prsdt

FROM s971 AS s971 INNER JOIN vbak AS vbak

ON s971vbeln = vbakvbeln

INTO CORRESPONDING FIELDS OF TABLE lt_s971

WHERE s971~vkorg IN so_vkorg

AND s971~vtweg IN so_vtweg

AND s971~spart IN so_spart

AND vbak~vkorg IN so_vkorg

AND vbak~vtweg IN so_vtweg

AND vbak~spart IN so_spart

AND s971~matnr IN so_matnr

AND s971~prsdt >= l_datab

AND s971~prsdt <= l_datbi.

in this internal table nearly 20 lakh records are there. So please give me the suggestion to improve the speed.

Thanks in advance

R.vijai

9 REPLIES 9

former_member192616
Active Contributor
0 Kudos

Hi,

> In ZVGSPVVG0370 prg taking 10 min to execute and finally it going for dump becase of the following select query.

What kind of dump? Memory related or run time (time out) related?

Kind regards,

Hermann

0 Kudos

Hi Hermann,

It is time out related .

Regards

R.Vijai

0 Kudos

Hi,

doublecheck if the SELECT is supported with an index.

Besides that the task might be too big (huge volume) to fit into 10 min dialog time out window.

Run it in background then.

Kind regards,

Hermann

former_member621510
Participant
0 Kudos

if you can replace the "Select * into corresponding fields of table" into "into table " statement and check the same.

regards

vishnuvardhan

former_member418469
Participant
0 Kudos

hi,

Instead to using select into corresponding, use into table. You can use more internal tables instead of 1. Use Read statement to combine internal tables. Also try to use all entries and use Read statement again instead of join to combine internal tables.

Former Member
0 Kudos

Instead of INTO CORRESPONDING FIELDS OF TABLE use INTO TABLE.it increases your speed...if possible use sub-queries,dont use loop statement,use READ condition

Former Member
0 Kudos

Check if in lt_s971 you have a lot of duplicates.

If so make a copy of the table sort it by knumv and "DELETE ADJACENT DUPLICATES FROM".

0 Kudos

Hi,

I think date is mandatory in your program.

Write your query as below way

1) create index on table s971 on date

2) select data from table s971

SELECT s971vbeln s971knumv s971auart s971vbtyp s971~matnr

s971vkorg s971vtweg s971spart s971prsdt

FROM s971 INTO CORRESPONDING FIELDS OF TABLE lt_s971

WHERE s971~vkorg IN so_vkorg

AND s971~vtweg IN so_vtweg

AND s971~spart IN so_spart

AND s971~matnr IN so_matnr

AND s971~prsdt >= l_datab

AND s971~prsdt <= l_datbi.

sort s971 by vbeln

delete adjacent duplicate from table s971 comparing vbeln

if s971[] is not initial.

SELECT * FROM vbak

INTO CORRESPONDING FIELDS OF TABLE lt_vbak

for all entries in s971

WHERE vbeln = s971-vbeln.

endif.

3) Merge data from both the table as per your requirement.

Try this, It will work.

Edited by: Ravishankar Lanjewar on May 21, 2010 5:56 PM

Former Member
0 Kudos

Hi Vijaykumar,

I will suggest you not to use into corresponding fields of itab, instead use into itab. This leads to preformance issues.

Also, put all the fields in the order as they maintained in the database table i.e., both for selection of the fields and in the where condition.

I have corrected the first query, see beolw:

SELECT knumv kposn knumh kinak kmxaw

FROM konv

INTO TABLE gt_konv

FOR ALL ENTRIES IN lt_s971

WHERE knumv = lt_s971-knumv

AND kappl = 'V'

AND kschl = pa_kschl.

In the same way you correct the second query as well. Please avoid using into corresponding and also use all your fields in the order as maintained in the database table.

Then definitelh performance will prove.

Regards,

Md Ziauddin.