Report In Excel class

Good afternoon,
I am creating a test program that detects if Excel is open. I used the TaskList command line of the System Exec.vi to give me a list of processes that are currently running, then doing a search on excel.exe using the Search and Replce feature  I am using the offset past replacement indicator wired to a greater than 0 primitive to determine if Excel is indeed running.
If the primitive returns false, I can open the file using the New Report.vi with the templete contntrol wired in. If it returns true, I'd like it to see if the Workbook is loaded and if not, load it. But I can't seem to get the NI Report labview class wire right, most likely because I do not know how ti generate it.. Does anyone know how to generate this wire or am I just overthinking things here? My VI is attached.
Solved!
Go to Solution.
Attachments:
TaskIsRunning.vi ‏14 KB

I am not sure that you will be able to do what you want to do.
http://www.ni.com/white-paper/3179/en/
You might want to consider just closing Excel if is opened.
One way is to use LabVIEW's .NET pallete to detect whether Excel is running.
http://msdn.microsoft.com/en-us/library/1f3ys1f9%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=vb#code-s...
Then close that process.

Similar Messages

  • Issue while exporting report in Excel Format

    Hello,
    I am facing problem while exporting the report in Excel Format. After analysis, I think that it could be due to two reasons, either we are using wrong versions of Jars, or we are using wrong API. Here is the code, approaches and problems we are facing. Please help.
    First approach we are using is:
    // using basic API
    import com.crystaldecisions.reports.sdk.ReportClientDocument;
    // get client document from crystal report API and open the report by specifying the report name, with path
                   ReportClientDocument reportClientDoc = new ReportClientDocument();
                   reportClientDoc.open( reportPath, 0 );
                   // give chance to extending classes to configure the report document by POJO or by sql parameter etc, just adding the parameters infromation using ParameterFieldController
                   configureReportDocument( reportClientDoc, reportMetadata, reportData, reportContext );
                   // get data source of crystal report
                   Object reportSource = reportClientDoc.getReportSource();
                   // export the data - we have also tried with MSExcel format
                   ReportExportFormat exportFormat =  ReportExportFormat.recordToMSExcel;
                   LOGGER.debug( "exportFormat[" + exportFormat + "]" );
                   ByteArrayInputStream byteArray = (ByteArrayInputStream) reportClientDoc.getPrintOutputController().export(
                             exportFormat );
    Problem Faced: Specified Excel format is not supported.
    Second Approach: We come to know that excel format is supported with new releases and with occa package.
    Then we tried with import com.crystaldecisions.sdk.occa.report.application.ReportClientDocument; It ask to set the ReportServer. When we are trying to set the server as
                   reportClientDoc.setReportAppServer(ReportClientDocument.inprocConnectionString);
    Application is unable to find 'ReportClientDocument.inprocConnectionString' property. It seems like we are using some old jars. However we have downloaded the latest released jars for eclipse 2.
    Please help for it. Issue is to export the report in excel format, which is currently working fine for PDF. If this problem is related to Jars, please suggest the path to download the latest jars. We also looking for the latest jars like rasapp and rascore etc. But these are not available with Crystal Report for Eclipse 2 release.
    Waiting for urgent help. Thanks you..
    Regards,
    Mohit

    Hi,
    Send me Environment Details .
    Here is the code  snippet for exporting report to excel format:
    <%@ page import="com.crystaldecisions.sdk.occa.report.application.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.definition.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.data.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.*" %>
    <%@ page import="com.crystaldecisions.sdk.framework.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.managedreports.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.infostore.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.exportoptions.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.io.*" %>
    <%
    String username ="Administrator";
    String password ="";
    String cmsname ="localhost:6400";
    String Authen ="secEnterprise";
         //connecting to Enterprise
         IEnterpriseSession es = CrystalEnterprise.getSessionMgr().logon(username,password,cmsname,Authen);
         //get the report App Factory form the Crystal Enterprise
         IReportAppFactory appFactory = (IReportAppFactory) es.getService("","RASReportService");
         //get the infostore service form the Crystal Enterprise
         IInfoStore istore = (IInfoStore) es.getService("","InfoStore");
         //get the report by name from crystal Enterprise
         IInfoObjects iobjects = istore.query("Select * From CI_INFOOBJECTS Where SI_NAME = 'sampleramz2.rpt' and SI_INSTANCE = 0 ");
         //open the report in the report doc object.
         ReportClientDocument Doc = appFactory.openDocument((IInfoObject)iobjects.get(0), 0, Locale.ENGLISH);
         // WORKING WITH THE PRINT OUTPUT CONTROLLER
         //Use the report documents PrintOutputController to export the report to a ByteArrayInputStream
         ByteArrayInputStream byteIS = (ByteArrayInputStream)Doc.getPrintOutputController().export(ReportExportFormat.recordToMSExcel);
         // EXPORTING THE REPORT
         //Create a byte[] (same size as the exported ByteArrayInputStream)
         byte[] buf = new byte[2000 * 1024];
         int nRead = 0;
         //Set response headers to indicate pdf MIME type and inline file
         response.reset();
         response.setHeader("Content-disposition", "inline;filename=ramz");
         response.setContentType("application/xls");
         //Send the Byte Array to the Client
         while ((nRead = byteIS.read(buf)) != -1)
              response.getOutputStream().write(buf, 0, nRead);
         //Flush the output stream
         response.getOutputStream().flush();
         //Close the output stream
         response.getOutputStream().close();
    %>
    Let me know any information is needed,
    Regards,
    Rameez

  • How to send ALV Report in excel format from SAP

    Hi Gurus,
    We are using SAP 4.7 and using different SAP reports.Now I want to send SAP ALV report in excel format directly from SAP in background.Now we send these reports in background weekly by using autimetic scheduling but this is PDF format.Now I want to change this pdf format to excel format.In SCOT T.Code I am able to find any excel format.Please help me out.
    I am waiting for your reply.
    Advance Thanks
    Nirmal

    Hi Nirmal,
    I have done the same in my previous organisation.For this particular solution you need to ask your basis guys to upgrade the support package so that BCS classes could be available in the system.
    API interafces five some problem with attachemnts and SAP has recommended to use BCS classes.
    Currently BCS classes won't be availbale in 4.7.
    Once the BCS classes are available
    use below code
       CONSTANTS:
        lc_tab          TYPE c VALUE cl_bcs_convert=>gc_tab,
        lc_crlf         TYPE c VALUE cl_bcs_convert=>gc_crlf,
       lc_codepage     TYPE abap_encod VALUE '4103',
    data :
       lv_string      TYPE string,
       binary_content TYPE solix_tab,
       size           TYPE so_obj_len,
       *" Set Heading of Excel File
      CONCATENATE 'Employee DATA'
                   lc_crlf lc_crlf
                   INTO lv_string.
       *" Set Header for Excel Fields
      CONCATENATE lv_string
                  lc_header1 lc_tab
                  lc_header2 lc_tab
                  lc_header3 lc_tab
                  lc_header4 lc_tab
                  lc_header5 lc_tab
                  lc_header6 lc_tab
                  lc_header7 lc_tab
                  lc_header8 lc_tab
                  lc_header9 lc_tab
                  lc_header10 lc_crlf
                  INTO lv_string.
    "lc_header1 to 10 could be your field headers
       "Move Internal table data
      LOOP AT gt_final1 INTO gwa_final1.
        CONCATENATE lv_string
                    gwa_final1-field1     lc_tab
                    gwa_final1-field2      lc_tab
                    gwa_final1-field3    lc_crlf
                    INTO lv_string.
      ENDLOOP.
       *" convert the text string into UTF-16LE binary data including
    *" byte-order-mark. Mircosoft Excel prefers these settings
    *" all this is done by new class cl_bcs_convert (see note 1151257)
      TRY.
          cl_bcs_convert=>string_to_solix(
            EXPORTING
              iv_string   = lv_string
              iv_codepage = lc_codepage  "suitable for MS Excel, leave empty
              iv_add_bom  = abap_true     "for other doc types
            IMPORTING
              et_solix  = binary_content
              ev_size   = size ).
        CATCH cx_bcs.
          MESSAGE e445(so).
      ENDTRY.
      TRY.
    *" create persistent send request
          send_request = cl_bcs=>create_persistent( ).
          document = cl_document_bcs=>create_document(
            i_type    = lc_doc
            i_text    = main_text
            i_subject = lc_sub  ).     
          document->add_attachment(
            i_attachment_type    = lc_attach                    "#EC NOTEXT
            i_attachment_subject = lc_sub                       "#EC NOTEXT
            i_attachment_size    = size
            i_att_content_hex    = binary_content ).
       send_request->set_document( document ).
       recipient = cl_cam_address_bcs=>create_internet_address( email ).
       CALL METHOD send_request->add_recipient
              EXPORTING
                i_recipient = recipient.
       IF recipient IS NOT INITIAL.
            sent_to_all = send_request->send( i_with_error_screen = abap_true ).
            COMMIT WORK.
    *        MESSAGE text-014 TYPE gc_succ  .
          ENDIF.
        CATCH cx_bcs INTO bcs_exception.
          MESSAGE i865(so) WITH bcs_exception->error_type.
      ENDTRY.
    For BCS decalartion u can go to se 38 and see program BCS_EXAMPLE_1 to BCS_EXAMPLE_7.
    Rewrads if helpful.
    Cheers
    Ramesh Bhatt

  • OBIEE - export report in Excel format on daily basis into shared folder

    Hi all,
    We are in process of moving from SAP Business Objects to Oracle BI EE and now the question is:
    how do I set schedule to export specified report in Excel format into shared network folder?
    I can do it easily in SAP BO.
    Is it possible at all in OBIEE?

    Check this
    http://oraclebizint.wordpress.com/2007/12/17/oracle-bi-ee-101332-calling-java-scripts-and-java-classes-from-ibots/
    Use JavaScript part that is more simple and easiest one.

  • Output of report in excel and sending thatexcel as mail

    Hi all,
    I need to send a mail which contain the output of a report in excel sheet.
    Please tell me how to do this or of having plese give the sample code
    Regards
    Ajay

    hi check this..
    REPORT  ZMAIL.
    TABLES: ekko.
    PARAMETERS: p_email   TYPE somlreci1-receiver.
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
          wa_ekpo TYPE t_ekpo.
    TYPES: BEGIN OF t_charekpo,
      ebeln(10) TYPE c,
      ebelp(5)  TYPE c,
      aedat(8)  TYPE c,
      matnr(18) TYPE c,
    END OF t_charekpo.
    DATA: wa_charekpo TYPE t_charekpo.
    DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
            t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            w_cnt TYPE i,
            w_sent_all(1) TYPE c,
            w_doc_data LIKE sodocchgi1,
            gd_error    TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
    *START_OF_SELECTION
    START-OF-SELECTION.
      Retrieve sample data from table ekpo
      PERFORM data_retrieval.
      Populate table with detaisl to be entered into .xls file
      PERFORM build_xls_data_table.
    *END-OF-SELECTION
    END-OF-SELECTION.
    Populate message body text
      perform populate_email_message_body.
    Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_message
                                          it_attach
                                    using p_email
                                          'Example .xls documnet attachment'
                                          'XLS'
                                          'filename'
                                 changing gd_error
                                          gd_reciever.
      Instructs mail send program for SAPCONNECT to send email(rsconn01)
      PERFORM initiate_mail_execute_program.
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp aedat matnr
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekpo.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  BUILD_XLS_DATA_TABLE
          Build data table for .xls document
    FORM build_xls_data_table.
      data: ld_store(50) type c.  "Leading zeros
      CONSTANTS: con_cret(5) TYPE c VALUE '0D',  "OK for non Unicode
                 con_tab(5) TYPE c VALUE '09'.   "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    *constants:
       con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
       con_cret type c value cl_abap_char_utilities=>CR_LF.
      CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR' INTO it_attach SEPARATED BY con_tab.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
      LOOP AT it_ekpo INTO wa_charekpo.
    *Modification to retain leading zeros
      inserts code for excell REPLACE command into ld_store
      =REPLACE("00100",1,5,"00100")
        concatenate '=REPLACE("' wa_charekpo-ebelp '",1,5,"'
                                 wa_charekpo-ebelp '")' into ld_store .
      concatenate ld_store into .xls file instead of actual value(ebelp)
        CONCATENATE wa_charekpo-ebeln ld_store  wa_charekpo-aedat wa_charekpo-matnr  INTO it_attach SEPARATED BY con_tab.
        CONCATENATE con_cret it_attach  INTO it_attach.
        APPEND  it_attach.
      ENDLOOP.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    FORM send_file_as_email_attachment tables pit_message
                                              pit_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = pit_attach[].
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_receivers
           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.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
           Populate message body text
    form populate_email_message_body.
      REFRESH it_message.
      it_message = 'Please find attached a list test ekpo records'.
      APPEND it_message.
    endform.                    " POPULATE_EMAIL_MESSAGE_BODY

  • Need to convert AP Invoice Aging Report in Excel format

    Hi,
    Need to convert AP Invoice Aging Report in excel format..there was an existing Invoice Aging report in AP and that was in paper format. That we need to convert to rtf template..
    There was an other concurrent program called 'Invoice Aging Report (XML) - Reserveed for future use', when i am using that rtf template..to get the report output it was taking more than 1 hr time.
    1)Is there any way/patch to get that XML report to be used in 12.1.3 EBS version
    2) is there any other way to get the report output faster.
    Thanks..

    Hi,
    When submitting the request, you may change the output to Excel and get the output in Excel. Otherwise as you mention if you getting the output in text format, you may download the text format and open the document in excel and use the delimitation to format in excel as per your requirement.
    1)Is there any way/patch to get that XML report to be used in 12.1.3 EBS version
    2) is there any other way to get the report output faster.
    Is your statistics up to date, when did you last run gather schema statistics program in Sysadmin responsibility.
    Also what is the record quantity that you are expecting here? Is date range parameter available in the report and if yes, did you try running the report for a day to check the output.
    Thanks &
    Best Regards,

  • How to create a report in excel format having two tab

    Hi All,
    I have Business requirement where customer wants to create a report in excel format having two tab.
    Please let me know if it is possible?
    I am using 10.1.4.3.2 version of BIP.
    Thanks & Regards,
    Edited by: 862749 on May 20, 2013 7:36 PM

    I have Business requirement where customer wants to create a report in excel format having two tab.
    Can anybody suggest if it is possible in BI Publisher or not?yes
    look at excel template
    also you can use xsl-xml or xsl-fo template
    check it for your requirements

  • Reports to Excel

    Can we generate from reports to Excel , not only the data but also all the formatting i.e. report heading, fonts, font sizes etc. For example can we export a invoice with formatting and data to excel from reports ?

    Hi Do otn Baat ,
    There is no system parameter using which we can set mimetype i.e. there is no system parameter called Mimetype. <<Never mind, just specify it. It is not intended for reports , it is for browser (This is only for servlet and jsp run. The details are explained in the link given)
    http://www.oracle.com/technology/products/reports/htdocs/getstart/demonstrations/index.html
    Here see link
    Output to Excel with Oracle9i Report
    Do you mean that , in reprots 10g release 2 , we can provide a destination format of excel while running reports? <<Yes.
    (I am not sure if I can give all information. So when it is released you can try it out and read the docs to know more about it)
    [ 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
    ---------------------------------------------------------------------------------

  • End of Page event in ALV report using SALV class[cl_salv_hierseq_table]

    Hi ,
    have been working on a ALV report using the class SALV cl_salv_hierseq_table
    I am facing few issues pertaining to two things:
    1. Displaying some subtotal text along with the subtotals.
    Example refer the standard demo example: SALV_DEMO_HIERSEQ_FORM_EVENTS
    Now instead of A 17 and A26 I would like to show text like Subtotal for the Carrid.for subtotals and grand totals
    Like   Subtotal for A 17 is :      XXXXXXX
              GrandTotal is         :      YYYYYY
    2. We have a page break and a new page for every purchasing group as in the standard example SALV_DEMO_HIERSEQ_FORM_EVENTS for CARRID.
    I need to display some variable values as number of documents ,total number of records etc at the end of each CARRID group before a new page starts for the next CARRID.Please note i do not want it on every page.it should only be diaplyed at the end of page whose next page would be for next CARRID.[basically at end of every carrid]Example:after displaying all details for AA need to display the number of records for that carrid at the end of the page[as page break is based on CARRID]/
    Thanks
    Jyotsna

    at end of page event, for CL_SALV_EVENTS_HIERSEQ, has some useful parameters allowing to know where you are at the time of event
    parameter VALUE is of type CL_SALV_FORM which contains public attribute IF_SALV_FORM~ACCDESCRIPTION; you can slo get contents of it
    about text of total/subtotal, this is normally set in the layout

  • Fatal Error when exporting Report to Excel

    Hi Everyone, I've been trying to export my report to excel.  But I have exhausted all possible reasons and I just couldn't figure it out.  Can someone please help me.  Thanks in advance.
    PROGRAM NAME :   ZADC_PAYSUMNEW
    REPORT ZADC_PAYSUMNEW
    NO STANDARD PAGE HEADING
                      LINE-SIZE 450
                      LINE-COUNT 65 MESSAGE-ID zmes.
    TABLE DECLARATION                                                   *
    TABLES: cskt,
            csks,
            pa0009,
            pcl1,
            pcl2,
            pernr,
            t512t,
            t549a,
            t527x,
            zhrprtype.
       INFOTYPES DECLARATION
    INFOTYPES: 0001, 0002.
       INCLUDE DECLARATION
    INCLUDE: rpc2rx00.
    INCLUDE: rpc2rxx0.
    INCLUDE: rpppxd00.
       INTERNAL TABLE DECLARATION
    DATA: BEGIN OF itab OCCURS 0,
            khinr LIKE csks-khinr,
            kostl LIKE p0001-kostl,
            ltext(40),
            p_date LIKE pc261-inper,
            basic(7) TYPE p DECIMALS 2,
            pera(7) TYPE p DECIMALS 2,
            longp(7) TYPE p DECIMALS 2,
            trall(6) type p decimals 2,
            srvaw(6) TYPE p DECIMALS 2,
            chall(7) TYPE p DECIMALS 2,
            leave(7) TYPE p DECIMALS 2,
            meal(7) TYPE p DECIMALS 2,
            saldf(7) TYPE p DECIMALS 2,
            sipps(7) TYPE p DECIMALS 2,
            sipgs(7) TYPE p DECIMALS 2,
            subs(7) TYPE p DECIMALS 2,
            hzard(7) TYPE p DECIMALS 2,
            lallw(7) TYPE p DECIMALS 2,
            medps(7) TYPE p DECIMALS 2,
            medgs(7) TYPE p DECIMALS 2,
            pcontps(7) TYPE p DECIMALS 2,
            pcontgs(7) TYPE p DECIMALS 2,
            pagibps(6) TYPE p DECIMALS 2,
            pagibgs(6) TYPE p DECIMALS 2,
            lwop(7) TYPE p DECIMALS 2,
            npay(7) TYPE p DECIMALS 2,
            otime(7) TYPE p DECIMALS 2,
            ec(7) TYPE p DECIMALS 2,
            fr_date like sy-datum,
            to_date like sy-datum,
          END OF itab.
    DATA: BEGIN OF jtab OCCURS 0,
            khinr LIKE csks-khinr,
            kostl LIKE p0001-kostl,
            ltext(40),
            basic(7) TYPE p DECIMALS 2,
            pera(7) TYPE p DECIMALS 2,
            longp(7) TYPE p DECIMALS 2,
            trall(6) type p decimals 2,
            srvaw(6) TYPE p DECIMALS 2,
            chall(7) TYPE p DECIMALS 2,
            leave(7) TYPE p DECIMALS 2,
            meal(7) TYPE p DECIMALS 2,
            saldf(7) TYPE p DECIMALS 2,
            sipps(7) TYPE p DECIMALS 2,
            sipgs(7) TYPE p DECIMALS 2,
            subs(7) TYPE p DECIMALS 2,
            hzard(7) TYPE p DECIMALS 2,
            lallw(7) TYPE p DECIMALS 2,
            medps(7) TYPE p DECIMALS 2,
            medgs(7) TYPE p DECIMALS 2,
            pcontps(7) TYPE p DECIMALS 2,
            pcontgs(7) TYPE p DECIMALS 2,
            pagibps(6) TYPE p DECIMALS 2,
            pagibgs(6) TYPE p DECIMALS 2,
            lwop(7) TYPE p DECIMALS 2,
            npay(7) TYPE p DECIMALS 2,
            otime(7) TYPE p DECIMALS 2,
            ec(7) TYPE p DECIMALS 2,
          END OF jtab.
    DATA: it_list TYPE STANDARD TABLE OF itab   WITH HEADER LINE.
       CONSTANTS DECLARATION
    CONSTANTS: basic  TYPE pc207-lgart VALUE '0401',
               basic2 TYPE pc207-lgart VALUE '0402',
               basic3 TYPE pc207-lgart VALUE '0403',
               PERA   TYPE pc207-lgart VALUE '3104',
               PERA2 TYPE pc207-lgart VALUE '3110',
               longp  TYPE pc207-lgart VALUE '1601',
               longp2 TYPE pc207-lgart VALUE '1603',
               trall  TYPE pc207-lgart VALUE '3109',
               srvaw TYPE pc207-lgart VALUE '2117',
               leave TYPE pc207-lgart VALUE '2118',
               chall  TYPE pc207-lgart VALUE '3105',
               chall2 TYPE pc207-lgart VALUE '3111',
               chall3 TYPE pc207-lgart VALUE '3112',
               meal   TYPE pc207-lgart VALUE '3102',
               saldf  TYPE pc207-lgart VALUE '4103',
               sipps  TYPE pc207-lgart VALUE '/090',
               sipps2 TYPE pc207-lgart VALUE '1121',
               subs   TYPE pc207-lgart VALUE '3101',
               hzard  TYPE pc207-lgart VALUE '1602',
               lallw  TYPE pc207-lgart VALUE '3103',
               medps  TYPE pc207-lgart VALUE '/313',
               medgs  TYPE pc207-lgart VALUE '/314',
               pcontps  TYPE pc207-lgart VALUE '/093',
               pcontps2 TYPE pc207-lgart VALUE '1327',
               pcontps3 TYPE pc207-lgart VALUE '1120',
               pagibps  TYPE pc207-lgart VALUE '/326',
               pagibps2 TYPE pc207-lgart VALUE '1326',
               lwop   TYPE pc207-lgart VALUE '1102',
               otime  TYPE pc207-lgart VALUE '0101',
               otime2 TYPE pc207-lgart VALUE '0102',
               otime3 TYPE pc207-lgart VALUE '0103',
               otime4 TYPE pc207-lgart VALUE '0104',
               npay   TYPE pc207-lgart VALUE '/559'.
       DATA DECLARATION
    DATA: BEGIN OF COMMON PART buffer.
    INCLUDE: rpppxd10.
    DATA: END OF COMMON PART buffer.
    *Table data containing directory to PCL2 payroll results file DATA:
    DATA: BEGIN OF rgdir OCCURS 100.
            INCLUDE STRUCTURE pc261.
    DATA: END OF rgdir.
    DATA: BEGIN OF evpdir OCCURS 100.
            INCLUDE STRUCTURE pc261.
    DATA: END OF evpdir.
    DATA: country LIKE t001p-molga,
          lname LIKE t527x-orgtx,
          filename2(128),
          p_date LIKE pc261-inper,
          w_basic  LIKE pc207-lgart,
          w_basic2 LIKE pc207-lgart,
          w_basic3 LIKE pc207-lgart,
          w_pera LIKE pc207-lgart,
          w_pera2 LIKE pc207-lgart,
          w_longp LIKE pc207-lgart,
          w_longp2 LIKE pc207-lgart,
          w_trall LIKE pc207-lgart,
          w_srvaw LIKE pc207-lgart,
          w_leave LIKE pc207-lgart,
          w_chall LIKE pc207-lgart,
          w_chall2 LIKE pc207-lgart,
          w_chall3 LIKE pc207-lgart,
          w_meal LIKE pc207-lgart,
          w_saldf LIKE pc207-lgart,
          w_sipps LIKE pc207-lgart,
          w_sipps2 LIKE pc207-lgart,
          w_subs LIKE pc207-lgart,
          w_hzard LIKE pc207-lgart,
          w_lallw LIKE pc207-lgart,
          w_medps LIKE pc207-lgart,
          w_medgs LIKE pc207-lgart,
          w_pcontps LIKE pc207-lgart,
          w_pcontps2 LIKE pc207-lgart,
          w_pcontps3 LIKE pc207-lgart,
          w_pagibps LIKE pc207-lgart,
          w_pagibps2 LIKE pc207-lgart,
          w_lwop LIKE pc207-lgart,
          w_otime LIKE pc207-lgart,
          w_otime2 LIKE pc207-lgart,
          w_otime3 LIKE pc207-lgart,
          w_otime4 LIKE pc207-lgart,
          w_npay LIKE pc207-lgart,
          tempgs(7) TYPE p DECIMALS 2,
          ctr-basic(7) TYPE p DECIMALS 2,
          ctr-pera(7) TYPE p DECIMALS 2,
          ctr-longp(7) TYPE p DECIMALS 2,
          ctr-trall(6) TYPE p DECIMALS 2,
          ctr-srvaw(6) TYPE p DECIMALS 2,
          ctr-leave(7) TYPE p DECIMALS 2,
          ctr-chall(7) TYPE p DECIMALS 2,
          ctr-meal(7) TYPE p DECIMALS 2,
          ctr-saldf(7) TYPE p DECIMALS 2,
          ctr-sipps(7) TYPE p DECIMALS 2,
          ctr-sipgs(7) TYPE p DECIMALS 2,
          ctr-subs(7) TYPE p DECIMALS 2,
          ctr-hzard(7) TYPE p DECIMALS 2,
          ctr-lallw(7) TYPE p DECIMALS 2,
          ctr-medps(7) TYPE p DECIMALS 2,
          ctr-medgs(7) TYPE p DECIMALS 2,
          ctr-pcontps(7) TYPE p DECIMALS 2,
          ctr-pcontgs(7) TYPE p DECIMALS 2,
          ctr-pagibps(6) TYPE p DECIMALS 2,
          ctr-pagibgs(6) TYPE p DECIMALS 2,
          ctr-lwop(7) TYPE p DECIMALS 2,
          ctr-otime(7) TYPE p DECIMALS 2,
          ctr-npay(7) TYPE p DECIMALS 2,
          ctr-ec(7) TYPE p DECIMALS 2.
    DATA: BEGIN OF  ph-version.
            INCLUDE STRUCTURE pc201_pay.   "XTWPH9K008656
    DATA: END OF  ph-version.
    DATA: fr_date LIKE sy-datum,
          to_date LIKE sy-datum.
       SELECT-OPTIONS and PARAMETERS
    SELECT-OPTIONS: p_status FOR rgdir-srtza DEFAULT 'A'.
    DATA: DATE1(15),
          mon(9).
       DEFINITION
    DEFINE rp-imp-c2-rx2.
      clear:
        orx-version,                       "OBJECTS_FOR_CLEAR
        rt, rt[].
      import
        ph-version to orx-version          "OBJECTS_FOR_IMPORT
        rt
      from database pcl2(ph) id rx-key using pcl2_exp_imp.
      rp-imp-rx-subrc = sy-subrc.
      if sy-subrc eq 0 and orx-version-number ne ph-version-number.
        rp-imp-rx-subrc = 8.
      endif.
    END-OF-DEFINITION.
    TYPE-POOLS: slis.
    DATA: g_repid LIKE sy-repid,
          gt_fieldcat TYPE slis_t_fieldcat_alv,
          gt_events TYPE slis_t_event,
          gt_top TYPE slis_t_listheader,
          gt_eol TYPE slis_t_listheader,
          gt_list_top_of_page TYPE slis_t_listheader,
          gt_list_end_of_list TYPE slis_t_listheader,
          gs_layout TYPE slis_layout_alv,
          d_f2code LIKE sy-ucomm              VALUE  '&ETA'.
    CONSTANTS: fn_top TYPE slis_formname VALUE 'TOP_OF_PAGE',
               fn_eol TYPE slis_formname VALUE 'END_OF_LIST'.
    DATA: it_alv_out TYPE STANDARD TABLE OF itab WITH HEADER LINE.
    INITIALIZATION.
    g_repid = sy-repid.
    PERFORM f_fieldcat_init USING gt_fieldcat[].
    PERFORM eventtab_build USING gt_events[].
       START-OF-SELECTION.
    START-OF-SELECTION.
    fr_date = to_date = pn-endda.
    fr_date+6(2) = '01'.
      SELECT SINGLE * FROM t549a
         WHERE abkrs = pnpxabkr.
      GET PERNR.
        CLEAR: itab, lname.
        PERFORM get_rt_tab.
    END-OF-SELECTION.
      PERFORM display_grid.
      INCLUDE rpppxm00.
    USING DATM
          FORM get_rt_tab                                               *
    FORM get_rt_tab.
      rp_provide_from_last p0001 space pn-begda pn-endda.
      rp_provide_from_last p0002 space pn-begda pn-endda.
      CALL FUNCTION 'CU_READ_RGDIR'
           EXPORTING
                persnr          = p0001-pernr
           IMPORTING
                molga           = country
           TABLES
                in_rgdir        = rgdir
           EXCEPTIONS
                no_record_found = 1
                OTHERS          = 2.
      IF sy-subrc = 0.
      SELECT single ltext FROM cskt
        INTO itab-ltext
        WHERE kostl = p0001-kostl
          AND datbi = '99991231'.
      SELECT SINGLE * FROM csks
        WHERE kostl = p0001-kostl
          AND kokrs = 'GSIS'
          AND datbi = '99991231'.
      IF sy-subrc = 0.
        MOVE: csks-kostl TO itab-kostl,
              csks-khinr TO itab-khinr.
      ENDIF.
        p_date = pn-paper.
      regular payroll run.
        CALL FUNCTION 'CD_EVALUATION_PERIODS'
             EXPORTING
                  bonus_date      = '00000000'
                  inper_modif     = t549a-permo
                  inper           = p_date
                  pay_type        = ' '
                  pay_ident       = ' '
             TABLES
                  rgdir           = rgdir
                  evpdir          = evpdir
             EXCEPTIONS
                  no_record_found = 1
                  OTHERS          = 2.
        IF sy-subrc = 0.
          LOOP AT evpdir WHERE srtza IN p_status and FPPER eq pn-begda+(6).
            rx-key-pernr = p0001-pernr.
            rx-key-seqno = evpdir-seqnr.
            rp-imp-c2-rx2.
            IF rp-imp-rx-subrc = 0.
              PERFORM rt_to_itab.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDFORM.
          FORM PRINT_RX                                                 *
    FORM print_rx.
      LOOP AT rt.
        PERFORM re512t USING country rt-lgart.
      ENDLOOP.
    ENDFORM.
          FORM RE512T                                                   *
    -->  VALUE(COUNTRY_GROUPING)                                       *
    -->  VALUE(WTYPE)                                                  *
    FORM re512t USING value(country_grouping)
                      value(wtype).
      CHECK t512t-sprsl NE sy-langu
         OR t512t-molga NE country_grouping
         OR t512t-lgart NE wtype.
      SELECT SINGLE * FROM t512t
           WHERE sprsl EQ sy-langu
           AND molga EQ country_grouping
           AND lgart EQ wtype.
      IF sy-subrc NE 0.
        CLEAR t512t.
      ENDIF.
    ENDFORM.
          FORM rt_to_itab                                               *
    FORM rt_to_itab.
      MOVE: basic TO w_basic,
            basic2 TO w_basic2,
            basic3 TO w_basic3,
            pera  TO w_pera,
            pera2 TO w_pera2,
            longp TO w_longp,
            longp2 TO w_longp2,
            srvaw TO w_srvaw,
            leave TO w_leave,
            trall TO w_trall,
            chall TO w_chall,
            chall2 TO w_chall2,
            chall3 TO w_chall3,
            meal  TO w_meal,
            saldf TO w_saldf,
            sipps TO w_sipps,
            sipps2 TO w_sipps2,
            subs  TO w_subs,
            hzard TO w_hzard,
            lallw TO w_lallw,
            medps TO w_medps,
            medgs TO w_medgs,
            pcontps TO w_pcontps,
            pcontps2 TO w_pcontps2,
            pcontps3 TO w_pcontps3,
            pagibps TO w_pagibps,
            pagibps2 TO w_pagibps2,
            LWOP  TO w_lwop,
            otime TO w_otime,
            otime2 TO w_otime2,
            otime3 TO w_otime3,
            otime4 TO w_otime4,
            npay  TO w_npay.
      LOOP AT rt WHERE lgart = w_basic or lgart = w_basic2
                                        or lgart = w_basic3.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-basic.
        itab-ec = rt-betrg / 100.
        if itab-ec > 100.
            itab-ec = 100.
        ENDIF.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_pera.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-pera.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_pera2.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-pera.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_longp or lgart = w_longp2.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-longp.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_trall.
        if rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        endif.
        ADD: rt-betrg TO itab-trall.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_srvaw.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-srvaw.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_leave.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-leave.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_chall or
                       lgart = w_chall2 or
                       lgart = w_chall3.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-chall.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_meal.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-meal.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_saldf.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-saldf.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_sipps or
                       lgart = w_sipps2.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-sipps.
        itab-sipgs = itab-sipps / 9 * 12.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_subs.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-subs.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_hzard.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-hzard.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_lallw.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-lallw.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_medps.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-medps.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_medgs.
          IF rt-betrg < 0.
            rt-betrg = abs( rt-betrg ).
          ENDIF.
          MOVE: rt-betrg TO tempgs.
          itab-medgs = itab-medps.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_pcontps OR
                       lgart = w_pcontps2 OR
                       lgart = w_pcontps3.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-pcontps.
      ENDLOOP.
      itab-pcontgs = itab-pcontps * 9.
      LOOP AT rt WHERE lgart = w_pagibps OR
                       lgart = w_pagibps2.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-pagibps.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_pagibps.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-pagibgs.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_lwop.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-lwop.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_otime or
                       lgart = w_otime2 or
                       lgart = w_otime3 or
                       lgart = w_otime4.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-otime.
      ENDLOOP.
      LOOP AT rt WHERE lgart = w_npay.
        IF rt-betrg < 0.
          rt-betrg = abs( rt-betrg ).
        ENDIF.
        ADD: rt-betrg TO itab-npay.
      ENDLOOP.
      COLLECT itab.
      CLEAR: itab.
      REFRESH rt.
    ENDFORM.                               " rt_to_itab
    *&      Form  f_fieldcat_init
          text
         -->P_GT_FIELDCAT[]  text
    FORM f_fieldcat_init USING rt_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   1.
      ls_fieldcat-reptext_ddic    =  ' FXNAL Group'.
      ls_fieldcat-fieldname       =  'KHINR'.
      ls_fieldcat-ref_tabname     =  'ITAB'.
      ls_fieldcat-outputlen       =  12.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   2.
      ls_fieldcat-reptext_ddic    =  ' OFFICE'.
      ls_fieldcat-fieldname       =  'LTEXT'.
      ls_fieldcat-ref_tabname     =  'ITAB'.
      ls_fieldcat-outputlen       =  40.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   3.
      ls_fieldcat-reptext_ddic    =  ' RC #'.
      ls_fieldcat-fieldname       =  'KOSTL'.
      ls_fieldcat-ref_tabname     =  'ITAB'.
      ls_fieldcat-outputlen       =  5.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos           =   4.
      ls_fieldcat-reptext_ddic      =  'Basic Salary'.
      ls_fieldcat-tabname           =  'ITAB'.
      ls_fieldcat-fieldname         =  'BASIC'.
      ls_fieldcat-datatype          = 'CURR'.
      ls_fieldcat-outputlen       =  15.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   5.
      ls_fieldcat-reptext_ddic      =  'PERA Allow'.
      ls_fieldcat-tabname           =  'ITAB'.
      ls_fieldcat-fieldname         =  'PERA'.
      ls_fieldcat-datatype          =  'CURR'.
      ls_fieldcat-outputlen       =  15.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   6.
      ls_fieldcat-reptext_ddic    =  'Longevity Pay'.
      ls_fieldcat-tabname         =  'ITAB'.
      ls_fieldcat-fieldname       =  'LONGP'.
      ls_fieldcat-datatype        = 'CURR'.
      ls_fieldcat-outputlen       =  15.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   7.
      ls_fieldcat-reptext_ddic    =  'Service Award'.
      ls_fieldcat-tabname         =  'ITAB'.
      ls_fieldcat-fieldname       =  'SRVAW'.
      ls_fieldcat-datatype        = 'CURR'.
      ls_fieldcat-outputlen       =  15.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   8.
      ls_fieldcat-reptext_ddic    =  'Child Allowance'.
      ls_fieldcat-tabname         =  'ITAB'.
      ls_fieldcat-fieldname       =  'CHALL'.
      ls_fieldcat-datatype        = 'CURR'.
      ls_fieldcat-outputlen       =  15.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   9.
      ls_fieldcat-reptext_ddic    =  'Leave Mone'.
      ls_fieldcat-tabname         =  'ITAB'.
      ls_fieldcat-fieldname       =  'LEAVE'.
      ls_fieldcat-datatype        = 'CURR'.
      ls_fieldcat-outputlen       =  15.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   10.
      ls_fieldcat-reptext_ddic    =  'Over-time'.
      ls_fieldcat-tabname         =  'ITAB'.
      ls_fieldcat-fieldname       =  'OTIME'.
      ls_fieldcat-datatype        =  'CURR'.
      ls_fieldcat-outputlen       =  15.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   11.
      ls_fieldcat-reptext_ddic    =  'Meal Subsidy'.
      ls_fieldcat-tabname         =  'ITAB'.
      ls_fieldcat-fieldname       =  'MEAL'.
      ls_fieldcat-datatype        =  'CURR'.
      ls_fieldcat-outputlen       =  15.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   12.
      ls_fieldcat-reptext_ddic    =  'Salary Diff.'.
      ls_fieldcat-tabname         =  'ITAB'.
      ls_fieldcat-fieldname       =  'SALDF'.
      ls_fieldcat-datatype        =  'CURR'.
      ls_fieldcat-outputlen       =  15.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   13.
      ls_fieldcat-reptext_ddic    =  'Subsistence'.
      ls_fieldcat-tabname         =  'ITAB'.
      ls_fieldcat-fieldname       =  'SUBS'.
      ls_fieldcat-datatype        =  'CURR'.
      ls_fieldcat-outputlen       =  15.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   14.
      ls_fieldcat-reptext_ddic    =  'Hazard Pay'.
      ls_fieldcat-tabname         =  'ITAB'.
      ls_fieldcat-fieldname       =  'HZARD'.
      ls_fieldcat-datatype        =  'CURR'.
      ls_fieldcat-outputlen       =  15.
      APPEND ls_fieldcat TO rt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos         =   15.
      ls_fieldcat-reptext_ddic    =  'Laundry Allow'.
      ls_fieldcat-tabname         =  'ITAB'.
      ls_fieldcat-fieldname       =  'LALLW'.
      ls_fieldcat-datatype        =  'CURR'.
      ls_fieldcat-outputlen       =  15.
      APPEND ls_fieldcat TO rt_fieldcat.
    ENDFORM.                    " f_fieldcat_init
    *&      Form  display_grid
          text
    -->  p1        text
    <--  p2        text
    FORM display_grid.
      SORT itab BY kostl khinr.
      LOOP AT itab.
        AT NEW khinr.
          MOVE-CORRESPONDING itab TO jtab.
          APPEND jtab.
        ENDAT.
      ENDLOOP.
      PERFORM my_top USING gt_top[].
      PERFORM build_layout USING gs_layout.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = g_repid
          is_layout          = gs_layout
          it_fieldcat        = gt_fieldcat[]
          it_events          = gt_events[]
        TABLES
          t_outtab           = itab.
    ENDFORM.                    " display_grid
    *&      Form  eventtab_build
          text
         -->P_GT_EVENTS[]  text
    FORM EVENTTAB_BUILD USING my_events TYPE SLIS_T_EVENT.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                i_list_type = 1
           IMPORTING
                et_events   = my_events.
    *TOP OF PAGE
      READ TABLE my_events
           WITH KEY NAME = slis_ev_top_of_page
           INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE fn_top TO ls_event-form.
        APPEND ls_event TO my_events.
      ENDIF.
      CLEAR ls_event.
    *END OF LIST
      READ TABLE my_events
            WITH KEY name = slis_ev_end_of_list
            INTO ls_event.
      IF sy-subrc = 0.
        MOVE   fn_eol TO ls_event-form.
        APPEND ls_event TO my_events.
      ENDIF. " SY-SUBRC for READ TABLE
    ENDFORM.                    " eventtab_build
    *&      Form  top_comment
          text
         -->P_MYTOP[]  text
    FORM top_comment USING my_top_of_page TYPE slis_t_listheader.
      DATA: it_t247 LIKE t247 OCCURS 0 WITH HEADER LINE.
      DATA: ls_line     TYPE slis_listheader,
            li_recs     TYPE i,
            lc_name(60) TYPE c,
            lc_from(30) TYPE c,
            lc_to(30) TYPE c.
      CALL FUNCTION 'MONTH_NAMES_GET'
           TABLES
                month_names = it_t247.
    Company Name
      CLEAR ls_line.
      ls_line-typ  = 'H'.
      ls_line-info = TEXT-001.
      APPEND ls_line TO my_top_of_page.
      CLEAR ls_line.
      ls_line-typ  = 'S'.
      ls_line-info  = TEXT-002.
      APPEND ls_line TO my_top_of_page.
    Date
      CLEAR lc_name.
      CONCATENATE sy-datum+6(2) ',' INTO lc_name.
      READ TABLE it_t247 WITH KEY mnr = sy-datum+4(2).
      CONCATENATE text-003 it_t247-ltx lc_name sy-datum(4)
             INTO lc_name SEPARATED BY space.
      CLEAR ls_line.
      ls_line-typ  = 'H'.
      ls_line-info = lc_name.
      APPEND ls_line TO my_top_of_page.
    ENDFORM.                    " top_comment
    *&      Form  build_layout
          text
         -->P_GS_LAYOUT  text
    FORM build_layout USING my_layout TYPE slis_layout_alv.
      my_layout-f2code              = d_f2code.
      my_layout-reprep              = 'X'.
      my_layout-confirmation_prompt = 'X'.
      my_layout-flexible_key        = 'X'.
    ENDFORM.                    " build_layout
    *&      Form  TOP_OF_PAGE
          Writes comments on top of page
    FORM top_of_page.
      DATA: ls_line     TYPE slis_listheader,
            lc_name(60) TYPE c.
      IF sy-ucomm = '&RNT_PREV'.
        READ TABLE gt_top INTO ls_line INDEX 2.
        lc_name = ls_line-info.
        WRITE 'Page:' TO lc_name+45(5).
        WRITE sy-pagno TO lc_name+52(5).
        ls_line-typ  = 'H'.
        ls_line-info = lc_name.
        MODIFY  gt_top FROM ls_line INDEX 2.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = gt_top.
    ENDFORM. " TOP_OF_PAGE
    *&      Form  my_top
          text
         -->P_GT_TOP[]  text
    FORM my_top USING top TYPE slis_t_listheader.
      DATA: it_t247 LIKE t247 OCCURS 0 WITH HEADER LINE.
      DATA: ls_line     TYPE slis_listheader,
            li_recs     TYPE i,
            lc_name(60) TYPE c,
            lc_from(30) TYPE c,
            lc_to(30) TYPE c.
      CALL FUNCTION 'MONTH_NAMES_GET'
           TABLES
                month_names = it_t247.
    Company Name
      CLEAR lc_name.
      WRITE text-001 TO lc_name.
      CLEAR ls_line.
      ls_line-typ  = 'H'.
      ls_line-info = lc_name.
      APPEND ls_line TO top.
    **Report Name
      CLEAR lc_name.
      WRITE text-002 TO lc_name.
      CLEAR ls_line.
      ls_line-typ  = 'H'.
      ls_line-info = lc_name.
      APPEND ls_line TO top.
    Range of date
      CLEAR lc_name.
      lc_name = p_date+4(2).
      READ TABLE it_t247 WITH KEY mnr = p_date+4(2).
      CONCATENATE: text-003 it_t247-ltx sy-datum(4)
                   INTO lc_name SEPARATED BY SPACE.
      ls_line-typ = 'H'.
      ls_line-info = lc_name.
      APPEND ls_line TO top.
    ENDFORM.                    " my_top
    *&      Form  END_OF_LIST
          Writes signature line at end of list
    FORM end_of_list.
      IF sy-ucomm = '&RNT_PREV' OR sy-ucomm = 'AUSW'.
        REFRESH gt_eol.
        PERFORM my_eol USING gt_eol[].
      ELSE.
        REFRESH gt_eol.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = gt_eol
                i_end_of_list_grid = 'X'.
    ENDFORM. " END_OF_LIST
    *&      Form  my_eol
          text
         -->P_GT_EOL[]  text
    FORM my_eol USING eol TYPE slis_t_listheader.
      DATA: ls_line     TYPE slis_listheader,
            lc_name(60) TYPE c.
    Signature Line
      CLEAR lc_name.
      lc_name = '.'.
      ls_line-typ  = 'H'.
      ls_line-info = lc_name.
      APPEND ls_line TO eol.
      CLEAR lc_name.
      ls_line-typ  = 'H'.
      ls_line-info = lc_name.
      APPEND ls_line TO eol.
      CLEAR ls_line.
      ls_line-typ  = 'H'.
      WRITE 'Submitted By:' TO lc_name(28).
      WRITE 'Noted By:' TO lc_name+30(28).
      ls_line-info = lc_name.
      APPEND ls_line TO eol.
      CLEAR: lc_name, ls_line-key.
      lc_name = '.'.
      ls_line-typ  = 'H'.
      ls_line-info = lc_name.
      APPEND ls_line TO eol.
      CLEAR lc_name.   CLEAR ls_line.
      WRITE sy-uline(28) TO lc_name(28).
      WRITE sy-uline(28) TO lc_name+30(28).
      ls_line-typ  = 'H'.
      ls_line-info = lc_name.
      APPEND ls_line TO eol.
    ENDFORM.                    " my_eol

    1.U are not getting the data into Excel when u client Excel Buttton from the ALV display ?
    2.if yes then u will get one message stating that templet is Missing like this ?
    Regards
    prabhu

  • How can i create multiple page report using excel report generation toolkit from excel template?

    i am having code which create report in excel.but it prints only single page. if content is more than size of template than insted of tacking new page it prints only single page.Please help me out.
    Anyone has material for learning activeX in labview? Please mail me on [email protected] 
    PBP (CLAD)
    Labview 6.1 - 2014
    KUDOS ARE WELCOMED.
    If your problem get solved then mark as solution.

    Hi thanks for reply.....
    PBP (CLAD)
    Labview 6.1 - 2014
    KUDOS ARE WELCOMED.
    If your problem get solved then mark as solution.

  • Cells merge issue when extracting webi report in excel format

    Hi Experts,
    We have some WEBI reports in BO XI 3.1.
    The reports have header where we are showing report name and some values which user selects in prompt.
    Now the issue is that when we save our webi report in excel format, many cells get merge.
    I have read many post on scn which suggest some solutions like changing the autofit width option to no and aligning the header width with colums.
    Tried both the option but no success.
    Is there any other way to achieve this.
    Thanks in advance,
    Regards,
    Rishabh

    Hi,
    We managed to find the workaround for this merge cell issue.
    Sharing it might be helpful for someone.
    - Align the report name and other block in report in such a way that the ends are in line with the end point of any column. The only limitation is that when applying pivot to the excel output we neet to click on any of the ccolumn so that excel identify the data set.
    - Second workaround is to break the webi document in two parts report1 will contain the report name and the block to show the prompt values selected by the user where as report2 will contain the table withactual data. The only limitation with this workaround is that when exporting the repot output to excel we will get two tabs in the excel sheet one containing the prompt values and secont tab containing the actual data.
    Regards,
    RS

  • Not able to export web analysis report to excel smart view from workspace

    Not able to export web analysis report to excel smart view from workspace.
    Error :Web launch operation has been cancelled.
    Can anyone help me to resolve this issues

    I realized that I can put a block in WebI and then I can pull that in excel alongside of static header, after putting the question.
    My interest to know whether it is by design in XI 3.0 or it is an issue. But by the replies it seems to me like it is by design.
    @Anis: I can't go for header as part of Body. Because this report is viewed in Web by many other users. I can't have separate report for Live office, it is a restriction for me. If I use the header in body, it wont look good I guess.

  • Help me to download my report in excel format.

    Here is my code below. On selection screen I am giving three inputs.
    And There are two radio buttons present on my selection screen.
    first one is for display the report.
    second button name is generate(to export the report).
    Clicking on the generate radio button will show the report.
    There should be a standard button on the toolbar called GENERATE.
    Clicking on that button will show a popup window asking to download the report either in .xls format or in .csv format.
    ==========================================================
    My report is being displayed perfectly.But not getting how to downlaod the report in excel and csv format. Would u plz guide me what should I write within the export_report function of my program so that I can download the report. Kindly guide.
    REPORT ZMYREPORT.
    TYPE-POOLS: SLIS.               
    TYPES: BEGIN OF t_afko,
           aufnr type aufnr,        
           gamng type gamng,        
           plnbez type matnr,
           END OF t_afko.
    TYPES: BEGIN OF t_mara,
           matnr TYPE matnr,
           mtart type mtart,         
           pstat type pstat_d,       
           END OF t_mara.
    TYPES: BEGIN OF t_output,
           aufnr type aufnr,              "Production order
           gamng type gamng,         "move number
           mtart type mtart,              "size/fit
           pstat type pstat_d,           "Variant
           quantity type meng8,        "Quantity
           barcode(35) type c,          "barcode
           END OF t_output.
                 INTERNAL TABLES, WORK AREAS AND VARIABLES                      
    *For work area.
    DATA:
          gwa_afko type t_afko,                          "work area for t_afko table
          gwa_mara type t_mara,                          "work area for t_mara table
          gwa_output type t_output,                      "work area for t_output table
          gwa_output1 type t_output,                     "second work area for t_output table
          gwa_fieldcat type slis_fieldcat_alv,           "work area for slis_fieldcat_alv
          gwa_top type slis_listheader,                  "work area for slis_listheader
          wa_variant type disvariant,                    "work area for variant
          wa_Variant1 type disvariant,                   "work area for variant
    *For internal tables.
    gi_afko TYPE STANDARD TABLE OF t_afko,                     
    gi_mara TYPE STANDARD TABLE OF t_mara,               
    gi_output TYPE STANDARD TABLE OF t_output,              
    gi_fieldcat TYPE STANDARD TABLE OF slis_fieldcat_alv,
    gi_top TYPE slis_t_listheader,                        
    gi_download TYPE TABLE OF t_download,
    *Variables for screen-input.
          v_aufnr like caufvd-aufnr,  "for production order
          v_txt04 like tj02t-txt04,   "for production order status
          v_plnbez like afko-plnbez.  "for article
    *For constants.
    CONSTANTS: quantity(1) type c value '1',
               lv_save(01) TYPE c VALUE 'A',
               c_csv TYPE char1 VALUE   '|'.
                           S E L E C TI O N     S C R E E N      *
    SELECTION-SCREEN:
    BEGIN OF block inputpath1 WITH FRAME TITLE TEXT-001.            
    SELECT-OPTIONS: s_aufnr for v_aufnr,                                                                               
    s_txt04 for v_txt04,                                                                               
    s_plnbez for v_plnbez.                                
    SELECTION-SCREEN: END OF block inputpath1.
    SELECTION-SCREEN:
    BEGIN OF block inputpath2 WITH FRAME TITLE TEXT-002.   
    PARAMETERS:   
    p_disp RADIOBUTTON GROUP rb DEFAULT'X',   "Button to display report           
    p_gen RADIOBUTTON GROUP rb.         "button for generate option
    SELECTION-SCREEN: END OF block inputpath2.
    SELECTION-SCREEN:
    BEGIN OF block inputpath3 WITH FRAME TITLE TEXT-003.   
    PARAMETERS:layout TYPE disvariant.                                      
    SELECTION-SCREEN: END OF block inputpath3.
                    I-N-I-T-I-A-L-I-Z-A-T-I-O-N                                   *
    INITIALIZATION.
      DATA: g_repid LIKE sy-repid,
            g_uname LIKE sy-uname.
      g_repid = sy-repid.
               AT SELECTION SCREEN                     *
    *Function module for variant.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR layout.
      wa_variant-username = g_uname.
      wa_variant-report = g_repid.
    *Display all existing variants
      DATA:  lv_exit(1) TYPE c.
    *Code for variant part.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant    = wa_variant
          i_save        = lv_save
        IMPORTING
          e_exit        = lv_exit
          es_variant    = wa_variant1
        EXCEPTIONS
          not_found     = 1
          program_error = 2
          OTHERS        = 3.
      IF sy-subrc <> 0.
        layout = wa_variant-variant.
      ELSE.
        IF lv_exit = space.
          layout = wa_variant1-variant.
        ENDIF.
      ENDIF.
                           MAIN PROGRAM                              *
    AT SELECTION-SCREEN .
    *For validating the user inputs on selection screen.
      PERFORM  validate_input.
                      START-OF-SELECTION                         *
    START-OF-SELECTION .
      SET PF-STATUS 'ZGUI1'.
      IF p_disp = 'X'.                         "If the display radio button is checked.
       perform zselection.                  "Data is fetched from tables.
      ENDIF.
                     END-OF-SELECTION                              *
    END-OF-SELECTION.
      IF p_disp = 'X'.
       PERFORM buildcat.
       PERFORM display_report.
      ELSEIF p_gen = 'X'.
        PERFORM display_report.
        PERFORM export_report.
      ENDIF.
    *&      Form  validate_input
    Checking input data validation on the display screen.           *
    form validate_input.
    *Local variables for input validation.
    DATA: lv_aufnr type aufnr,
          lv_txt04 type J_TXT04,
          lv_plnbez type matnr.
    IF s_aufnr[] is not initial.
      SELECT aufnr up to 1 rows
      FROM aufk
      INTO lv_aufnr
      WHERE aufnr IN s_aufnr.
      ENDSELECT.
      IF lv_aufnr IS INITIAL.
      MESSAGE e001(zmssg).
      ENDIF.
    ENDIF.
    IF s_txt04[] is not initial.
      SELECT txt04 up to 1 rows
      FROM TJ02T
      INTO lv_txt04
      WHERE txt04 IN s_txt04.
      ENDSELECT.
      IF lv_txt04 IS INITIAL.   "this depicts that if s_txt04 is initial.
      Message e002(zmssg).
      ENDIF.
    ENDIF.
    IF s_plnbez[] is not initial.
      SELECT plnbez up to 1 rows
      FROM afko
      INTO lv_plnbez
      WHERE plnbez IN s_plnbez.
      ENDSELECT.
      IF lv_plnbez IS INITIAL.   "this depicts that if s_plnbez is initial.
      Message e003(zmssg).
      ENDIF.
    ENDIF.
    endform.                    " validate_input
    *&      Form  zselection
          Fetches data                                           *
    form zselection .
    SELECT aufnr  "production order
           gamng  "move number
           plnbez
           FROM afko
           INTO TABLE gi_afko
           WHERE aufnr IN s_aufnr
           AND plnbez IN s_plnbez.
    SELECT matnr
           mtart        "size/fit
           pstat        "variant
           FROM mara
           INTO TABLE gi_mara
           WHERE matnr IN s_plnbez.
              Populating final data                                         *
    LOOP AT gi_afko INTO gwa_afko.
      READ TABLE gi_mara INTO gwa_mara with key matnr = gwa_afko-plnbez.
      IF sy-subrc IS INITIAL.
    *Moving t_mara and t_afko data from their work area to work area of t_output.
        MOVE   gwa_mara-mtart TO gwa_output-mtart.
        MOVE   gwa_mara-pstat TO gwa_output-pstat.
        MOVE  gwa_afko-aufnr TO gwa_output-aufnr.
        MOVE  gwa_afko-gamng TO gwa_output-gamng.
        APPEND gwa_output TO gi_output.
        ENDIF.
    ENDLOOP.
    *Populating the quantity field
      LOOP AT gi_output INTO gwa_output.
        gwa_output-quantity = '1'.
        MODIFY gi_output FROM gwa_output INDEX sy-tabix TRANSPORTING quantity.
    *Concategnating aufnr, pstat into barcode
        CONCATENATE gwa_output-aufnr gwa_output-pstat INTO gwa_output-barcode .
        MODIFY gi_output FROM gwa_output INDEX sy-tabix TRANSPORTING barcode.
      ENDLOOP.
    endform.                    " zselection
    *&      Form  buildcat
          text
    form buildcat.
      CLEAR gwa_fieldcat.
      gwa_fieldcat-fieldname = 'AUFNR'.
      gwa_fieldcat-seltext_l = 'PRODUCTION ORDER'.
      gwa_fieldcat-tabname = 'GI_OUTPUT'.
      gwa_fieldcat-emphasize = 'C201'.
      gwa_fieldcat-col_pos = 1.
      APPEND gwa_fieldcat TO gi_fieldcat.
      CLEAR gwa_fieldcat.
      gwa_fieldcat-fieldname = 'GAMNR'.
      gwa_fieldcat-seltext_l = 'MOVE NUMBER'.
      gwa_fieldcat-tabname = 'GI_OUTPUT'.
      gwa_fieldcat-emphasize = 'C201'.
      gwa_fieldcat-col_pos = 2.
      APPEND gwa_fieldcat TO gi_fieldcat.
      CLEAR gwa_fieldcat.
      gwa_fieldcat-fieldname = 'MTART'.
      gwa_fieldcat-seltext_l = 'SIZE/FIT'.
      gwa_fieldcat-tabname = 'GI_OUTPUT'.
      gwa_fieldcat-emphasize = 'C201'.
      gwa_fieldcat-col_pos = 3.
      APPEND gwa_fieldcat TO gi_fieldcat.
      CLEAR gwa_fieldcat.
      gwa_fieldcat-fieldname = 'PSTAT'.
      gwa_fieldcat-seltext_l = 'VARIANT'.
      gwa_fieldcat-tabname = 'GI_OUTPUT'.
      gwa_fieldcat-emphasize = 'C201'.
      gwa_fieldcat-col_pos = 4.
      APPEND gwa_fieldcat TO gi_fieldcat.
      CLEAR gwa_fieldcat.
      gwa_fieldcat-fieldname = 'QUANTITY'.
      gwa_fieldcat-seltext_l = 'QUANTITY'.
      gwa_fieldcat-tabname = 'GI_OUTPUT'.
      gwa_fieldcat-emphasize = 'C201'.
      gwa_fieldcat-col_pos = 5.
      APPEND gwa_fieldcat TO gi_fieldcat.
      CLEAR gwa_fieldcat.
      gwa_fieldcat-fieldname = 'BARCODE'.
      gwa_fieldcat-seltext_l = 'BARCODE'.
      gwa_fieldcat-tabname = 'GI_OUTPUT'.
      gwa_fieldcat-emphasize = 'C201'.
      gwa_fieldcat-col_pos = 6.
      APPEND gwa_fieldcat TO gi_fieldcat.
    endform.                    " buildcat
    *&      Form  top
          text
    FORM top .
    REFRESH gi_top.
    gwa_top-typ = 'H'.
    gwa_top-info = My alv report'.
    APPEND gwa_top TO gi_top.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        it_list_commentary       = gi_top
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.                "top
    *&      Form  display_report
    form display_report .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
       I_INTERFACE_CHECK                 = ' '
       I_BYPASSING_BUFFER                = ' '
       I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = g_repid
       I_CALLBACK_PF_STATUS_SET          =  'PF-STATUS'
       I_CALLBACK_USER_COMMAND           = ' '
        I_CALLBACK_TOP_OF_PAGE            = 'TOP'
       I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
       I_CALLBACK_HTML_END_OF_LIST       = ' '
       I_STRUCTURE_NAME                  =
       I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      =
       I_GRID_SETTINGS                   =
       IS_LAYOUT                         =
        IT_FIELDCAT                       = gi_fieldcat
       IT_EXCLUDING                      =
       IT_SPECIAL_GROUPS                 =
       IT_SORT                           =
       IT_FILTER                         =
       IS_SEL_HIDE                       =
       I_DEFAULT                         = 'X'
        I_SAVE                            = 'A'
        IS_VARIANT                        = wa_variant1
       IT_EVENTS                         =
       IT_EVENT_EXIT                     =
       IS_PRINT                          =
       IS_REPREP_ID                      =
       I_SCREEN_START_COLUMN             = 0
       I_SCREEN_START_LINE               = 0
       I_SCREEN_END_COLUMN               = 0
       I_SCREEN_END_LINE                 = 0
       I_HTML_HEIGHT_TOP                 = 0
       I_HTML_HEIGHT_END                 = 0
       IT_ALV_GRAPHICS                   =
       IT_HYPERLINK                      =
       IT_ADD_FIELDCAT                   =
       IT_EXCEPT_QINFO                   =
       IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
       E_EXIT_CAUSED_BY_CALLER           =
       ES_EXIT_CAUSED_BY_USER            =
       TABLES
         t_outtab                          = gi_output
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2
    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.                    " display_report
    *&      Form  export_report
          text
    form export_report.
    endform.

    Hi Cinthia,
    Check this Link.
    How Can we genarate Excel file without GUI_DOWNLOAD
    Reward points if useful.
    Regards,
    Abhishek

  • Subject: How to get MB5B report in excel format

    Dear experts,
    Please help me how I get automatically MB5B Report in excel format. In Layout there is no option to convert excel format.
    regards,
    rss
    Edited by: rs_sharma on Jun 26, 2011 10:16 AM

    Dear experts,
    Please help me how I get automatically MB5B Report in excel format. In Layout there is no option to convert excel format.
    regards,
    rss
    Edited by: rs_sharma on Jun 26, 2011 10:16 AM

Maybe you are looking for

  • Deploying Shared Variables to Remote Target?

    I have a 2-application server/client setup where my client(s) merely read information "published" by the server via a Network-Shared Shared Variable.  If I run my server on a "clean machine" (i.e. no LabVIEW development) and I "publish" the shared va

  • Kernel Panic in 10.7.5

    Hi all, I am receiving intermittent kernel panics upon logout, on several of my machines.  This started a few weeks after we added the latest MBox to our systems, and I do have the latest drivers.  There is a myriad of other software on the machine,

  • Equivalent to windows home button

    Reading the MacBook manual, I am on page 63. How do I get back to page 1 without scrolling up for ten minutes? On PC's there's a "Home" button that takes you to the top. What's the Mac (Lion 10.7) equivalent?  Thank you!

  • Synch Calendars IPHONE and OUTLOOK 2003: Appointments 1 hour difference

    I have an IPHONE 3G, Software 2.1. I´m in Brazil, Sao Paulo, DST on. To solve the problem of 1 hour difference when I synch calendars with my outlook 2003, I had to change the Time Zone Management in IPHONE to another city, in Brasil (Recife) wich do

  • How to specify query timeout

    how to set query timeout in code so that if connection breaks then it can restart immediately help me out