In excel sheet tab name is not coming-urgent

hi all,
one small rewquirement. if u run this test program it opens a excel sheet which contains signle tab. here tab name is not coming. i dont no hot to display tabname here.anybody can  make the changes and send me the code.
i am sending my code below.
thanks,
maheedhar.t
REPORT  ytestvij MESSAGE-ID zv.
TABLES sscrfields.
TYPE-POOLS: icon.
TYPES : BEGIN OF zfnames_ds,
        reptext TYPE reptext,
        END OF zfnames_ds.
TYPE-POOLS ole2 .
DATA: wa_fntxt TYPE smp_dyntxt.
DATA : wa_t75_booking TYPE zvt75_booking_h,
        t_t75_booking TYPE STANDARD TABLE OF zvt75_booking_h.
DATA : wa_fields TYPE dfies,
        t_fields TYPE STANDARD TABLE OF dfies.
DATA : wa_fnames TYPE zfnames_ds,
        t_fnames TYPE STANDARD TABLE OF zfnames_ds.
handles for OLE objects
DATA: h_excel TYPE ole2_object,        " Excel object
      h_mapl TYPE ole2_object,         " list of workbooks
      h_map TYPE ole2_object,          " workbook
      h_zl TYPE ole2_object,           " cell
      h_f TYPE ole2_object.            " font
DATA  h TYPE i.
DATA : lin TYPE i.
data: excel       type ole2_object,
      application type ole2_object,
      books       type ole2_object,
      book        type ole2_object,
      sheet       type ole2_object,
      cell        type ole2_object,
      column      type ole2_object.
PARAMETERS : p_input TYPE localfile.
Add button to application toolbar
SELECTION-SCREEN FUNCTION KEY 1.  "Will have a function code of 'FC01'
INITIALIZATION.
Add displayed text string to buttons
  wa_fntxt-icon_id = icon_xls.
  wa_fntxt-icon_text = 'Input File template'.
  wa_fntxt-quickinfo = 'T75 Header Data'.
  sscrfields-functxt_01 = wa_fntxt.
AT SELECTION-SCREEN.
  IF sscrfields-ucomm = 'FC01'.
do nothing
    PERFORM open_excel.
  ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_input.
  PERFORM get_filename USING p_input.
START-OF-SELECTION.
*set pf-status 'ONE'.
END-OF-SELECTION.
  WRITE : lin.
*&      Form  GET_FILENAME
      text
-->  p1        text
<--  p2        text
FORM get_filename USING p_file TYPE rlgrap-filename . "localfile.
  DATA : w_rc TYPE i.
  DATA : wa_file_table TYPE file_table ,
          t_file_table TYPE STANDARD TABLE OF file_table.
  CALL METHOD cl_gui_frontend_services=>file_open_dialog
   EXPORTING
     WINDOW_TITLE            =
     DEFAULT_EXTENSION       =
     DEFAULT_FILENAME        =
     FILE_FILTER             =
     INITIAL_DIRECTORY       =
     MULTISELECTION          =
    CHANGING
      file_table              = t_file_table[]
      rc                      = w_rc
     USER_ACTION             =
    EXCEPTIONS
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      OTHERS                  = 4
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  LOOP AT t_file_table INTO wa_file_table.
    p_file = wa_file_table-filename.
  ENDLOOP.
ENDFORM.                    " GET_FILENAME
*&      Form  open_excel
      text
-->  p1        text
<--  p2        text
FORM open_excel.
SELECT * FROM ZVT75_BOOKING_H
          INTO TABLE t_t75_booking
          UP TO 10 ROWS.
start Excel
  CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
  PERFORM err_hdl.
  SET PROPERTY OF h_excel  'Visible' = 1.
  PERFORM err_hdl.
get list of workbooks, initially empty
  CALL METHOD OF h_excel 'Workbooks' = h_mapl.
  PERFORM err_hdl.
add a new workbook
  CALL METHOD OF h_mapl 'Add' = h_map.
  PERFORM err_hdl.
output column headings to active Excel sheet
  PERFORM fill_cell USING 1 1 1 'Financial year'.
  PERFORM fill_cell USING 1 2 1 'Financial quarter'.
  PERFORM fill_cell USING 1 3 1 'Customer number'.
  PERFORM fill_cell USING 1 4 1 'Booking Year'.
  PERFORM fill_cell USING 1 5 1 'Financial quarter'.
  PERFORM fill_cell USING 1 6 1 'Contract type'.
  PERFORM fill_cell USING 1 7 1 'Sub Contract type'.
  PERFORM fill_cell USING 1 8 1 'Customer purchase order number'.
  PERFORM fill_cell USING 1 9 1 'Booking Amount'.
  PERFORM fill_cell USING 1 10 1 'Currency Key'.
