IMHO if it takes more than 15 seconds to display ALV output then there is something seriously wrong with your system.
Most time is usually spent selecting data from the database (pre-HANA at least). Considering that, I'm not sure how exactly you're going to accomplish this design. Like "select half of the data, oops 16 seconds, ah screw this, I'm scheduling myself in a background job"? And how would you "send via spool"? The users normally don't have access to SP01 and it's sure as heck much less convenient than ALV on screen. Not to mention you might run into the notorious 255 characters per line problem.
I wouldn't be pleased with this at all if I was a user. Might want to look into the ways to improve the performance or guide the users to enter better selection criteria. Some standard SAP transactions (e.g. ST05) start with checking number of records and then ask for confirmation. It's a bit lame but still looks like a better option IMHO.
With HANA I guess this will be redundant anyway.
Hi Kaustubh,
You can use :
DATA time1 TYPE i.
GET RUN TIME FIELD time1.
If you are using OOPS write the above statement twice :
Once before the data selection and once just before the display (set_table_for_first_display).
Now substract the two times.
total_time_taken = time(after_execution) - Time(before_execution)
If this is greater than 15sec then you can bypass the call to method 'set_table_for_first_display'.
Regards,
Ankit Mahajan
Hi Kaustubh
From what I understand you are trying to find the run time of your program Check this link I had used it to display my run-time of the program earlier as I had users complaining that the program is too slow and I updated that to a table. https://wiki.scn.sap.com/wiki/display/Snippets/ABAP+-+Program+to+get+run+time+for+a+given+code
You can use this after the select program and however what I did not understand what will you show as output and not sure the way to stop it in between. Right way is probably to incorporate
- Join statement to avoid multiple select
- Use parallel processing
- Read the code inspector result and see how you could optimize
Below are some web link which I found useful ;
https://archive.sap.com/discussions/thread/312137
https://wiki.scn.sap.com/wiki/display/ABAP/Code+Inspector
https://wiki.scn.sap.com/wiki/display/ABAP/Parallel+Processing
Let me know if this helps.
Regards
Vinita
Add comment