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
---------------------------------------------------------------------------------

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

  • 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

  • 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

  • How can i convert oracle report in excel format using 8i

    hi,
    I want to convert oracle report in excel format using 6i reports. please give the solution with emp table.
    millons of thanks in advance.

    You'll have to use the destype DELIMITEDDATA to render your Report in CSV format. Then set the mime type to Excel. I don't know the exact syntax, so please do a search in metalink for "reports excel" for examples and more info.
    Regards,
    Martin Malmstrom

  • Unable to print xml publisher report in excel format in R12

    Hi All,
    We are unable to print xml publisher report in excel format in R12. We were able to see the excel output but it's printing junk characters while printing and it's printing without any issue with PDF format.
    Please let me know how to fix this issue.
    Thanks,
    Raja

    Hi Raja,
    I presume you have gone through the debugging process of testing your template locally first to get the expected result.....
    If yes, this note might probably be helpful "Changing Output Format to RTF or Excel in XML Publisher Request Does Not Display Output Correctly (Doc ID 404512.1)"
    Good Luck,
    Lamine Balde

  • Unable to save webi report in excel format

    Hi All,
    I have a question. I recently upgrsded my internet explorer from IE 7 to IE 8.
    Previously, i was able to save webi reports in excel format without any issues.Even after upgrading to IE version8, i was able to save webi reoprts to excel without any issues for 2 weeks.
    Suddenly I am unable to save Webi reports in excel format now.When I select the Save to my computer as Excel option the saving dialog box appears and hangs forever.
    Can someone please advise me on this??
    Please hel as it is very urgent.

    Hi All,
    Trying to replicate WEBI Excel Download issue.
    Operating system : Windows 7
    Internet Explorer : IE8 Version 8.0.7600.16385CO.
    Jre Version : 1.6_ greater than 1.8 version.
    If anybody having above specifications in your machines Please try to save a webi reports to excel format and send me the results.

  • 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

  • Urgent- o/p of report in excel format

    Hi All,
    I want to generate o/p of my report in excel format. Please send me the sample code
    for it at [email protected]
    Thanks in advance
    bhushan

    Rajesh,
    yes, with BI Publisher (formerly known as XML Publisher) it's easy.
    But with Reports you don't need to code utl_file to get your excel-output. Beginning with 10g there's for example the possibility to use desformat=spreadsheet. Beginning with 9i there's a nice way to use WebLayout to create excel output.
    Regards
    Rainer

Maybe you are looking for

  • Whih table i can get sap username and sap mail id?

    Hi experts which table can i get username and user-mail id . i need to pick the username(BNAME) data based on the user mail id (SMTP_ADDR). could any one tell the table name where both fields are avaialble. Thanks.

  • I just installed Mountain Lion. I'm having an issue on the log in screen.

    Hello, I just installed Mountain Lion 10.8.2 on my iMac. We have four user accouts on the computer and when you first wake the computer where you would normally choose an account and log in the screen is white. When you move the mouse around it leave

  • Issue in sending a email internet address using 'so_new_document_send_api1'

    Hi ,     I am calling  'SO_NEW_DOCUMENT_SEND_API1' inside an user exit to send an email whenever the notification gets created..If the user exit is called in the same transaction IW21 then the mail is sending successfully.But if the transaction IW21

  • Errors occurred during the extraction(Generic Extraction)

    Hi All, I am facing problems in solving BW Production issues . The following are the Problem  details. Actually there are two Datasources connected to BW System  One is from R/3 and other is from CRM. The problem is with Delta  Request which has been

  • When to buy new macbook?

    My son is heading off to college in September, soooo it's time to pick up a new macbook-whats the current thought on timing? Educators discount? Referb by then??? I'm thinking maybe a newer version could be out by July? Thanks