LOOP AT t_t75_booking into wa_t75_booking.
copy items to active EXCEL sheet
   H = SY-TABIX + 1.
   PERFORM FILL_CELL USING H 1 0 wa_t75_booking-BOOKYEAR.
   PERFORM FILL_CELL USING H 2 0 wa_t75_booking-BOOKQTR.
   PERFORM FILL_CELL USING H 3 0 wa_t75_booking-.
   PERFORM FILL_CELL USING H 4 0 wa_t75_booking-BOOKYEAR.
   PERFORM FILL_CELL USING H 5 0 wa_t75_booking-BOOKQTR.
ENDLOOP.
disconnect from Excel
  FREE OBJECT h_excel.
  PERFORM err_hdl.
ENDFORM.                    " open_excel
*&      Form  ERR_HDL
      outputs OLE error if any                                       *
-->  p1        text
<--  p2        text
FORM err_hdl.
data test type sy-subrc.
test = sy-subrc.
  IF test <> 0.
     Message e000(ZV) with 'Error in OLE-Automation:'.
    STOP.
  ENDIF.
ENDFORM.                    " ERR_HDL
      FORM FILL_CELL                                                *
      sets cell at coordinates i,j to value val boldtype bold       *
FORM fill_cell USING i j bold val.
  CALL METHOD OF h_excel 'Cells' = h_zl EXPORTING #1 = i #2 = j.
  set property of sheet 'Name'  = 'T75'.
  PERFORM err_hdl.
  SET PROPERTY OF h_zl 'Value' = val .
  PERFORM err_hdl.
  GET PROPERTY OF h_zl 'Font' = h_f.
  PERFORM err_hdl.
  SET PROPERTY OF h_f 'Bold' = bold .
  PERFORM err_hdl.
ENDFORM.

Hi,
Look at the below thread, i posted complete code in this one, just copy that Program and past in your SAP and run the Program, it will create 3 sheets with the names also, then look at the Sheet name in the code, you will understand where to add the code
Re: format an excel
Regards
Sudheer

