How to export the report in HTML format for desktop application

Hi,
i have wrote the JRC desktop application to export the report and i am able to export it in PDF and other formats as mentioned in "ReportExportFormat" API.
i would like to know is there any API there which can export the report in HTML format.
i know it would be possible with web based application of JRC, but how can i do it in desktop application?

There's no mechanism for static HTML pages that displays the report.
You can use the CrystalReportViewer DHTML viewer, but that's 'interactive'.
Sincerely,
Ted Ueda

Similar Messages

  • Export the Report in Excel format

    Hi,
    How to export the Report in Excel format directly from the SAP to my Desktop.
    Plz. give me the process???
    Thanks

    use this,
    INCLUDE OLE2INCL.
    INCLUDE EXCEL__C.
    AND
             H_EXCEL TYPE OLE2_OBJECT,        " Excel object
              H_MAPL  TYPE OLE2_OBJECT,         " list of workbooks
              H_MAP   TYPE OLE2_OBJECT,          " workbook
              H_ZL    TYPE OLE2_OBJECT,           " cell
              H_F     TYPE OLE2_OBJECT,            " font
              H       TYPE I.
    AND
      PERFORM SUB_GET_DATA.
         'get data here
      PERFORM SUB_POP_DATA.
         'populate data here
    AND
      PERFORM SUB_DISP_EXCEL.
    *&      Form  SUB_DISP_EXCEL
    FORM SUB_DISP_EXCEL.
       START EXCEL
      CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
    SET PROPERTY OF H_EXCEL  'Visible' = 1.    " for printing o/p line by line in excel sheet
    get list of workbooks, initially empty
      CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1  1 1   10  'Mat Doc Number'(001) 'R'.
      PERFORM FILL_CELL USING 1  2 1    4  'Item'(002) 'R'.
      PERFORM FILL_CELL USING 1  3 1   10  'Mat Doc Date'(003) 'R'.
      PERFORM FILL_CELL USING 1  4 1   10  'Vendor'(004) 'R'.
      PERFORM FILL_CELL USING 1  5 1   20  'Mat Doc Item amount'(005) 'R'.
      PERFORM FILL_CELL USING 1  6 1   15  'Material price'(006) 'R'.
      PERFORM FILL_CELL USING 1  7 1    4  'Currency'(007) 'R'.
      PERFORM FILL_CELL USING 1  8 1   18  'Material'(008) 'R'.
      PERFORM FILL_CELL USING 1  9 1   30  'Material Desc'(009) 'R'.
      PERFORM FILL_CELL USING 1 10 1   19  'Qty in Unit of Entry'(010) 'R'.
      PERFORM FILL_CELL USING 1 11 1   19  'Qty Received'(011) 'R'.
      PERFORM FILL_CELL USING 1 12 1    4  'Unit of Entry'(012) 'R'.
      PERFORM FILL_CELL USING 1 13 1   20  'Mat Group'(013) 'R'.
      PERFORM FILL_CELL USING 1 14 1   16  'Vendor Invoice'(016) 'C'.
      LOOP AT T_OUT INTO W_OUT.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H  1 0 10 W_OUT-MBLNR 'R'.
        PERFORM FILL_CELL USING H  2 0  4 W_OUT-ZEILE 'R'.
        PERFORM FILL_CELL USING H  3 0 10 W_OUT-BLDAT 'R'.
        PERFORM FILL_CELL USING H  4 0 10 W_OUT-LIFNR 'R'.
        PERFORM FILL_CELL USING H  5 0 20 W_OUT-DMBTR 'R'.
        PERFORM FILL_CELL USING H  6 0 15 W_OUT-NETPR 'R'.
        PERFORM FILL_CELL USING H  7 0  4 W_OUT-WAERS1 'R'.
        PERFORM FILL_CELL USING H  8 0 18 W_OUT-MATNR 'R'.
        PERFORM FILL_CELL USING H  9 0 30 W_OUT-MAKTX 'R'.
        PERFORM FILL_CELL USING H 10 0 19 W_OUT-ERFMG 'R'.
        PERFORM FILL_CELL USING H 11 0 19 W_OUT-WEMNG 'R'.
        PERFORM FILL_CELL USING H 12 0  4 W_OUT-ERFME 'R'.
        PERFORM FILL_CELL USING H 13 0 20 W_OUT-WGBEZ 'R'.
        PERFORM FILL_CELL USING H 14 0 16 W_OUT-XBLNR 'C'.
        CLEAR W_OUT.
      ENDLOOP.
    CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTIN    G #1 = 2.
      SET PROPERTY OF H_EXCEL  'Visible' = 1.
      PERFORM ERR_HDL USING 'Unable to create workbook'.
    add a new workbook
    CALL METHOD OF H_MAPL 'Add' = H_MAP  EXPORTING #1 = 2. "----------can remove-------THIS IS FOR STAY AT LIST
      PERFORM ERR_HDL USING 'Unable to create new workbook'..
      FREE OBJECT H_EXCEL.
      PERFORM ERR_HDL USING 'Unable to free workbook'.
    ENDFORM.                    " SUB_DISP_EXCEL
          FORM FILL_CELL                                                *
          sets cell at coordinates i,j to value val boldtype bold       *
    FORM FILL_CELL USING I J BOLD COL VAL I_HORIZON_ALIGN.
      CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
      PERFORM ERR_HDL USING 'set cell object error'.
      SET PROPERTY OF H_ZL 'Value' = VAL .
      PERFORM ERR_HDL USING 'set value  object error'.
      GET PROPERTY OF H_ZL 'Font' = H_F.
      PERFORM ERR_HDL USING 'set font  object error'.
      SET PROPERTY OF H_F 'Bold' = BOLD .
      PERFORM ERR_HDL USING 'set bold  object error'..
      SET PROPERTY OF H_ZL 'ColumnWidth' = COL.
      PERFORM ERR_HDL USING 'set columnwidth object error'.
      IF NOT I_HORIZON_ALIGN IS INITIAL.
      IF I_HORIZON_ALIGN = 'L'.
      SET PROPERTY OF H_ZL 'HorizontalAlignment' = XLLEFT.
      ELSEIF I_HORIZON_ALIGN = 'R'.
      SET PROPERTY OF H_ZL 'HorizontalAlignment' = XLRIGHT.
      ELSEIF I_HORIZON_ALIGN = 'C'.
      SET PROPERTY OF H_ZL 'HorizontalAlignment' = XLCENTER.
      ENDIF.
      ENDIF.
      PERFORM ERR_HDL USING 'set Alignment object error'.
    ENDFORM.                    "FILL_CELL
    *&      Form  ERR_HDL
          outputs OLE error if any                                       *
    -->  p1        text
    <--  p2        text
    FORM ERR_HDL USING VAL.
      IF SY-SUBRC <> 0.
        WRITE: / VAL.
        STOP.
      ENDIF.
    ENDFORM.                    " ERR_HDL

  • How to generate my report in HTML format

    Hi
    I am using Forms and reports 6i . How to generate a report in Html format.
    Please explain what are the option available in reports and the way to do
    thanks in advance
    prasanth a.s.

    *specify  desformat=html  in cmd line
    refer
    * Forms Reports integration 6i
    http://otn.oracle.com/products/forms/pdf/277282.pdf
    [    All Docs for all versions    ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf
    ---------------------------------------------------------------------------------

  • How to Export SSRS report into Excel format using query string

    Hello all,
    I am new to SSRS world.
    Last night i was trying to add a hyperlink  on the SSRS report (.rdl) file, by clicking which we can export the report into "Excel" format, but with no luck.
    Can anybody tell me how to form the hyperlink, so that we can export the report with its current content ( I mean the report content generated by selecting some parameter values)

    Hi Suman85,
    Based on your scenario, you want to add a link on the SSRS report file, and then click it you can export the report into “Excel” format.
    Just as kishan1901 said , you can add a textbox to your report and type in the words “Click here and export the report
    to excel” .Then right-click the textbox and select Properties. Switch to Navigation tab, click the radiobutton of ‘Jump to URL’ and type in the expression ,here is just a example:
     ="http://vyof1884200/ReportServer$youhoo?/My+Adventure+Works/Product+Sales+and+Profitability+by+Month&rs:Command=Render&rs:Format=excel"
    Then preview the report ,you will see
    Click here and export the report to excel 
    when you move the mouse to it ,the mouse will become a hand ,then left-click, it will jump out a dialog box to indicate user whether the excel file should be saved , opened or canceled. 
    I think this is what you want, if you have any further requirement, could you please describe it in more detail? We would give you some resolution or workaround.
    Regards,
    Challen Foo

  • Issue while exporting the report to other formats

    When the rpt file created in the BO server is used to view the report through the report viewer, there are export options available to choose from. If this export option is tried as MSExcel or Word document, the alignment, page headers and all are not coming in the same way like in the one generated through the PDF.

    Hi aparmar,
    Which version of the Crystal Report and Business Objects you are using?
    Which SDK's you are using in your application to export the report to RTF format?
    Also if you are using JRC in your application, you can follow the given link:
    Font size in exported report
    I hope the above link might be helpful.
    Please revert if you need any other information.
    Regards,
    Anchal

  • Urgent Help. How to send the email in HTML format in Version 4.6c

    Hi,
      Please help me how to send a mail in HTML format with logo and specified format. Is it possible to send the SAPscript or Smartform in HTML format to external mail address.  The logo and the format is very important in this e-mail.
      quick response will help me better.
    Regards,
    Naidu

    Here is a sample program which emails HTML in the body.  Of course you can put an HTML tag in there that would point to the logo on some server(internet).  Notice we are just putting the HTML code in the MAILTXT table,  This is how we do it at my company.
    report zrich_0002.
    data: maildata   like sodocchgi1.
    data: mailtxt    like solisti1 occurs 10 with header line.
    data: mailrec    like somlrec90 occurs 0  with header line.
    start-of-selection.
      clear:    maildata, mailtxt,  mailrec.
      refresh:  mailtxt, mailrec.
      perform build_text_message.
      perform build_receivers.
      perform send_mail_nodialog..
    *      Form  BUILD_TEXT_MESSAGE
    form build_text_message.
      maildata-obj_name = 'TEST'.
      maildata-obj_descr = 'Test Subject'.
      mailtxt  = '<html>'.
      append mailtxt.
      mailtxt  = '<head>'.
      append mailtxt.
      mailtxt  = '<title>Untitled Document</title>'.
      append mailtxt.
      mailtxt  = '<meta http-equiv="Content-Type" content="text/html;'.
      append mailtxt.
      mailtxt  = 'charset=iso-8859-1">'.
      append mailtxt.
      mailtxt  = '</head>'.
      append mailtxt.
      mailtxt  = '<body>'.
      append mailtxt.
      mailtxt  = '<div align="center"><em><font' .
      append mailtxt.
      mailtxt  = 'color="#0000FF" size="+7" face="Arial,'.
      append mailtxt.
      mailtxt  = 'Helvetica, sans-serif">THIS'.
      append mailtxt.
      mailtxt  = '  IS A TEST </font></em><font' .
      append mailtxt.
      mailtxt  = 'color="#0000FF" size="+7" face="Arial,'.
      append mailtxt.
      mailtxt  = 'Helvetica, sans-serif"></font>'.
      append mailtxt.
      mailtxt  = '</div>'.
      append mailtxt.
      mailtxt  = '</body>'.
      append mailtxt.
      mailtxt  = '</html>'.
      append mailtxt.
    endform.
    *      Form  BUILD_RECEIVERS
    form build_receivers.
    *  mailrec-receiver = '[email protected]'.
      mailrec-rec_type  = 'U'.
      append mailrec.
    endform.
    *      Form  SEND_MAIL_NODIALOG
    form send_mail_nodialog.
      call function 'SO_NEW_DOCUMENT_SEND_API1'
           exporting
                document_data              = maildata
                document_type              = 'HTM'
                put_in_outbox              = 'X'
           tables
                object_header              = mailtxt
                object_content             = mailtxt
                receivers                  = mailrec
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                others                     = 8.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.
    Regards,
    Rich Heilman

  • How to create the report in given format???

    Hi there,
    My table view gets the report in this format.
    Unit -----Report-----Sum
    u1----------A---------s1
    u1----------B---------s2
    u2----------A---------s3
    u2----------B---------s4
    U3----------A---------s5
    U3----------B---------s6
    I need report in the format:
    Unit------Report A------Report B-----Percent
    U1----------s1----------------s2-------------(s1/s2)*100 %
    U2----------s3----------------s4-------------(s3/s4)*100 %
    U3----------s5----------------s6-------------(s5/s6)*100 %
    I need conditional formating in percentage column where column cell turns green for > 98% and red for <= 98%.
    I used pivot table and used new calculated item to create percent column but I'm not able to do conditional formating there and append % sign.
    Is there any other method where I can create logical column in RPD side.
    Please advice

    hi,
    Here is the way to achieve the conditional formatting in pivot table i didn't tried out this :-)...
    http://itnewscast.com/middleware/obiee-pivot-conditional-format-grand-total-part-2
    thanks,
    saichand

  • How to decide the no.of models required for our application implemention

    Hi ,
    i ahve one basic quetion in WD development.
    how to decide the no.of models (aRFC ,EJB..etc )  required or needed to get the functionality of our application ?
    for Ex:
    my application consisits of belwo functionalities.
    1. serach for the country
    2.display the bank lis for the above country
    3.display the bank details of the selected bank in the step no.2
    any one of you explain me how to decide the no.of models required for avoe functionalities .
    or is it  in a single model  we can include the all the above functionalities ?
    Regards,
    Govindu

    Hi
    It all depends on application to application and requirements better to consult with functional guys or team lead what exectly they want to implement .All could be possible with RFC or EJB , some alternatives are
    1. serach for the country  :  For this standard java API is there which populate all country (no need any rfc or ejb)
    2.display the bank lis for the above country : (Check if there  any webservices for this or create manually value help for this , even if u will use the RFC abaper guys will do the same )
    3.display the bank details of the selected bank in the step no : step 2 will solve this also with one additional field i.e address and details.
    I hope you agree with the point that stand alone WD app can do these all thing without any model.
    Best Regards
    Satish Kumar

  • How to view deski report in html format ?

    Hi,
    I use BO XI R2. I use jsp.
    I just want to know how to view deski report in a html format.
    thanks a lot.
    hatoug

    Since you're using JSP, please post to the Java support forum:
    Java SDK Application Development
    or
    SAP Crystal Reports, version for Eclipse

  • How to export the report to Excel in Essbase

    I have to export a report in exce from Web Analysis.
    I am selecting the option Send to Excel given in services but when I am clicking to Export Pop up appears with message "Could not Export to File"
    Thanks

    Hi Ojha,
    You wish to export to an excel page from a web analysis report.
    When you select "send to excel" as one of the options of the "services", a lable named "send to excel " appears on your report(you can give a desired name of this label/buttion) , then come out of the "designer" mode and click on the buttion "send to excel"( or the buttion which you had just made by providing a name).
    If you are doing this ,then a new excel should open .
    Hope you dont have any problem with your microsoft excel too .It might not be the reason, but re check that too.
    Sandeep Reddy Enti
    HCC
    http://analytiks.blogspot.com

  • How to create the IView and Roles ,User for WebdynPro Application in Portal

    Hi,
           I have one simple webdynpro application. i want to create the user,Role and Iview for my webdynpro application in the Portal . after that i need to assign the roles to the user and i want to see the different output for each user depends upon the Role.
      Can anyone give me Tutorial page(PDF) or Guide me How to do?
             Thanks in Advance
    Regards
    Ramkumar

    Hello Ramkumar,
    following please find the link to available documentation in SAP Help Portal:
    http://help.sap.com/saphelp_nw70/helpdata/en/42/fa080514793ee6e10000000a1553f7/frameset.htm.
    Regards,
    SAP AG
    Gesine Raith

  • How to export a report in .xls format

    <p><font face="arial,helvetica,sans-serif" size="2">For my current project I have to take existing Crystal Report files and export them into Excel.  I cannot use a .csv file, it has to be a .xls file in order to preserve the formatting.  Does the Crystal plugin for Eclipse support this feature?  I know it can export to .csv but how do I export to .xls?                                        </font><font face="arial,helvetica,sans-serif" size="2">Thanks in Advance, </font><font face="Arial" size="2">Dave Amundsen</font></p>

    <p>Hi Dave,</p><p>       Unfortunately this feature is not currently supported with the Java engine which ships with Crystal Reports for Eclipse. There is a thread under the Feedback/Enhancement Requests section of the Forum where I would encourage you to add your opinions. You can find the thread here:</p><p><a href="/node/642"><u><strong>http://diamond.businessobjects.com/node/642 </strong></u></a></p><p>The only solution I can offer at this time is to look at one of our server solutions (e.g. Crystal Reports Server) if you need formatted Excel exporting with your Crystal Reports files. From what I hear, converting our existing Excel export functionality to a 100% Java environment requires a sizeable development effort, which is why we were not able to get this feature into the initial release of Crystal Reports for Eclipse.</p><p>If you are interested in more information around our Crystal Reports Server product or wish to download a free trial of the product, check out this link:</p><p><a href="http://www.businessobjects.com/products/reporting/crystalreports/server/default.asp"><u><strong>http://www.businessobjects.com/products/reporting/crystalreports/server/default.asp</strong></u></a>  <br /></p><p>I should also mention that our server solutions do come with a complete Java SDK, which has a very similar object model to the one used by the Java Reporting Component shipped with Crystal Reports for Eclipse. </p><p>Regards,<br />Sean Johnson (CR4E Product Manager) </p>

  • Desktopintelligence report in HTML format

    Hello Gurus,
    I have to schedule a Deski report in HTML format. But when I schedule the report, the html format will will be saved in 'section by section' mode automatically.
    Waht properties should I change to save in 'All in one page' mode?
    Thanks,
    Naveen
    Edited by: NR on Apr 30, 2009 8:33 PM

    Hi Naveen,
                      Even I am facing a similar problem while exporting the reports to HTML format. All the sections in the report appear on different pages,and there's no option for getting them on a single page. As of now, there does'nt seem to be a direct solution for this issue, however, I got rid of this problem by using 'Breaks' in my report instead of 'Sections'. For example, if you are having a report which displays section-wise data, and you have applied the section on say, 'Cities' (which means you will get the city-wise data). You can remove the section and drag the 'City' field into the table, and then apply a break on it. You may also enable the option of 'Centre Value Across Break' which would give the report a better look.
    Regards,
    Alok.

  • Exporting Crystal Report to HTML is not working in Windows 7

    Hi Sir,
    I am trying to export Crystal Report to HTML format using VB.NET code. Functionality is working fine at Windows XP Environment (Save to Disk, Open an Application and Email Attachment). But the same functionality is not working at Windows 7 Environment (both 32-Bit as well as 64-Bit).
    Below is the code to Exporting Crystal Report to HTML in VB.NET.
    Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions
    Dim CrFormatTypeOptions          As New HTMLFormatOptions
    Dim vFormat As Integer
    Dim CrExportOptions As New ExportOptions
    Dim vRdReport As New ReportDocument
    Dim sfd As SaveFileDialog
    Dim vFileName As String = Nothing
    vRdReport = vRptSource
    sfd = New SaveFileDialog
    If Not (vRptPath = "") Then
        sfd.InitialDirectory = vRptPath
    End If
    sfd.Filter = "Webpage, Complete(.htm;.htm)|.htm|Web Archive, Single file(.mht)|.mht|Webpage, HTML only(.htm;.html)|.html"
    If sfd.ShowDialog = DialogResult.OK Then
        ' Set the disk file options.
         CrDiskFileDestinationOptions.DiskFileName = sfd.FileName.ToString()
    Else
         Return
    End If
    CrExportOptions = vRdReport.ExportOptions
    CrFormatTypeOptions.HTMLFileName = vFileName
    CrFormatTypeOptions.HTMLEnableSeparatedPages = True
    CrFormatTypeOptions.HTMLEnableSeparatedPages = True
    CrFormatTypeOptions.HTMLHasPageNavigator = True
    CrFormatTypeOptions.UsePageRange = True
    With CrExportOptions
                        .ExportDestinationType = ExportDestinationType.DiskFile
                        .ExportFormatType = ExportFormatType.HTML32
                        .DestinationOptions = CrDiskFileDestinationOptions.DiskFileName
                        .FormatOptions = CrFormatTypeOptions
    End With
    vRdReport.Export()
    Catch ex As Exception
            MsgBox(ex.ToString)
    End Try
    Code working fine at Windows XP, But it is not woking in Windows 7 environment.
    Please can anyone share your valuable thoughts or ideas reg. this.
    Thanks in Advance
    Deivanayaga Perumal D.

    user13509659 wrote:
    Run this code to reproduce the issue.Which issue?
    It looks like inheritance is broken in the component hierarchy for JFrame in Windows 7 JDK 1.6.0_23-b05. The only thing remotely related to inheritance in your code snippet is the WindowListener, which does little. See camickr's advice about built-in exit management.
    EDIT - using the post title as a clue, I realize you may be talking about the component hierarchy, and whether the contentPane's background is visible through the upper layers. Instead of guessing, I'd prefer you describe your "issue" accurately (observed vs expected behavior).
    Edited by: jduprez on Feb 10, 2011 1:01 PM

  • How to get a report in pdf format.

    Hi Experts,
    Could any one let me know that, how to get the report in PDF format.
    Once a report is generated it should be displayed in pdf format or downloaded in pdf format.
    Thanks in Advance,
    Regards,
    Irfan Hussain

    Hi,
    Check out this code:
    REPORT  zspooltopdf.
    PARAMETER: p_email1 LIKE somlreci1-receiver
                                        DEFAULT '[email protected]',
               p_sender LIKE somlreci1-receiver
                                        DEFAULT '[email protected]',
               p_delspl  AS CHECKBOX.
    *DATA DECLARATION
    DATA: gd_recsize TYPE i.
    * Spool IDs
    TYPES: BEGIN OF t_tbtcp.
            INCLUDE STRUCTURE tbtcp.
    TYPES: END OF t_tbtcp.
    DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
          wa_tbtcp TYPE t_tbtcp.
    * Job Runtime Parameters
    DATA: gd_eventid LIKE tbtcm-eventid,
          gd_eventparm LIKE tbtcm-eventparm,
          gd_external_program_active LIKE tbtcm-xpgactive,
          gd_jobcount LIKE tbtcm-jobcount,
          gd_jobname LIKE tbtcm-jobname,
          gd_stepcount LIKE tbtcm-stepcount,
          gd_error    TYPE sy-subrc,
          gd_reciever TYPE sy-subrc.
    DATA:  w_recsize TYPE i.
    DATA: gd_subject   LIKE sodocchgi1-obj_descr,
          it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          gd_sender_type     LIKE soextreci1-adr_typ,
          gd_attachment_desc TYPE so_obj_nam,
          gd_attachment_name TYPE so_obj_des.
    * Spool to PDF conversions
    DATA: gd_spool_nr LIKE tsp01-rqident,
          gd_destination LIKE rlgrap-filename,
          gd_bytecount LIKE tst01-dsize,
          gd_buffer TYPE string.
    * Binary store for PDF
    DATA: BEGIN OF it_pdf_output OCCURS 0.
            INCLUDE STRUCTURE tline.
    DATA: END OF it_pdf_output.
    CONSTANTS: c_dev LIKE  sy-sysid VALUE 'DEV',
               c_no(1)     TYPE c   VALUE ' ',
               c_device(4) TYPE c   VALUE 'LOCL'.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * Write statement to represent report output. Spool request is created
    * if write statement is executed in background. This could also be an
    * ALV grid which would be converted to PDF without any extra effort
      WRITE 'Hello World'.
      new-page.
      commit work.
      new-page print off.
      IF sy-batch EQ 'X'.
        PERFORM get_job_details.
        PERFORM obtain_spool_id.
    *** Alternative way could be to submit another program and store spool
    *** id into memory, will be stored in sy-spono.
    *submit ZSPOOLTOPDF2
    *        to sap-spool
    *        spool parameters   %_print
    *        archive parameters %_print
    *        without spool dynpro
    *        and return.
    * Get spool id from program called above
    *  IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
        PERFORM convert_spool_to_pdf.
        if p_delspl EQ 'X'.
          PERFORM delete_spool.
        endif.
        IF sy-sysid = c_dev.
          wait up to 5 seconds.
          SUBMIT rsconn01 WITH mode   = 'INT'
                          WITH output = 'X'
                          AND RETURN.
        ENDIF.
      ELSE.
        SKIP.
        WRITE:/ 'Program must be executed in background in-order for spool',
                'request to be created.'.
      ENDIF.
    *       FORM obtain_spool_id                                          *
    FORM obtain_spool_id.
      CHECK NOT ( gd_jobname IS INITIAL ).
      CHECK NOT ( gd_jobcount IS INITIAL ).
      SELECT * FROM  tbtcp
                     INTO TABLE it_tbtcp
                     WHERE      jobname     = gd_jobname
                     AND        jobcount    = gd_jobcount
                     AND        stepcount   = gd_stepcount
                     AND        listident   <> '0000000000'
                     ORDER BY   jobname
                                jobcount
                                stepcount.
      READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
      IF sy-subrc = 0.
        message s004(zdd) with gd_spool_nr.
        gd_spool_nr = wa_tbtcp-listident.
        MESSAGE s004(zdd) WITH gd_spool_nr.
      ELSE.
        MESSAGE s005(zdd).
      ENDIF.
    ENDFORM.
    *       FORM get_job_details                                          *
    FORM get_job_details.
    * Get current job details
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
           IMPORTING
                eventid                 = gd_eventid
                eventparm               = gd_eventparm
                external_program_active = gd_external_program_active
                jobcount                = gd_jobcount
                jobname                 = gd_jobname
                stepcount               = gd_stepcount
           EXCEPTIONS
                no_runtime_info         = 1
                OTHERS                  = 2.
    ENDFORM.
    *       FORM convert_spool_to_pdf                                     *
    FORM convert_spool_to_pdf.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount            = gd_bytecount
           TABLES
                pdf                      = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
      CHECK sy-subrc = 0.
    * Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att = gd_buffer.
        APPEND it_mess_att.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.
    *       FORM delete_spool                                             *
    FORM delete_spool.
      DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
      ld_spool_nr = gd_spool_nr.
      CHECK p_delspl <> c_no.
      CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
           EXPORTING
                spoolid = ld_spool_nr.
    ENDFORM.
    Regards,
    Gayathri

Maybe you are looking for

  • Itunes causing Blue Screen of Death on Windows 7

    Every time I open Itunes 9 it eventually crashes my computer and takes me to the Blue Screen of Death. I recently updated from vista to Windows 7. I've reinstalled itunes repeatedly and tried both 32 and 64-bit installs. Any suggestions would be very

  • How do I upgrade from 10.5.8 to Snow Leopard??

    My apologies if this answer can be found elsewhere, but I don't know where else to turn.   How can I upgrade from OS 10.5.8 to snow leopard so THEN I can update to Lion? Can't do anything unless I already have 10.6 or higher and I don't. Now what?  E

  • How to automatically login to apex and run a specific page / application

    Hi all. I'd like to know if there is a way of automatically login to apex and run a specific page / application. I mean, invoke browser and pass the necessary information to login (not public user) and run a specific application( ina secure way if po

  • IPhoto Version Issue

    Have been using iPhoto 08, and am now suddenly receiving this error message: You can't open your current photo library using this version of iPhoto. You have made changes to your photo library using a newer version of iPhoto. Please quit and use the

  • Change my home screen?

    How can I change my home screen (menu)? I cannot buy this software thing for $19.99. Can I get it some other way?