Save data to excel using froms_ole builtin

Hi All,
can somebody send me an example how to save any data to excel workbook
using FORMS_OLE builtin package (or OLE2 in later versions) ?
I'm working with forms 4.5
Thanks
Brano

For merging of cells you can refer following code!
[Merging of cells.|https://www.sdn.sap.com/irj/scn/wiki?path=/display/community/oleconceptfordownloadingthereportoutputintoexcel]
Regards,
Lalit Mohan Gupta.

Similar Messages

  • How can i save data in Excel

    Hi,
    I want to save data in Excel? But how?
    Can somebody send me a VI?
    Thank you

    If you want to do excel formatting and really have full functionality in Excel without having to buy the reports toolkit, you can use the Excel ActiveX controls. If you have Excel installed you can use ActiveX references to do anything you want excel to do for you. Use an automation reference and select the Excel class. I forget what its called, but you should be able to find what does what without too much problem. You just use methods from the reference. It takes a bit of work to figure out what everything does, but I have written huge formatting vi's that open excel, format cells, run macros, and save files in excel and then close excel when its done. It all depends on how fancy you want to get.
    -Devin
    I got 99 problems but 8.6 ain't one.

  • Problem with uploading data from excel using BDC for tcode f-02

    Hi All,
    I am uploading data from excel using BDC for tcode f-02. The problem here is, while recording, the values of some fields are recording twice. I dont know why it's happening so. But if I run my abap program, I have to give those fields twice in my excel sheet. Otherwise data does not upload. But it is not the feasible way. We must give those fields once in excel. Please tell me, how I can solve the issue.
    With regards,
    Rosaline.

    Hi,
      in BDC each and every action is recording. If your press enter in same screen that also recorded once aging may be this is your case repeating field values will appear. we can solve the problem for repeat fields like below.
    suppose in your excel having repeated field X1 X2 X3 the X2 contains repeated field X3 means delete the X3 field.
    Now In your itab having X1 and X2 fields. While in the LOOP the ITAB pass the X2 field to repeated the fields.
    LOOP at ITAB to WA.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_CURSOR'.
    bdcdata_wa-fval = 'RM08M-EBELN'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'INVFO-BLDAT'.
    bdcdata_wa-fval = wa-X2." 1st time pass the X2 fields
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'INVFO-BLDAT'.
    bdcdata_wa-fval = wa-X2." pass the same value to repeated field
    APPEND bdcdata_wa TO bdcdata_tab.
    Endloop.
    Hope you can understand.
    Regards,
    Dhina..

  • Importing data from Excel using SDK!

    Hi All,
    Can we do a Goods Receipt and Goods Issue via SDK.
    IF so any code available for the same!Secondly can we
    Import data from Excel using SDK!
    Thnx in advance

    Hi Vinayak
    4 your 2nd issue: you can easily use Excel.Application COM-object. In C# exporting from Excel can be:
    Excel.Application     oXL;
    Excel._Workbook     oWB;
    Excel._Worksheet     oSheet;
    string          strTemplatePath;
    strTemplatePath = Application.StartupPath + "WHRequestList.xlt";
    try
         oXL = new Excel.Application();
         oWB     = (Excel._Workbook)(oXL.Workbooks.Add(strTemplatePath));
         oSheet     = (Excel._Worksheet)oWB.ActiveSheet;
         SAPbouiCOM.Item     edDocNum;
         SAPbouiCOM.IEditText specEdDocNum;
         edDocNum = SBOApp.Forms.Item(FormUID).Items.Item("8");
         specEdDocNum = (SAPbouiCOM.IEditText)edDocNum.Specific;
         SAPbouiCOM.Item     edDocDate;
         SAPbouiCOM.IEditText specEdDocDate;
         edDocDate = SBOApp.Forms.Item(FormUID).Items.Item("10");
         specEdDocDate = (SAPbouiCOM.IEditText)edDocDate.Specific;
         oSheet.Cells[2, "F"] = "¹ " + specEdDocNum.String + " îò " + specEdDocDate.String;
         oXL.Visible = true;
         oXL.UserControl = true;
    BTW, don't forget to add Excel object in ProjectReferences
    For sure, importing  (reading) from Excel is the same
    HTH

  • Error in Exporting HRMS people data to excel using WEB EDI.

    Hi ,
    I am using an existing integrator to export people data to excel using WEB ADI.
    When the excel opens it first shows the it is trying to download data, but later shows an error message saying that an error has occurred in the script on this page
    line 18
    Char 5
    Error Object doesn't support this property or method.
    Can anyone please throw some light as to what can be the cause of the error.
    Regards
    Deepak

    Hi experts,
    When I click the "Upload" button on GL Journal WebADI, The following error message is displayed:
    http://myservername:port/OA_HTML/BneApplicationService?bne:encoding=UTF-8
    I think this error is similar as your previous discussion, and I tried the solution as you mentioned, but not worked. If there is any new solution for the errors of this kind?
    Some Environment parameters are as following:
    Product: EBS 12.1.1
    Browser: IE 7.0 and Firefox 3.5.5
    Hope for your advice.
    Thanks in advance.

  • Using OBIEE Scheduler to export and save data in excel/pdf

    Hi
    Is it possible to use obiee scheduler and run particular reports and export the data into excel/pdf and save this file at given location on server.
    env: obiee 11g/linux OS
    Thanks for any ideas.

    Hi,
    Yes it is possible.
    As per my knowledge we don't have such option but we can do one way.
    Using IBOTS you can store specific report and specific time in specific location.
    Note : Using JS script.
    Are you going to implement this way send me your mails id will send you js script for doing this.
    Re: Auto SAVE to excel -- Please refer this thread.
    Create js file using the below script and add this js scrif in your ibot advanced tab.
    var FSO = new ActiveXObject("Scripting.FileSystemObject");
    var foldername = 'D:\IBOT'
    if (FSO.FolderExists(foldername))
    var fileName = foldername + "\\" +Parameter(1);
    var fooFile = FSO.CopyFile(Parameter(0), fileName, true);
    else
    FSO.CreateFolder(foldername);
    var fileName = foldername + "D:\IBOT" + Parameter(1);
    var fooFile = FSO.CopyFile(Parameter(0), fileName, true);
    Thanks,
    Satya

  • How to save then quit excel using activeX

    The task that I need to do is open existing excel file, append data to the last row, save data then close it. Everything works fine except saving the data. I used property workbook note to save then invoke node to close a workbook then invoke node to quit excel application. I watched and see that the data is written to the sheet but when I closed it, it is not saved.
    System: Window NT and Excel2000
    Thank you

    mai wrote:
    >
    > The task that I need to do is open existing excel file, append data to
    > the last row, save data then close it. Everything works fine except
    > saving the data. I used property workbook note to save then invoke
    > node to close a workbook then invoke node to quit excel application.
    > I watched and see that the data is written to the sheet but when I
    > closed it, it is not saved.
    >
    > System: Window NT and Excel2000
    Use Task Manager to check if Excel is still running.
    I find that the programmatic close of Excel doesn't work. Excel is left
    running until you actually quit either LabVIEW or the built app!
    Side-effect: if you then launch Excel to view a document, the screen
    isn't redrawn right.
    Mark

  • Problem with writing continuous data to excel using using Report Generation vi's

    Hey Everyone,
    I am trying to read the data from DAQ and write to excel continuously using Report Generation vi's. 
    But when I run the VI, it writes only one interation of the while loop (gathering data from DAQ continuously) and doesn't append the data into the same file when I run it again after stoping the VI. 
    I have attached the VI i created. Please let me know if you have any idea to solve this issue. 
    Thanks
    Attachments:
    sample 5.vi ‏35 KB

    There are two problems with your VI.  First, the basic logic of writing/appending to a file (Excel, TDMS, anything) should go something like this:  Open the file, position yourself at the end of the file, then, in the loop, acquire data and write it to the file until you are finished with data acquisition.  When you exit the acquire/write to file loop, then close the file.  In particular, the opening and the closing of the file should not be inside the loop.
    As others have pointed out, writing to Excel might not be optimal, particularly if you are acquiring data at a high rate (and would therefore be writing a lot of data). We actually use Excel in our data acquisition routine, mainly reading from a WorkSheet to get the parameters of a particular stimulus, but also writing the outcome of the response to the stimulus.  As it happens, our "acquisition rate" in this example is on the order of several samples per minute, so there's no problem using Excel (we also sample 16 channels of analog data at 1 KHz -- this gets written as a binary file).
    Second, if you really do want to use Excel, use the (existing) Excel file to which you want to append as the "template" argument of the New Report function.  Then use the Excel Get Last Row function to position yourself at "end of file", as noted above.
    Good Luck.
    Bob Schor

  • Save data to mysql using AS3 + Flash Builder(flex) OR AS3+AMFPHP? or AS3

    Hi,
    i just want to confirm with you guys about saving data to mysql using Action script 3.
    I am now developing RPG game that user can save data again and again to the MySQL.
    I searched on the net and found few solutions:
    AS3 alone using URL Loader
    AS3 + Flex +Php to save data to mysql
    AS3 + AMFPHP to save data to mysql
    This make me confused as there are too many options but i do not know which one is better for me
    or what are their limitations...
    Could you guys help me on this?

    For developing you can use the server (install like any other software), but the Zend framework is nothing more than php files, so all you need to do is upload the framework to you hosting server and all should be well.. You may have to configure a few things, but you should be able to do that yourself.
    There's plenty of documentation on installing and configuring Zend on their website.
    So, only get the server edition if you don't already have a dev server (on you computer) installed, like Apache. Otherwise, just grab the framework:
    http://framework.zend.com/download/latest
    Select "minimal package" on the page above to only get the framework (no install). Or grab both and see what each one does but the minimal package is what you need to upload to your hosting server.
    As for where Flex/Flash Builder comes in.. FB is the tool you use to create a Flash/Flex application.
    Zend, AMFPHP, etc.. is used to communicate with your backend from your application, using RemoteObject
    RemoteObject API
    http://livedocs.adobe.com/flex/3/langref/mx/rpc/remoting/RemoteObject.html
    Using RemoteObject components
    http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_4.html

  • How to save datas automaticly making use of SQL Toolkit ?

    Hello !
    I have amounts of datas to be saved automaticly,so I want to use database.I've  registered ODBC data source in my computer.
    As the test datas are saved automaticly,I only write a function to save the datas into database.
    //write datas into database
    void WriteYBdata(char* FileName)
    char *time1;
    char *date1;
    char date[27];
    int hstmt,id,status;
    date1 = DateStr ();
    time1 = TimeStr ();
    Fmt(date,"%s<%d[w4p0]/%d[w2p0]/%d[w2p0]",date1,time1);
    hstmt = DBActivateSQL (hdbc, "SELECT * FROM ybdata");
    DBBindColInt (hstmt, 1, &id, &status);
    DBBindColChar (hstmt, 2, 27, date, &status, "");
    DBBindColFloat (hstmt, 3, &CH4, &status);
    DBBindColFloat (hstmt, 4, &CO2, &status);
    DBBindColFloat (hstmt, 5, &O2, &status);
    DBBindColFloat (hstmt, 6, &CO, &status);
    DBBindColFloat (hstmt, 7, &H2S, &status);
    DBBindColInt (hstmt, 8, &TEM, &status);
    DBBindColInt (hstmt, 9, &HUM, &status);
    DBCreateRecord(hstmt);
    DBPutRecord(hstmt);
    DBDeactivateSQL(hstmt);
    void WritePSMdata(char* FileName)
    char *time2;
    char *date2;
    char date[27];
    int hstmt,id,status;
    date2 = DateStr ();
    time2 = TimeStr ();
    Fmt(date,"%s<%d[w4p0]/%d[w2p0]/%d[w2p0]",date2,time2);
    hstmt = DBActivateSQL (hdbc, "SELECT * FROM psmdata");
    DBBindColInt (hstmt, 1, &id, &status);
    DBBindColChar (hstmt, 2, 27, date, &status, "");
    DBBindColInt (hstmt, 3, &wy_voltage,&status);
    DBBindColFloat (hstmt, 4, &zy_y1, &status);
    DBBindColFloat (hstmt, 5, &zl_i1, &status);
    DBBindColInt (hstmt, 6, &wx, &status);
    DBBindColInt (hstmt, 7, &wg, &status);
    DBBindColInt (hstmt, 8, &ws, &status);
    DBCreateRecord(hstmt);
    DBPutRecord(hstmt);
    DBDeactivateSQL(hstmt);
     I connect the database in the main function.
    I've been debug the program and it communicates normally, but it does not save datas into the database.
    The attachment is my program.It is my first time to use SQL Toolkit and I'm not familiar with it.  I would appreciate it very much if you could give me some help..
    Best regards.
    xiepei
    I wouldn't care success or failure,for I will only struggle ahead as long as I have been destined to the distance.
    Attachments:
    Sava All Data.zip ‏37 KB

    Hi !
    Thank you very much for your reply.
    That line I want to set the time format and it could use the funtion  
    DBBindColChar (hstmt, 2, 27, date, &status, "");
    I do not know it is right or wrong.I could not see any response in this line.
    My original idea is recording the date and time when saving the datas.
    Would you have any good idea according to it ?
    I wouldn't care success or failure,for I will only struggle ahead as long as I have been destined to the distance.

  • Export data to excel using DOI(desktop Office integration) technique

    Hi Experts,
    I have the requirement to export data to excel file, I have some idea using OLE but no idea of exporting to excel using DOI, Please help me by providing sample code for it.
    My requirement also include merging of cells and coloring of cells.
    Thanks
    Rohit

    For merging of cells you can refer following code!
    [Merging of cells.|https://www.sdn.sap.com/irj/scn/wiki?path=/display/community/oleconceptfordownloadingthereportoutputintoexcel]
    Regards,
    Lalit Mohan Gupta.

  • Export data to Excel + use of xsd

    Hi,
    I'd like to export data from oracle to excel using pl/sql. These files go to subcontractors who will have to make some kind of customization to that data. I want to prevent these subcontractors from writing trash to this excelfile (writing text to a numbercolumn). As far as I know, this can be done using xml schema (supported since excel 2003).
    Is it possible to generate an excelfile using pl/sql and also include an xml-schema according to the columntype defined inside the database?
    Oracle Version is 11GR1
    Thanks

    Thanks for your reply.
    As far as my understanding of xml and xsd is correct: XML is used to transfer data to an excel-sheet. This is the data from a table/query or something like that.
    The XML Schema defines the structure of this data. Lets say you have the following table:
    create table test(
    x number
    ,y varchar2(20)
    Exporting the content of this table might result in the following excel-sheet
    x | y
    |20 | test |
    |30 | test |
    Because this excelfile is sent to a subcontractor, I can't control the data he inserts into x or y. He might insert
    x | y
    |20 | test |
    |30 | test |
    |test | 40 |
    When trying to import this table, there would be errors. Now I'll call the subcontractor telling him that he's not allowed to insert text into x. To avoid this situation, I'd like to use XML Schema. If there is another way to prevent this situation from happening, pls tell me.

  • Some problem of download BSP data into excel using  cl_bsp_utility= download

    Hello Experts,
    I have read the blog of thomas.jung for download bsp data into excel, and it's working correct, and after some try and error, now I can download the excel with multi sheets.It's all cool except one thing.....when I add a button on the standard screen of the supplier qualification of the slc to download the excel file, after the popinp up screen, the standard screen can't do any operation at all......there are no any error message and the downloaded file is all correct .
    Does any one know what can I do?

    any ideas?
    By the way, after some research, maybe the issue was caused by the setup of the button, but I don't know how to fix it...0rz
    the standard code for buttton is
    lv_id = mv_id && '>display'.
    lo_edit_display_button = cl_thtmlb_button=>factory( id       = lv_id
                                                       text     = lv_button_text
                                                   tooltip  = lv_button_text
                                                   enabled  = 'TRUE'
                                                  onclick  = lv_button_action ).
    WHILE io_page_context->element_process( element = lo_edit_display_button ) = if_bsp_element=>co_element_continue.
    ENDWHILE.
    so I copy it and modify like this:
    lv_id = mv_id && '>download'.
        lo_download_excel_button = cl_thtmlb_button=>factory( id       = lv_id
                                                            text     = w_text
                                                        tooltip  = w_text
                                                        enabled  = 'TRUE'
        onclick  = /srmsm/if_ql_ext_ui_c=>ZC_ACTION_DOWNLOAD_EXCEL
    WHILE io_page_context->element_process( element = lo_download_excel_button ) = if_bsp_element=>co_element_continue.
    ENDWHILE.

  • Refreshing data in excel using .iqy

    I have created Discoverer reports where I exported the query as a .iqy and then refresh the data in excel.  For the most part this works great, skipping the whole Discoverer process.  But I have one report that gives me an error "The site reports that the request is not valid" when I refresh.  It just started this and does this all the time now.  But there is another report which gives me the same message, but if I keep trying to refresh, it will work the 2nd or 3rd time.  Is this because there is too much data or time governor on it?  If I do run it in Discoverer, it takes less than 5 minutes to run.
    Thanks.
    Oracle BI Discoverer 11g (11.1.1.6.0)
    Oracle Business Intelligence Discoverer Plus 11g (11.1.1.6.0)
    Discoverer Model - 11.1.1.6.0
    Discoverer Server - 11.1.1.6.0
    End User Layer - 5.1.1.0.0.0
    End User Layer Library - 11.1.1.6.0
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    Copyright © 1999, 2009, Oracle.  All rights reserved.

    I have created Discoverer reports where I exported the query as a .iqy and then refresh the data in excel.  For the most part this works great, skipping the whole Discoverer process.  But I have one report that gives me an error "The site reports that the request is not valid" when I refresh.  It just started this and does this all the time now.  But there is another report which gives me the same message, but if I keep trying to refresh, it will work the 2nd or 3rd time.  Is this because there is too much data or time governor on it?  If I do run it in Discoverer, it takes less than 5 minutes to run.
    Thanks.
    Oracle BI Discoverer 11g (11.1.1.6.0)
    Oracle Business Intelligence Discoverer Plus 11g (11.1.1.6.0)
    Discoverer Model - 11.1.1.6.0
    Discoverer Server - 11.1.1.6.0
    End User Layer - 5.1.1.0.0.0
    End User Layer Library - 11.1.1.6.0
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    Copyright © 1999, 2009, Oracle.  All rights reserved.

  • Save as to Excel using vba

    Post Author: shark70
    CA Forum: Desktop Intelligence Reporting
    Hi
    The vba below saves a file into excel then does some formatting but I need to use the saveas function to set a password for the excel file when opening.
    The code in bold is where I am getting stuck
    Any ideas on where I'm gioing wrong, I'm fairly new to vba unfortunately
    Cheers
    Sub SetantaDSAT()
    ActiveDocument.RefreshActiveDocument.SaveAs ("K:\CLIENTS (LIVE)\Setanta\08. New Daily Reports\DTT and DSAT Case Type Reports\2008\May 08\") & Format(Date, "ddmmyyyy") & "_" & " TestSetanta DTT Case Type_Subtype Analysis" & ".xls"
    Set xlsApp = CreateObject("Excel.Application")xlsApp.Visible = TruexlsApp.Workbooks.Open ("K:\CLIENTS (LIVE)\Setanta\08. New Daily Reports\DTT and DSAT Case Type Reports\2008\May 08\") & Format(Date, "ddmmyyyy") & "_" & " TestSetanta DTT Case Type_Subtype Analysis" & ".xls"
    With xlsApp.Worksheets("DSAT Case Type").Activate.ActiveWindow.DisplayGridlines = False.Columns("B:B").EntireColumn.AutoFit.Columns("C:C").EntireColumn.AutoFit.ActiveWindow.Zoom = 75.ActiveWorkbook.SaveAs Filename:="C:\James\Check\Book22.xls", _        FileFormat:=xlNormal, Password:="test", WriteResPassword:="", _        ReadOnlyRecommended:=False, CreateBackup:=FalseEnd With
    End Sub

    one other thought is that you can create text files with a batch process inside of acrobat.  Advanced ---> Document Processing ----> Batch Processing.
    Choose new sequence, give it a name
    Step 1: Select Commands ----> Choose "execute javascript", then hit "Add."  Click on "Execute Javascript" that was just added on the right, then hit the edit button and toss in the script below that I grabbed from the javascript samples (also, if your docs have multiple pages you'll need to embed the for loop into another for loop that cycles through each page).  You'd also want to change the name of the saved txt file to the name of pdf you're doing it to.  It shouldn't be that hard, but I'm guessing you're probably alot more familiar with VBA then javascript which is why you're choosing to do it from excel.  I'm kind of in the same boat of having written a bunch of VBA, but not much javascript.  I highly recommend investing some time into learning acrobat scripting b/c VB does have it's limitations when it comes to messing with PDF's.
    * function to extract the text content of the current page and save to a file.
    try  {
    var p = this.pageNum;
    var n = this.getPageNumWords(p);
    app.alert("Number of words in the page: " + n);
    var str = "";
    for(var i=0;i<n;i++) {
    var wd = this.getPageNthWord(p, i, false);  
    if(wd != "") str = str + wd;  
    // save the string into a data object
    this.createDataObject("whatever.txt",str); 
    // pop up a file selection box to export the data
    this.exportDataObject("whatever.txt");
    // clean up
    this.removeDataObject("whatever.txt");
    } catch (e)  { 
    app.alert(e)

Maybe you are looking for