Similar Messages

  • Query Name in Excel Sheet tab

    Hi Friends,
    Instead of display Sheet 1 in the Excel sheet tab(Bex), is there a way we can display Query Name in the excel sheet tab? please let me know.
    Thanks,
    KK

    Hi Kumar
    Can you please share how it was solved ?
    Ashish

  • Sheet tab name

    Hi report experts,
    I have a small problem in Oracle Reports 10.1.2.3.0 and Excel 2007.
    When I have created a paper layout report and tries to run that rdf-file on my client PC with parameters:
    * desformat='spreadsheet'
    * destype=FILE
    * desname='c:\temp\test.xls'
    The report is created in correct folder. But when I open the Excel-file, the sheet tab name has been renamed into 'testCWHWZNAU'. The extra characters (CWHWZNAU) seems to change when I rerun the report.
    Is there a way to change the sheet tab name into 'test' from the report created in Oracle Reports?
    Regards
    /Nicklas

    Reports does not create Excel xls files. When using SPREADSHEET, it creates a html file that can be read by Excel. It's up to Excel how to interpret this html file.
    So, it might not even be a Reports "problem", it could be Excel.
    http://docs.oracle.com/cd/E14571_01/bi.1111/b32121/pbr_cla005.htm#i636884
    I would change the file name from c:\temp\test.xls to c:\temp\test.html and see what happens. Excel might open it differently.

  • System Name is not coming

    Hi,
    I have created a new technical system in SLD. Now while I am creating a JCO connection for Metadata System Name is not coming.
    Message Server   : New technical System name is coming here
    System Name      : Its coming blank(It should have SID value)
    Logon Group      : Blank
    Regards,
    Prakash Jha

    Hi,
      please Configure the SLD Data Supplier in Visual Administrator.
    Refer http://help.sap.com/saphelp_nw04/helpdata/en/ea/cd2e807e0e45bf9da67354f452fc05/content.htm
    Hope that helps.
    Regards,
    S.Divakar

  • Vendor Name is not coming in Studio

    Hi,
      Vendor name as well as the name is not coming in the development studio. Rather it takes directly the sap.com as vendor name.
      I have created product, software components(with necessary dependencies). but still i am not getting it right.
      Can some one help me.
    Thanks in advance,
    Kumar

    Hi Kumar,
    1) Check if the Nameserver(SLD) is running as stated above,
    2) Have you defined the "Namespace Prefix"
    3) after doing all steps try after restarting the J2EE Engine.
    also check your steps with the guide <b>"How to Get Started with the SAP NetWeaver Development Infrastructure"</b>, given at the following link,
    Web Application Server How-to Guides for SAP NetWeaver 2004 [original link is broken] [original link is broken]
    Hope above will help you,
    Regards
    Deepak

  • TS1702 In the numbers app 1 spreadsheet keeps trying to update.  It is an excel sheet and I can not delete the sheet as it keeps trying to update? Any help would be appreciated.

    In the numbers app 1 spreadsheet keeps trying to update.  It is an excel sheet and I can not delete the sheet as it keeps trying to update? Any help would be appreciated.

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Change Excel sheet tab color using Open XML dll

    Hi,
    I want to change the sheet tab color of an excel Xlsx  document. I am using the following code but it does not set the sheet color. I get object reference exception when I set the sheet tab color.
    public static string filepath = @"C:\Test\Book1.xlsx";
    private static void ChangeSheetcolor()
    try
    using (SpreadsheetDocument spreadSheetDocument = SpreadsheetDocument.Open(filepath, false))
    WorkbookPart workbookPart = spreadSheetDocument.WorkbookPart;
    IEnumerable<Sheet> sheets = spreadSheetDocument.WorkbookPart.Workbook.GetFirstChild<Sheets>().Elements<Sheet>();
    //my code
    WorksheetPart worksheetPart =
    GetWorksheetPartByName(spreadSheetDocument, "Sheet1");
    if (worksheetPart != null)
    // worksheetPart.Worksheet.SheetProperties.TabColor.Rgb = DocumentFormat.OpenXml.HexBinaryValue.FromString("Red");
    worksheetPart.Worksheet.SheetProperties.TabColor.Rgb = DocumentFormat.OpenXml.HexBinaryValue.FromString("#CCCCCC");
    // Save the worksheet.
    worksheetPart.Worksheet.Save();
    catch (Exception ex)
    private static WorksheetPart
    GetWorksheetPartByName(SpreadsheetDocument document,
    string sheetName)
    IEnumerable<Sheet> sheets =
    document.WorkbookPart.Workbook.GetFirstChild<Sheets>().
    Elements<Sheet>().Where(s => s.Name == sheetName);
    if (sheets.Count() == 0)
    //does not exist
    return null;
    string relationshipId = sheets.First().Id.Value;
    WorksheetPart worksheetPart = (WorksheetPart)
    document.WorkbookPart.GetPartById(relationshipId);
    return worksheetPart;
    How to change the sheet tab color using Open XML dlls.
    Thanks
    Ashok

    Hi J_Prasanna,
    I'm afraid that it's not possible with OpenXML SDK, but it's possible if you use Excel PIA along with Internet Explorer. Use the Internet Explorer COM object to render the HTML content, then copy the document, use the Paste method of the Worksheet object
    to paste the text with format.
    Dim IE As Object
    Set IE = CreateObject("InternetExplorer.Application")
    With IE
    .Visible = False
    .Navigate "about:blank"
    .document.body.InnerHTML = Sheets("Sheet1").Range("A1").Value
    .document.body.createtextrange.execCommand "Copy"
    ActiveSheet.Paste Destination:=Sheets("Sheet1").Range("A1")
    .Quit
    End With
    The code is similar if you use managed project.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can I use Power Query to Import a table from Excel sheet range which starts not from the top row?

    Hi,
    Being an experienced Excel user before Power BI, I am just starting to explore the M and Power Query capabilities, and need help already (ain't easy to google this use case somehow):
    I need to import the table which sits in the Excel file with header row in the row 17 of Excel sheet, with some metadata header in the preceding rows of the columns A and B.
    01: Report name, Quick Report
    02: Report Date, 1/1/2014
    17: Employee Name, Manager, etc...
    18: John Doe, Matt Beaver, etc.
    Both (a) direct attempt to load as Excel file and (b) the indirect way through [From Folder] and formula in custom column -- both lead to the same error: "[DataFormat.Error] External table is not in the expected format."
    Specifically, I tried to use the [Power Query -> From File -> From Folder] functionality, select an Excel file and add a custom column to access the binary content: [Add Custom Column] with formula "=Excel.Workbook([Content])".
    It looks like Power Query expects a rectangular range with headers full-width followed by a contiguous table range to import anything, and refuses to load if that is not the case...
    QUESTION: Is there any way to load whatever-formatted data from Excel first, and then manipulate the overall imported range (like referring to rows starting from 17th using "Table.SelectRows" etc.) to read the actual data? Reading and using
    the metadata from header would be a bonus, but that comes second... The main issue is to get something from a non-regular Excel file to later work with using M formulae ...
    Thanks!
    SAM

    Finally found the answer to this one in ():
    You Cannot Open a Password-Protected Workbook
     If the Excel workbook is protected by a password, you
      cannot open it for data access, even by supplying the correct password with
      your connection settings, unless the workbook file is already open in the
      Microsoft Excel application. If you try, you receive the following error
      message:
    Could not decrypt file.
    ANSWER: So, will have either weave in the work with temporary unprotected files or requires opening them before updating the data source (although this almost defeats the purpose of automation...)
    ANSWER to ORIGINAL QUESTION: password was preventing Power Query from reading the Excel file. For solution see above.
    Thanks anyway for participation and inspiration, Imke!

  • Report using excel sheet as data source not working when deployed to production.

    I have a set of SSRS reports that use an excel sheet as a datasource.
    Now when I preview the reports or run them in the Visual Studio IDE on my local machine i.e
    the development machine, the reports run fine & display all correct results.
    However, when we deploy the reports to the Production machine which is on a separate server,
    the following error message is displayed :
    "The current action cannot be completed. The user data source credentials do not meet the requirements to run this report. Either the user data source credentials are not stored in the report server database, or the user data source is configured not to
    require credentials but the unattended execution account is not specified. (rsInvalidDataSourceCredentialSetting)"
    I've copy pasted the connection string used for connecting to the excel file as reference :
    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\MyFolder\CurrentFile.xlsx;Extended Properties="Excel 12.0;HDR=Yes;";
    The excel file has also been uploaded to the machine housing the reporting server (i.e to C:\MyFolder location)

    Hi Aaakar,
    From the error message, please try to change the setting of Credential type for the data source on report manager as follows:
    Go to the Data Sources properties page.
    For the Connect Using option, select Credentials stored securely in the report server.
    In User Name and Password, type credentials that can be used to access the database. If you are using SQL Server as the data source, the user name must be valid for both logging on to the server and for accessing the database that contains the data for
    the report.
    If the user name and password are credentials for a Windows account, select Use as Windows Credentials.
    If you want the report server to pass the credentials of the user accessing the report to the server hosting the external data source, click Windows Integrated Security. In this case, the user is not prompted to type a user name or password.
    For more details about Configure Data Source Properties, please see:
    http://technet.microsoft.com/en-us/library/ms155882.aspx
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Queries inactive in Production Technical name is not coming After Transport

    Hi Folks,
    i transported queries with role into production .
    There queries are coming without their technical name means b'coze its related data-target was not active but now its active even then queries are not coming with their technical name.
    So can we do any manual activation in production or should i go for re-import the same req again into production.
    Plz Suggest me

    Hi Rajan,
    You can do manual activation in production and you can change the technical names of your queries in production.
    Thanks and Kind Regards,
    Lakshman Kumar Ghattamaneni

  • Tabs names are not displayed in Report Composer screen of XL Reporter

    Hi Buddies,
    Below mentioned is the current version of my SAP Business One.
    SAP Business One 2007 B (8.60.033)  SP: 00  PL: 06.
    The problem I am facing is, I cant see the names of the tabs in the Report composer of XL Reporter that comes inbuilt in 2007B. Instead of tab names am getting a combination of alphabets& numbers....... like B1_17_1536 in place of Finacials , B1_30_10496 in place of Budget_Setup, n so on ...
    Could someone help me out in sorting out this problem????????? Is there any other patch level that can be upgraded for rectifying this .......
    Regards,
    AnSan

    Check this thead:
    [Re: Run time 430 error Class does not support automation]
    Also check this SAP Note
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E&note_numm=1223041]

  • Cisco 4503 "1000BaseLH" SFP light is not coming ---- Urgent

    Dear Team,
    I have Cisco 4503 and I have inserted 1000BaseLH and light is not coming up but for 1000BaseSX its fine.
    Please suggest.
    CORE#show int GigabitEthernet1/18
    GigabitEthernet1/18 is down, line protocol is down (notconnect)
      Hardware is Gigabit Ethernet Port, address is 001e.4aa6.b891 (bia 001e.4aa6.b891)
      MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
         reliability 255/255, txload 1/255, rxload 1/255
      Encapsulation ARPA, loopback not set
      Keepalive set (10 sec)
      Full-duplex, Auto-speed, link type is auto, media type is 1000BaseLH
      input flow-control is off, output flow-control is off
      ARP type: ARPA, ARP Timeout 04:00:00
      Last input never, output never, output hang never
      Last clearing of "show interface" counters never
      Input queue: 0/2000/0/0 (size/max/drops/flushes); Total output drops: 0
      Queueing strategy: fifo
      Output queue: 0/40 (size/max)
      5 minute input rate 0 bits/sec, 0 packets/sec
      5 minute output rate 0 bits/sec, 0 packets/sec
         0 packets input, 0 bytes, 0 no buffer
         Received 0 broadcasts (0 multicast)
         0 runts, 0 giants, 0 throttles
         0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
         0 input packets with dribble condition detected
         0 packets output, 0 bytes, 0 underruns
         0 output errors, 0 collisions, 0 interface resets
         0 babbles, 0 late collision, 0 deferred
         0 lost carrier, 0 no carrier
         0 output buffer failures, 0 output buffers swapped out
    CORE#show inventory
    NAME: "GigabitEthernet1/18", DESCR: "1000BaseLH"
    PID: TRF5735AALB202    , VID: A1 , SN: OPA11241478
    Thank You,
    Abhisar.

    Dear Reza,
    we connected cable and it came up. The conclusion is single m9de sfps does not show light where multimode sfp shows light when sfp is connected on switch port.
    Thank you for your suggesion.
    Thank You,
    Abhisar.

  • IMG object is not Coming : Urgent

    Dear Experts,
    In SOLAR02 txn with IMG Object assignment when I am finding the Objects , that time from the structure all nodes for the configuration is not coming in the active project. How to resolve this?
    I have attached SPRO txn here & If I am doing config from here , Customizing requests are not getting generated with respect to Solman Project.
    I have checked with Other projects , there all nodes are coming  & also I have tried with same road map selection in the active project with the previous, though the problem persisting.
    Please give some suggestions.
    Thanks & Regards
    Aniruddha Biswas

    Hi,
    Navigation to check the "Inversion" Option :
    1) Goto Tcode: RSA6 at the R/3 side.
    2) Go to that Datasource in display mode/double click. U will come across all the fields in ur datasource against which there are options SELECTION, HIDE FIELD, <b>INVERSION</b>, FIELD ONLY.
    3)Check whether the INVERSION option is CHECKED for ur FIELD.

  • Excel sheet tabs white on white after 10.4.7

    Hello,
    I updated on 10.4.7 today.
    Now when I open a Excel (X, 10.1.6) file, the registry tabs of the sheets (tables and diagrams) contain white text on white background. Yesterday I still worked on the same file and everything was OK then.
    It is a bit annoying - does anyone have a clue how to get black text again?
    Thank you.
    Powerbook G4, 1.25GHz   Mac OS X (10.4.3)  

    > The current version of Excel is 11.2.3.
    I just had a look (having updated to OS 10.4.7) and
    it seems OK.
    Do you have a particular reason for not updating
    Office - which is free?
    Excel 11.x.x is a part of Office 2004
    Excel 10.x.x is a part of Office X
    The Upgrade Office X --> Office 2004 is a 'major upgrade', which has to be paid for. It's not free...
    However, I found another Excel security update (to 10.1.7) and after installing this one I had black text again.
    Don't ask me if it stays black though

  • Category names are not coming in Gantt chart

    Hi all
    I have a Gantt chart where I am displaying customer name in category axis. But instead of coming those names I am getting category1,category2.. in category axis.Please help.
    Regards
    Sunit

    Hi,
        I think for 4.6 C <fn> must be declared as an internal table and the field names should be given as records and not as one single record.
       the fieldnames internal table should contain records as :
       Field1
       Field2 ....  and not as Field1 Field2 ....
    Regards,
    Srini.

Maybe you are looking for