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: 

i want to send Report ALV Output to user via spool if its taking More time for output.

i want to send Report ALV Output to user via spool if the time taken to display output is taking more than 15 seconds ,how can i set timer and send this data to user via spool via object oriented ALV . If less than 15 seconds output can be shown then it will be shown with Object oriented ALV . Also Docking container will be good or custom container ?

5 REPLIES 5

Former Member
0 Kudos

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

0 Kudos

Thank you for your reply ,

Can you help me know how can we send data records in Spool to user ??

Do we have any standard FM for this ?

0 Kudos

Hi,

Well there are two ways :

1. Procedure oriented approach :

Follow link :

https://archive.sap.com/discussions/thread/1501009

2. Object oriented approach :

(Note : You can try but I never tried this , this is the latest updated approach)

CL_RSPO_SPOOL_HANDLE

Jelena
Active Contributor

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.

vinita_kasliwal
Active Contributor
0 Kudos

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