Color to the header of the excel sheet which is downloaded from report

Hi ,
According to my requirement i need to Color to the header of the excel sheet which was getting downloaded from the report output.For the downloading to the excel i am using "EXCEL_OLE_STANDARD_DAT" function module.In the report output color is getting displayed.
so suggest me how can i achieve this.
Thanks in Advance,
Kiranmai

Hello,
As far as I know, using EXCEL_OLE_STANDARD_DAT directly is not very flexible and it doesn't have any coloring options.
However, if you use OLE manually in your code, you can get color.. check this sample program
*& Report  ZKRIS_OLE3_PALETTE
*& Displays the full OLE color range in excel
REPORT  ZKRIS_OLE3_PALETTE.
TYPE-POOLS ole2 .
DATA:  count TYPE i,
       count_real TYPE i,
       application TYPE ole2_object,
       workbook TYPE ole2_object,
       excel     TYPE ole2_object,
       sheet TYPE ole2_object,
       cells TYPE ole2_object.
CONSTANTS: row_max TYPE i VALUE 256.
DATA index TYPE i.
DATA:
      h_cell        TYPE ole2_object,        " cell
      h_f           TYPE ole2_object,        " font
      h_int         TYPE ole2_object,
      h_width       TYPE ole2_object,
      h_columns     TYPE ole2_object,
      h_rows        TYPE ole2_object,
      h_font        TYPE ole2_object,
      h_entirecol   TYPE ole2_object.
DATA: h_range       TYPE ole2_object.
DATA: h_merge       TYPE ole2_object.
CREATE OBJECT excel 'EXCEL.APPLICATION'.
IF sy-subrc NE 0.
  WRITE: / 'No EXCEL creation possible'.
  STOP.
ENDIF.
SET PROPERTY OF excel 'DisplayAlerts' = 0.
CALL METHOD OF excel 'WORKBOOKS' = workbook .
SET PROPERTY OF excel 'VISIBLE' = 1.
* creating workbook
SET PROPERTY OF excel 'SheetsInNewWorkbook' = 1.
CALL METHOD OF workbook 'ADD'.
CALL METHOD OF excel 'WORKSHEETS' = sheet
  EXPORTING
    #1 = 1.
SET PROPERTY OF sheet 'NAME' = 'Color Palette'.
CALL METHOD OF sheet 'ACTIVATE'.
DATA: col TYPE i VALUE 1,
row TYPE i VALUE 2,
col1 TYPE i VALUE 2,
col_real TYPE i VALUE 1.
row = 1.
col = 3.
CALL METHOD OF excel 'Cells' = h_cell
  EXPORTING
    #1 = row
    #2 = col.
SET PROPERTY OF h_cell 'Value' = 'No.'.
col = col + 1.
CALL METHOD OF excel 'Cells' = h_cell
  EXPORTING
    #1 = row
    #2 = col.
SET PROPERTY OF h_cell 'Value' = 'Background'.
col = col + 1.
CALL METHOD OF excel 'Cells' = h_cell
  EXPORTING
    #1 = row
    #2 = col.
SET PROPERTY OF h_cell 'Value' = 'Foreground with white background'.
col = col + 1.
CALL METHOD OF excel 'Cells' = h_cell
  EXPORTING
    #1 = row
    #2 = col.
SET PROPERTY OF h_cell 'Value' = 'Foreground with black background'.
CALL METHOD OF excel 'Rows' = h_rows
  EXPORTING
    #1 = '2:2'.
SET PROPERTY OF h_rows 'WrapText' = 1.
col = 9.
CALL METHOD OF excel 'Cells' = h_cell
  EXPORTING
    #1 = row
    #2 = col.
SET PROPERTY OF h_cell 'Value' = 'No.'.
col = col + 1.
CALL METHOD OF excel 'Cells' = h_cell
  EXPORTING
    #1 = row
    #2 = col.
SET PROPERTY OF h_cell 'Value' = 'Background'.
col = col + 1.
CALL METHOD OF excel 'Cells' = h_cell
  EXPORTING
    #1 = row
    #2 = col.
SET PROPERTY OF h_cell 'Value' = 'Foreground with white background'.
SET PROPERTY OF h_cell 'Bold' = 1.
col = col + 1.
CALL METHOD OF excel 'Cells' = h_cell
  EXPORTING
    #1 = row
    #2 = col.
SET PROPERTY OF h_cell 'Value' = 'Foreground with black background'.
CALL METHOD OF excel 'Rows' = h_rows
  EXPORTING
    #1 = '1:1'.
