5 Replies Latest reply: Sep 25, 2012 2:00 PM by Dineshwar Singh Eswar RSS

ALV to PDF - Performance

B M
Currently Being Moderated

Hi Experts,

We have given a option to display output of a report in PDF format.

To display the output in PDF we call a smart form and convert the OTF to PDF.

 

We pass 2 internal tables to the smartform

ITAB1  (Header) Sorted and duplicated are deleted

ITAB2  (Item)     Sorted

 

 

In the smartform i have a simple logic

loop at itab1.

 

loop at itab2 where f1 = itab-f1 , f2 and f3.

 

build smartform

 

endloop.

endloop.

 

The whole processing to do this loop end loop takes atleast 2-3 mins.

Scenario:

ITAB1 Sales order header data    (150 entries )

ITAB2 Sales order line item data  (400 entries)

The pdf output is about 278 pages.

 

Should it really take this much time to print (pdf output ) for 278 pages?

Should i do something different to process this loop endloop faster?

 

Please let me know if any further details are required from my end.

  • Re: ALV to PDF - Performance
    RĂ¼diger Plantiko
    Currently Being Moderated

    Since ITAB1 is a standard table (I am right?), there will be a slight quadratic effect. But this won't come out to 2-3 mins for the table sizes you mentioned. I would guess that the problem lies inside of your <build smartform> block. But an SE30 trace can tell you what't really going on.

  • Re: ALV to PDF - Performance
    Ravi Lanjewar
    Currently Being Moderated

    Hi B M,

     

    You can create the clasical report and convert spool to pdf instead of using smartforms. Smartforms function moudle calling in the loop it degraded the performation of the program.

     

    For converting spool to pdf you can used the program RSTXPDF5.

     

    Kind Regards

    Ravi Lanjewar

  • Re: ALV to PDF - Performance
    Yuri Ziryukin
    Currently Being Moderated

    Well, calling smartform processing for each item in each sales document definitely results in the long runtime.Who is supposed to read 278 pages? Maybe you can discuss the requirements with business and change the format of the PDF document to represent the sales orders in a different format?

  • Re: ALV to PDF - Performance
    sandeep mashapari
    Currently Being Moderated

    Hi,

     

    Loop inside Loop should be avoided. Instead use READ TABLE inside first loop.

     

    Loop at itab1.

    readtable itab2 where f1 = itab-f1 , f2 and f3.

     

    endloop.

  • Re: ALV to PDF - Performance
    Dineshwar Singh Eswar
    Currently Being Moderated

    Hi BM,

     

              This is the best practice.

     

              LOOP AT itab1.

                   READ TABLE itab2 WITH KEY F1 = itab1-F1 F2 = itab1-F2 ........Fn = itab1-Fn.

                   Executable statements.

              ENDLOOP.

     

    Cheers,

    Dineshwar Singh Eswar.