‎2007 Apr 10 7:33 AM
Hello Experts,
I am currently modifying a report where it exceeds the time alloted for programs to run
in our production server which is 10 minutes. I debbuged the report and found out that it fetches
around 550k to 700k of records from tables VBAK and VBAP. After selecting, the internal table
will now be looped and this where the report stops since it cannot process the huge volume of records
which is 550k++. I need help on how to fix this since I can't think of anyway to limit the records being
fetched. Below is the select statement:
SELECT avbeln bposnr a~auart
avkorg avtweg a~kunnr
bmatnr bpstyv b~spart
FROM vbak AS a
INNER JOIN vbap AS b
ON avbeln = bvbeln
APPENDING TABLE lt_vbap
WHERE a~auart IN lr_auart
AND a~vbeln IN s_vbeln
AND a~vbeln IN s_vbill
AND a~vbtyp EQ p_vbtyp.
LOOP AT lt_vbap ASSIGNING <wa_vbap>.
....
ENDLOOP.
Hope you can help me out here guys. Thank you and take care!
‎2007 Apr 10 7:38 AM
Hi
If there are no other ways to improvise the execution time and we are bound for certain time, we have to execute the program in background rather than executing in foreground.
Kind Regards
Eswar
‎2007 Apr 10 7:38 AM
Hi
If there are no other ways to improvise the execution time and we are bound for certain time, we have to execute the program in background rather than executing in foreground.
Kind Regards
Eswar
‎2007 Apr 10 7:42 AM
DATA:
t_mara type table of mara with header line,
t_mara1 type table of mara with header line.
select *
from mara
into table t_mara
package size 5000.
append lines of t_mara to t_mara1.
endselect.
Try this PACKAGE SIZE option.
Reward if helpful....
‎2007 Apr 10 7:42 AM
Vitraylab,
SELECT avbeln bposnr a~auart
avkorg avtweg a~kunnr
bmatnr bpstyv b~spart
FROM vbak AS a
INNER JOIN vbap AS b
ON avbeln = bvbeln
-
INTO TABLE lt_vbap
-
PACKAZE SIZE 30000
WHERE a~auart IN lr_auart
AND a~vbeln IN s_vbeln
AND a~vbeln IN s_vbill
AND a~vbtyp EQ p_vbtyp.
Write the functionality here, which you have written in between loop end loop.
ENDSELECT.
change the packaze size according to your program run time 10 minutes.
Don't forget to reward if useful.
‎2007 Apr 10 7:59 AM
Hai Viraylab,
Each time the program is exiguted it takes much time to fetch required data(may be more than 10 min)
Here is the solution which takes much smaller time.
Create a Database view from the two tables vbak and vbap with join condtion on vbeln.
Now write a select query from that view
(You can fetch data from view as is from db table)
It definitily reduces time.
I hope you got it.But do some analyzation on view.
Reward points if it helps you.
Regrs,
Rama chary.Pammi
‎2007 Apr 10 8:19 AM
Hello Experts,
Thank you for your helpful replies. However, Can you please elnlighten me on what does the PACKAGE statement do and how can I use database view to my advantage? my main problem is not on the select statement but on the loop statement afterwards where the time limit error occurs since the internal table contains around 550K of records. Examples will be appreciated.
Again, thank you guys and take care!
‎2007 Apr 10 8:22 AM
Hi,
In thew query there is not date specified so its trying to list down all the documents available in the database.
Not sure about the requirement at your end but i feel report should always be bounded by time criteria.
Hope that helps.
Regards
Kapadia
***Assigning points is the way to say thanks in SDN.***