SET PROPERTY OF h_rows 'WrapText' = 1.
GET PROPERTY OF h_rows 'Font' = h_font.
SET PROPERTY OF h_font 'Bold' = 1.
count = 1.
count_real = count.
row = 2.
col = 3.
DO 56 TIMES.
  PERFORM write_num_and_color.
ENDDO.
* autofit
CALL METHOD OF excel 'Columns' = h_columns
  EXPORTING
    #1 = 'C:L'.
GET PROPERTY OF h_columns 'EntireColumn' = h_entirecol.
SET PROPERTY OF h_entirecol 'Autofit' = 1.
* write palette on lhs
*range
CALL METHOD OF excel 'Range' = h_range
  EXPORTING
    #1 = 'A2'
    #2 = 'A20'.
CALL METHOD OF h_range 'Merge' = h_merge .
CALL METHOD OF excel 'Cells' = h_cell
  EXPORTING
    #1 = 2
    #2 = 1.
SET PROPERTY OF h_cell 'Value' = 'Palette'.
SET PROPERTY OF h_cell 'Orientation' = 90.         "angled.
SET PROPERTY OF h_cell 'HorizontalAlignment' = 3.  "center align
GET PROPERTY OF h_cell 'Font'    = h_f.
SET PROPERTY OF h_f 'Bold' = 1.                    "bold
SET PROPERTY OF h_f 'Name' = 'Comic Sans MS'.
SET PROPERTY OF h_f 'Size' = '14'.
SET PROPERTY OF h_cell 'VerticalAlignment' = 2.  "center align
* autofit
CALL METHOD OF excel 'Columns' = h_columns
  EXPORTING
    #1 = 'A:A'.
GET PROPERTY OF h_columns 'EntireColumn' = h_entirecol.
SET PROPERTY OF h_columns 'ColumnWidth' = 4.
*&      Form  write_num_and_color
*       text
FORM write_num_and_color.
  index = row_max * ( row - 1 ) + col.
  CALL METHOD OF sheet 'Cells' = cells
    EXPORTING
      #1 = index.
  SET PROPERTY OF cells 'Value' = count_real.
  col = col + 1.
  CALL METHOD OF excel 'Cells' = h_cell
    EXPORTING
      #1 = row
      #2 = col.
  GET PROPERTY OF h_cell 'Interior'   = h_int.
  SET PROPERTY OF h_int  'ColorIndex' = count_real.
  col = col + 1.
  CALL METHOD OF excel 'Cells' = h_cell
    EXPORTING
      #1 = row
      #2 = col.
  SET PROPERTY OF h_cell 'Value' = 'Sample Text'.
  GET PROPERTY OF h_cell 'Font'    = h_f.
  SET PROPERTY OF h_f 'ColorIndex' = count_real.
  col = col + 1.
  CALL METHOD OF excel 'Cells' = h_cell
    EXPORTING
      #1 = row
      #2 = col.
  GET PROPERTY OF h_cell 'Interior'   = h_int.
  SET PROPERTY OF h_int  'ColorIndex' = 1.
  SET PROPERTY OF h_cell 'Value' = 'Sample Text'.
  GET PROPERTY OF h_cell 'Font'    = h_f.
  SET PROPERTY OF h_f 'ColorIndex' = count_real.
  row = row + 1.
  col = col - 3.
  count = count + 1.
  IF count = 29.
    count = 1.
    row = 2.
    col = col + 6.
  ENDIF.
  count_real = count_real + 1.
ENDFORM.                    "write_num_and_color

Similar Messages

  • Need leading Zeros in the excel sheet which is sent from ABAP

    Hi ,
    I am downloading data from SAP to excel sheet using the WS_DOWNLOAD Function Module. The numeric data in not having leading zeros.  if it is 0010 it is displaying 10 in the excel sheet . i need the leading zeros in the excel sheet. without manulally changing it to Text in the excel sheet .
       Is there any way to do it .
    Thanks,
    Chetan

    Hi Chetan,
      CALL FUNCTION 'WS_DOWNLOAD'
        EXPORTING
          filename                = w_file_path
          filetype                = 'DBF'                       "declare the File type as DBF then leading zeros will appear
          write_field_separator   = 'X'
          confirm_overwrite       = 'X'
        TABLES
          data_tab                = Itab.
    Regards,
    Prabhudas

  • How to download the ALV output with colors into the excel sheet

    Hi,
      I'm having an ALV Grid report output where each and every row has some colors in it. When i download it to an excel sheet whatever the colors that comes on the output of the report the same should come in the excel sheet. When i download the output to an excel sheet using List --> Export -->Local file . If i open the excel files no colors are coming in the excel sheet.
    can anyone tell how to get the colors in the excel sheet also. thanks...
    Regards,
    Rose.

    Hi Camila,
    Use the OLE concept.
    Check the below threads:
    Colors in Excel Sheet
    colors in alv
    Regards,
    Soumya.

  • How to set the Data types of the Excel sheet while exporting details to it.

    Hi All,
    We are trying to export some order details to the excel sheet from a jsp. It is working fine when the local system language is set to English.
    But when i change it to Russian. the details like Line Numbers(e.g: 1.1, 1.2, 1.3 and so on... ) are getting changed into some other data type(e.g: 01.янв, 02.янв, 03.янв and so on....).
    i guess this is mainly due to some data type mismatch, so i tried setting all the possible charset for response in the jsp, but could not succeeded.
    This is only for the details which or of decimal format, working fine for the details which are in String type. like Description, Item name etc...
    As it is high preference issue for our client, Please help me in this regard ASAP.
    Thanks & Regards,
    Praveen Reddy B

    hi Shiv..
    Its not an OAF page but it is from Apps only (i.e.Oracle iStore).
    we tried writing this:
    <%response.setContentType("application/vnd.ms-excel; charset=UTF-8");%>
    <%response.setHeader("Content-Disposition", "attachment; filename=downloadOrders.xls" );%>
    <head>
              <title>Logitech_iStore</title>
    <style>
    table {
    border-style: solid;
    table th.mainHeader {
                                            border-style: solid;
    background-color:#000099;
    border-color:#000000;
    color:#FFFFFF;
    font-family:Arial, Helvetica, sans-serif;
    font-weight:bold;
    font-size:13pt;
    table th {
                                            border-style: solid;
    background-color:#6687C4;
    border-color:#000000;
    color:#FFFFFF;
    font-family:Arial, Helvetica, sans-serif;
    font-weight:bold;
    font-size:12pt;
    table td.color1 {
                                            border-style: solid;
    background-color:#FFFFFF;
    border-color:#000000;
    color:#000000;
    font-family:"Times New Roman", Times, serif;
    font-weight:normal;
    font-size:12pt;
    table td.color2 {
                                            border-style: solid;
    background-color:#C0C0C0;
    border-color:#000000;
    color:#000000;
    font-family:"Times New Roman", Times, serif;
    font-weight:normal;
    font-size:12pt;
                                  table td {
                                            border-style: solid;
    background-color:#FFFFFF;
    border-color:#000000;
    color:#000000;
    font-family:"Times New Roman", Times, serif;
    font-weight:normal;
    font-size:12pt;
    </style>
    </head>
              <body>
              <%
                        /*BigDecimal resp_id=RequestCtx.getResponsibilityId();
                        String respIdParam="";
                        String respkey="";
                        if(resp_id!=null)
                        respIdParam=resp_id.toString();
                        out.println("respIdParam"+respIdParam);
                        logi.oracle.apps.ibe.util.LogiDAOImpl dao=new logi.oracle.apps.ibe.util.LogiDAOImpl();
                        respkey=dao.getRespKey(respIdParam);
                        out.println("respkey"+respkey);
              logi.oracle.apps.ibe.util.LogiOrderDetailsBean orderDetailsBean = new logi.oracle.apps.ibe.util.LogiOrderDetailsBean();
                        java.util.ArrayList ls = new java.util.ArrayList();
                        String resp_key=request.getParameter("respkey");
                        System.out.println(resp_key);
                        String noofDays=request.getParameter("noOfDays");
                        String qCustAcctId=request.getParameter("qCustAcctId");
                        logi.oracle.apps.ibe.util.LogiDAOImpl daoimpl=new logi.oracle.apps.ibe.util.LogiDAOImpl();
                        String decideTab=request.getParameter("decideTab");
                        String startDate=request.getParameter("startDate");
                        String endDate=request.getParameter("endDate");
                        String queryCondition=request.getParameter("queryCondition");
                        String queryOperator=request.getParameter("queryOperator");
                        String queryValue=request.getParameter("queryValue");
                        String queryDateValue=request.getParameter("queryDate");
                        System.out.println("queryDateValue"+queryDateValue);
    %>
                        <table cellspacing="1" cellpadding="1" width="100%" border="0" class="OraBGAccentDark">
    <tr>
    <th><%=AOLMessageManager.getMessageSt("IBE","IBE_LGT_ORD_NUM")%></th>
                                       <th>Customer Name</th>
                                       <th><%=AOLMessageManager.getMessageSt("IBE","IBE_LGT_ORD_DATE")%></th>
                                            <th><%=AOLMessageManager.getMessageSt("IBE","IBE_LGT_BOOKED_DATE")%></th>
                                  <th>Request Date</th>
                                            <th><%=AOLMessageManager.getMessageSt("IBE","IBE_LGT_ORD_STATUS")%></th>
                                            <th><%=AOLMessageManager.getMessageSt("IBE","IBE_LGT_ORD_PO")%></th>
                                  <th>Currency</th>                                                                 
                                            <th>Payment Terms</th>                                                                      <th>Freight Terms</th>
                                       <th>FOB</th>
                                            <th>Sales Channel</th>
                                            <th>Ship to Location</th>
                                            <th>Bill to Location</th>
                                            <th>SalesTerritory Country</th>
                                            <th>Order Type</th>
                                            <th>Order Total</th>
                                            <th><%=AOLMessageManager.getMessageSt("IBE","IBE_LGT_LINE_NUM")%></th>
                                            <th><%=AOLMessageManager.getMessageSt("IBE","IBE_LGT_ITEM")%></th>
                                            <th>Customer SKU</th>
                                            <th>Description</th>
                                            <th><%=AOLMessageManager.getMessageSt("IBE","IBE_LGT_QTY")%></th>
                                            <th>Shipped Quantity</th>
                                            <th>ScheduleShip Date</th>
                                            <th>Unit Price</th>
                                            <th>Extented Amount</th>
                                            <th>Taxes Total</th>
                                            <th>Freight Charges</th>
                                            <th>Case pack charge</th>
                                            <th>Charges Total</th>                                   
                                       <th><%=AOLMessageManager.getMessageSt("IBE","IBE_LGT_LINE_STATUS")%></th>
                                            <th>Ship Date</th>
                                            <th>Warehouse</th>
                                            <th>Tracking Number</th>
                                            <th>Waybill Number</th>
                                            <th>Delivery Number</th>
                                            <th>Pro Number</th>
                                            <th>Hold Applied</th>
                                            <th>Pallet Qty</th>
                                            <th>Pallet#</th>
                                            <th>Invoice Number</th>
                                            <th>Promo Number</th>
                                            <th>Ship Method</th>
    </tr>
    <%          
                             int pSiteid=0;
                             java.math.BigDecimal mSiteId=oracle.apps.ibe.util.RequestCtx.getMinisiteId();
                             if(mSiteId!=null)
                             pSiteid=mSiteId.intValue();
                             out.println("pSiteid"+pSiteid);
                   if(decideTab!=null && decideTab.trim().equalsIgnoreCase("days"))
                             if(qCustAcctId!=null)
                                       ls=daoimpl.downOrderDetails(qCustAcctId,noofDays,pSiteid);
                        else if(decideTab!=null && decideTab.trim().equalsIgnoreCase("dates"))
                             if(qCustAcctId!=null)
                                       ls=daoimpl.downOrderDateDetails(qCustAcctId,queryDateValue,startDate,endDate);
                        else if(decideTab!=null && decideTab.trim().equalsIgnoreCase("condition"))
                             if(qCustAcctId!=null)
                                       ls=daoimpl.downOrderConditionDetails(qCustAcctId,queryCondition,queryOperator,queryValue);
                        for(int i=0;i<ls.size();i++)
                             orderDetailsBean=(logi.oracle.apps.ibe.util.LogiOrderDetailsBean)ls.get(i);
                             String orderNumber= orderDetailsBean.getOrderNumber();          //Order Number
                             if(orderNumber==null)orderNumber="";                         
                             String customerName=orderDetailsBean.getCustomerName();          //Customer Name
                             if(customerName==null)customerName="";
                        String orderedDate=orderDetailsBean.getOrderDate();               //Order Date
                             if(orderedDate==null)orderedDate="";
                             String bookeddate= orderDetailsBean.getBookedDate();          //Booked Date
                             if(bookeddate==null)bookeddate="";
                             String requestdate= orderDetailsBean.getRequestDate();          //Requested Date
                             if(requestdate==null)requestdate="";
                             String orderstatus= orderDetailsBean.getOrderStatus();          //Order Status
                             if(orderstatus==null)orderstatus="";               
                             String ponumber= orderDetailsBean.getPoNumber();               //PO Number
                             if(ponumber==null)ponumber="";
                             String currency=orderDetailsBean.getCurrencyCode();               //Currency
                             if(currency==null)currency="";
                             String paymentterms= orderDetailsBean.getPaymentTerms();     //Payment Terms
                             if(paymentterms==null)paymentterms="";
                             String frieghtterms=orderDetailsBean.getFreightTerms();          //Freight Terms
                             if(frieghtterms==null)frieghtterms="";
                             String fobterms=orderDetailsBean.getFobTerms();                    //Fob Terms
                             if(fobterms==null)fobterms="";
                             String saleschannel=orderDetailsBean.getSalesTerms();          //Sales Channel
                             if(saleschannel==null)saleschannel="";
                             String billtoloc=orderDetailsBean.getBillToLocation();          // Bill to Location
                             if(billtoloc==null)billtoloc="";
                             String shiptoloc=orderDetailsBean.getShipToLocation();          //Ship To Location
                             if(shiptoloc==null)shiptoloc="";
                             String salesterr=orderDetailsBean.getSalesCountry();          // Sales Territory
                             if(salesterr==null)salesterr="";
                             String ordertype=orderDetailsBean.getOrderType();               // Order Type
                             if(ordertype==null)ordertype="";
                             String ordertotal=orderDetailsBean.getOrderTotal();               //Order Total
                             if(ordertotal==null)ordertotal="";
                             String linenumber=orderDetailsBean.getLinenumber();               //Line Number
                             if(linenumber==null)linenumber="";
                             String item= orderDetailsBean.getItem();                         //Item Name
                             if(item==null)item="";
                             String sku= orderDetailsBean.getCustomerSKU();               // Customer SKU
                             if(sku==null)sku="";
                             String desc= orderDetailsBean.getDescription();               //Item Description
                             if(desc==null)desc="";
                             desc = URLEncoder.encode(desc);                                        // Added by Sunil
                             desc = URLDecoder.decode(desc);
                             String qty=orderDetailsBean.getQty();                              //Ordered Quantity
                             if(qty==null)qty="";
                             String shippedqty=orderDetailsBean.getShippedQty();               //Shipped Quantity
                             if(shippedqty==null)shippedqty="";
                             String scheduleqty=orderDetailsBean.getScheduleDate();          //Schedule Date
                             if(scheduleqty==null)scheduleqty="";
                             String unitprice=orderDetailsBean.getUnitPrice();               //Unit Price
                             if(unitprice==null)unitprice="";
                             String xamount=orderDetailsBean.getXAmount();                    //Extended Amount
                             if(xamount==null)xamount="";
                             String taxestotal=orderDetailsBean.getTaxesTotal();               //Taxes Total
                             if(taxestotal==null)taxestotal="";
                             String freightcharges=orderDetailsBean.getFreightCharges();//Freight Charges
                             if(freightcharges==null)freightcharges="";
                             String palletcharges=orderDetailsBean.getPalletSurcharge();     //Pallet Charges
                             if(palletcharges==null)palletcharges="";
                             String chargestotal=orderDetailsBean.getChargesTotal();          //Charges Total
                             if(chargestotal==null)chargestotal="";
                             String linestatus=orderDetailsBean.getLinestatus();               //Line Status
                             if(linestatus==null)linestatus="";
                             String shipdate=orderDetailsBean.getShipDate();                    //Ship Date
                             if(shipdate==null)shipdate="";
                             String warehouse=orderDetailsBean.getWareHouse();               //Ware House
                             if(warehouse==null)warehouse="";
                             String trackingnumber=orderDetailsBean.getTrackingNumber();//Tracking Number
                             if(trackingnumber==null)trackingnumber="";
                             String waybill=orderDetailsBean.getWayBillnumber();               //Waybill Number
                             if(waybill==null)waybill="";
                             String deliverynumber=orderDetailsBean.getDeliveryNumber();     //Delivery Number
                             if(deliverynumber==null)deliverynumber="";
                             String pronumber=orderDetailsBean.getProNumber();               //Pro Number
                             if(pronumber==null)pronumber="";
                             String holdapplied=orderDetailsBean.getHoldApplied();          //Hold Applied
                             if(holdapplied==null)holdapplied="";
                             String palletqty=orderDetailsBean.getPalletQty();               //Pallet Qty
                             if(palletqty==null)palletqty="";
                             String pallethash=orderDetailsBean.getPalletHash();               //Pallet Hash
                             if(pallethash==null)pallethash="";
                             String invoicenumber=orderDetailsBean.getInvoiceNumber();               //invoice Number
                             if(invoicenumber==null)invoicenumber="";
                             String promonumber=orderDetailsBean.getPromoNumber();               //Promonumber
                             if(promonumber==null)promonumber="";
                             String shipmethod=orderDetailsBean.getShipMethod();               //Promonumber
                        if(shipmethod==null)shipmethod="";
                   %>
                   <tr>
                   <td><%=orderNumber%></td>
                   <td><%=customerName%></td>
                   <td><%=orderedDate%></td>
                   <td><%=bookeddate%></td>
                   <td><%=requestdate%></td>
                   <td><%=orderstatus%></td>
                   <td><%=ponumber%></td>
                   <td><%=currency%></td>
                   <td><%=paymentterms%></td>
                   <td><%=frieghtterms%></td>
                   <td><%=fobterms%></td>
                   <td><%=saleschannel%></td>
                   <td><%=billtoloc%></td>
                   <td><%=shiptoloc%></td>
                   <td><%=salesterr%></td>
                   <td><%=ordertype%></td>
                   <td><%=ordertotal%></td>
                   <td><%=linenumber%></td>
                   <td><%=item%></td>          
                   <td><%=sku%></td>
                   <td><%= desc %></td>
                   <td><%=qty%></td>
                   <td><%=shippedqty%></td>
                   <td><%=scheduleqty%></td>
                   <td><%=unitprice%></td>
                   <td><%=xamount%></td>
                   <td><%=taxestotal%></td>
                   <td><%=freightcharges%></td>
                   <td><%=palletcharges%></td>
                   <td><%=chargestotal%></td>
                   <td><%=linestatus%></td>
                   <td><%=shipdate%></td>
              <td><%=warehouse%></td>
                   <td><%=trackingnumber%></td>
                   <td><%=waybill%></td>
                   <td><%=deliverynumber%></td>
                   <td><%=pronumber%></td>
                   <td><%=holdapplied%></td>
                   <td><%=palletqty%></td>
                   <td><%=pallethash%></td>
                   <td><%=invoicenumber%></td>
                   <td><%=promonumber%></td>
                   <td><%=shipmethod%></td>
                   </tr>
                   <%     }
              %>
              </table>
              </body>
              </html>
    Please suggest the needful...
    Praveen Reddy

  • How to modify data in the excel sheet.

    Hi,
    I have a requirement like ,
    i have a excel file which contains only one column (all the data in the single colume )so now i have to modify that excel sheet and have to make some more columns based on my requirement.
    eg:
    column1
    mumbaikolkata
    delhichennai
    mumbaikolkata
    this shud be converted like this
    column1     column2
    mumbai      kolkata
    delhi           chennai
    mumbai      kolkata
    can i directly modify the excel sheet based on my requirement without using internal tables in between.
    like excel ->internal table-> modified internaltable-> excel.
    Edited by: Sravani Bellana on Dec 18, 2008 5:46 AM

    Hi sravani,
    true that we need to specify the rows and columns,
    I have worked on such applications i shall describe the possibilities and then you can find the necessary option,
    1)  Function module:SAP_CONVERT_TO_XLS_FORMAT .
    it needs
    file path p_file type rlgrap-filename and
    i_tab_sap_data  (the internal table name).
    2)  Function module : MS_EXCEL_OLE_STANDARD_DAT
    it needs
    file path p_file like RLGRAP-FILENAME
    data_tab (int_data "internal table with data)
    fieldnames (int_head "internal table with header)
    3) if the download application is a one time then go for the following option:
    write the program to display the data in the internal table on the screen.
    execute the program.
    type %pc on the command bar and try downloading using the options displayed.
    hope any one of these work out.
    get back if you till have any clarificatrion
    thanks
    srikanth

  • BI Publisher Report not Generating any Output in the Excel SHeet

    We have a CUstom BI PUblisher Report .When we run it ,it completes normally but there is no data in the Excel Sheet generated .It shows NO DATA FOUND .But when i run the Query seperately i do get some data . Don't know why it is not viewable in the Excel sheet ,it was working fine few days back .
    Please advice .
    Thanks

    do you use some profile in your script?
    We recently upgraded the database from 10g to11g .
    after that report has no data ?
    is it ebs or obiee?

  • Error while opening the EXCEL Sheet from a Report Program

    Hi All,
    I am getting an error saying 'SYLK: File Format is not valid' when my program is trying to open an excel sheet. I am using the function module WS_EXCEL to download it to excel sheet.
    Following is the code:
    Excel download
    types: begin of t_excel,
             c01(20),
             c02(20),
             c03(20),
             c04(20),
             c05(70),
             c06(20),
             c07(20),
             c08(20),
             c09(20),
             c10(20),
           end of t_excel.
    data: a00_excel type standard table of t_excel.
    concatenate 'C:\' sy-repid sy-uzeit 'FILE01' '.xls' into z_fname.
    condense z_fname no-gaps.
    call function 'WS_EXCEL'
          exporting
               filename = z_fname
          tables
               data     = a00_excel
          exceptions
               others   = 1.
    if sy-subrc ne 0.
       message e019(zsd).
      Download to Excel failed.
    endif.
    a00_excel contains the data that is to be downloaded into the excel sheet. I used the same code in the other program it is working fine. If you see in the type declaration for C5 its 70 characters, i tried putting it as same as others to 20... still it doesnt work.
    Thank You,
    Suresh

    Not sure man,  your code works ok for me.
    report zrich_0001.
    types: begin of t_excel,
    c01(20),
    c02(20),
    c03(20),
    c04(20),
    c05(70),
    c06(20),
    c07(20),
    c08(20),
    c09(20),
    c10(20),
    end of t_excel.
    data: a00_excel type standard table of t_excel.
    data: x00_excel like line of a00_excel.
    data: z_fname type string.
    x00_excel-c01 = 'A'.
    x00_excel-c02 = 'B'.
    x00_excel-c03 = 'C'.
    x00_excel-c04 = 'D'.
    x00_excel-c05 = 'E'.
    x00_excel-c06 = 'F'.
    x00_excel-c07 = 'G'.
    x00_excel-c08 = 'H'.
    x00_excel-c09 = 'I'.
    x00_excel-c10 = 'J'.
    append x00_excel to a00_excel.
    x00_excel-c01 = 'K'.
    x00_excel-c02 = 'L'.
    x00_excel-c03 = 'M'.
    x00_excel-c04 = 'N'.
    x00_excel-c05 = 'O'.
    x00_excel-c06 = 'P'.
    x00_excel-c07 = 'Q'.
    x00_excel-c08 = 'R'.
    x00_excel-c09 = 'S'.
    x00_excel-c10 = 'T'.
    append x00_excel to a00_excel.
    concatenate 'C:' sy-repid sy-uzeit 'FILE01' '.xls' into z_fname.
    condense z_fname no-gaps.
    call function 'WS_EXCEL'
         exporting
              filename = z_fname
         tables
              data     = a00_excel
         exceptions
              others   = 1.
    if sy-subrc ne 0.
      message e019(zsd).
    *  download to excel failed.
    endif.
    Regards,
    Rich Heilman

  • Upload Journal Voutures of customer master from the Excel sheet using BAPI

    Hi experts,
    Can U have any sample program so that it can help me for my coding.

    Hi,
    You need write the abap program in the following manner,
    1. Read the data from the excel sheet and then enforce the checks if at all any in the new program.
    2. Fill all the parameters of the BAPI *BAPI_CASHJOURNALDOC_CREATE *.
    3. After the above BAPI call, you need to call another *BAPI_TRANSACTION_COMMIT *.
    4. Once Transaction commit bapi is successfully executed then only you will get the document number.
    Please follow all the above mentioned steps then you can create the Journal Voutures migrated from an excel sheet to SAP successfully.
    Thanks,
    Mahesh.

  • Change an Object property based on a value coming from the Excel sheet

    hi all
    i've been able to bind a value from the excel sheet to my my component
    but i want to change a property of an object in my component based on this value at the run time.
    during the design time, it works fine
    for example, if my value called "_xvisible"
    and i use to it to hide some object.
    if i set _xvisible during the design time in excel, it works fine in the run mode.
    but during the run mode, if the value got changed, there is no affect.
    thank you
    Amr

    Hi
    See the xcelsius samples present inside xcelsius SDK. there are examples describing how to bind data which will work at runtime also.
    Hope this helps
    Rush-me

  • How to handle merge cells in the excel sheet while uploading

    Hi guys,
    I have a requirement where i need to upload the excel sheet. The data is given below.
    field1     field2     field3     field4
    a     x     1     1
              2     2
              3     3
         y1     4     4
         y2     5     5
         y3          6
    The output must be
    a     x     1     1
    a     x     2     2
    a     x     3     3
    a     y1     4     4
    a     y2     5     5
    a     y3     5     6
    Here the field1 column is merged.
    Please let me know if you guys have sample code to handle the merge cells in the excel sheet, that would be of gereat help.
    Regards,
    Karthik

    Hi guys,
    I have a requirement where i need to upload the excel sheet. The data is given below.
    field1     field2     field3     field4
    a     x     1     1
              2     2
              3     3
         y1     4     4
         y2     5     5
         y3          6
    The output must be
    a     x     1     1
    a     x     2     2
    a     x     3     3
    a     y1     4     4
    a     y2     5     5
    a     y3     5     6
    Here the field1 column is merged.
    Please let me know if you guys have sample code to handle the merge cells in the excel sheet, that would be of gereat help.
    Regards,
    Karthik

  • How to trigger the workflow from the excel sheet

    hello friends,
    my problem is that i should trigger the workflow from a excel sheet which contains a list of appraisers and appraisees.how to do this. can anyone  help on this.
    thanks.

    Hi Murthy,
    If you are asking if a workflow can be started on R/3 while in Excel - may be possible if you can develop some fancy macros that can make RFC calls to an ABAP function module. I won't even attempt to travel that route.
    Save the excel sheet as CSV or Tab delimited file and process it using ABAP. You can use the WAPI function module SAP_WAPI_CREATE_EVENT (Rel 4.7)to start the Workflow by raising the relevant event. In earlier releases, see FM SWE_EVENT_CREATE.
    Please do keep in mind there could be performance and response time issues for dialog users of the system if you are going to start several workflows using a report program.
    Cheers,
    Ramki.

  • Need to open the excel sheet in the selection screen

    Hi All,
    my requirement is to upload the data from excel sheet but that excel sheet have mutiple tabs and all individual tab have mutiple records inside. I need to open the excel sheet from selection screen and select dynamically any tab and i need to put all the records into internal table of that paricular tab.
    Please suggest how it can be done.
    <removed_by_moderator>
    Thanks,
    Madhu
    Edited by: Julius Bussche on Oct 21, 2008 11:41 AM

    >
    madhu singh wrote:
    > Thanks for reply but this FM is actually transfer the tha data frrom excel sheet to the internal table. which we can use later before that i need to open the excel sheet on the selection screen.
    it depends on which event do you call the FM. If you call in INITIALIZATION (or LOAD-OF-PROGRAM) than the Excel sheet will be uploaded before the selection screen appears at all. The problem with the above FM is that it will upload the actual tabstrip of the sheet, probably not what you want (and definetly no multiple ways). To upload data form Excel from multiple tabs, you need to code it on your own with the help of OLE commands.

  • Unknown column in the excel sheet created using Export to Excel

    Hi,
    I created an excelsheet for the table data using the below link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20java/wdjava%20archive/exporting%20context%20data%20into%20excel%20using%20the%20web%20dynpro%
    20Binary%20Cache.pdf
    but problem here is when i open the excel sheet it is having some unknown columns apart from the expected like amount/#agg next to the actual column amount and it is happening only for the cloumns which have some numbers.
    I dont know where these columns are coming from.
    Send me the solution and points will be rewarded for the helpful answers.
    I want to put some name to the excel file instead of using system created file name.for this requirement where do i need to change the code

    Hi,
    You can export to excel even not relating with any libraries
    Follow this way..
    Take one singleDimensional array, arrColNames[], and one Two dimensional array, arrValues[][].
    File f=new File("Sample.xls);
    FileOutputStream fos=new FileOutputStream(f);
    for(int i=0;i<arrColNames.length;i++)
    fos.write(arrLabels<i>.getBytes());
    fos.write("\t".getBytes());
    fos.write("\n".getBytes());
    for(int j=0;j<noOfRows;j++)
    String arr[]=arrValues[j];
    for(int a=0;a<arr.length;a++)
    if(arr[a]!=null)
         fos.write(arr[a].getBytes());
        fos.write("\t".getBytes());
    fos.write("\n".getBytes());
    fos.flush();
    fos.close();
    The exported excelFile will be stored in your server. If you want to open it using FileDownLoad UI Element,
    Create value attributes resource of type Resource, behaviour of type FileDownLoadBehaviour, reso of type String, fileName of type String , Then then append this code
    FileInputStream fis=new FileInputStream(f);
    FileChannel fc=fis.getChannel();
    byte data[]=new byte[(int)fc.size()];
    ByteBuffer bb=ByteBuffer.wrap(data);
    fc.read(bb);
    fis.close();
    IWDCachedWebResource objCachedWebresource=null;
    if(data!=null)
    objCachedWebresource=WDWebResource.getWebResource
    (data,WDWebResourceType.XLS);
    objCachedWebresource.setResourceName(f.getName());
    wdContext.currentContextElement().setFileName(f.getName());
    wdContext.currentContextElement().setResource(objCachedWebresource);
    wdContext.currentContextElement().setReso(objCachedWebresource.getAbsoluteURL());
    wdContext.currentContextElement().setBehaviour(WDFileDownloadBehaviour.ALLOW_SAVE);
    Regards
    LN

  • What is the class for creating the excel sheet in the java

    please say the class for creating the excel sheet in java (servlets,jsp)

    You can also cheat and rename a html file to xls.
    Just use standard html tables. Should be able to use google to find a working example.

  • How to Get the excel sheet formula from the server side into the j2me app?

    How to Get the excel sheet formula from the server side into the j2me application?
    Here the excel sheet is in server side.i want to do get the excel sheet values (only some part of the excel sheet based on some conditions) from server side into j2me.In j2me I want to done some client side validation based on the formula of excel sheet.Then i resend the new updated data to the server.
    But here deosn't know any mehtod to get the excel sheet formula from server side.So kindly help me to get the excel sheet formula from the server.
    So how to get the excel sheet formula frome the server side into j2me Application...
    Plz guide me to solve this issue...
    thanks & regards, Sivakumar.J

    You should not post a thread more than once. You've crossposted this question to another forum. I have deleted that one.

Maybe you are looking for