Creating an Excel File in Background

Hi Guys,
Is there a function or Bapi that allows the creation of an Excel file in a background process?, because the WS_EXCEL function doesn't allow it.
Regards,
Eric

Hi,
If you want to create a file in Background then you have to use OPEN DATASET statement only. WS_EXCEL function module will work only in foreground.
use below statement to open a file in background and use Transfer statement to move a record into this opened file and at last close the dataset using Close statement.
OPEN DATASET p_outfile FOR APPENDING IN TEXT MODE ENCODING DEFAULT.
thanks,
sksingh

Similar Messages

  • Create an Excel File in background

    Ladies and Gentlemen,
    I have a requirement to create an Excel file in a program that will only be executed in background mode.  This automatically rules out GUI_DOWNLOAD or any download funtion that presents the file on the presentation server.
    I think that the 'Open Dataset...' command will work to create the file on the Application server, but this seems a bit archaic to me.  Is there another way of creating the excel file on the application server in background?  I am working on a 4.7 system at the moment, but this is scheduled for a upgrade to ECC6 sometime in the next 12 months, so I'm after a process that will be valid both before and after the upgrade.
    Cheers,
    Steve

    Hi Stephen,
    Use Open dataset, Transfer, Close dataset to create file on Application server.
    Use FM Z_CONV_ITAB_TO_TAB_DELIMITED to convert your lines in TAB delimited format. you can download file from your application server to presentation server using T Code CG3Y and give extension as .xls ...
    As you data is Tab delimited it will automatically get formatted in columns in your EXCEL file.
    Regards,
    Mohaiyuddin

  • How to Create Excel File in Background processing with different colors

    HI All
    I am trying to create Excel file in background & send it to user through e-mail, this i could acheive using fucntion module SO_DOCUMENT_SEND_API1, but here my requirement is i want to put different colors to columns of excel & this should happen in Background processing,
    Initially i completed above requirement by using HTML type of document with attachment type 'ALI'  & formatted output using write statement & used colors, after that i took this o/p using save_list function module & then table compress...etc.
    but i don't know how to achieve same if we need o/p in excel as size of object of excel file is less than that of HTML
    I am thankfull to everybody who will help me.
    Regards
    Lokesh

    Lokesh,
    Iam also trying to populate my text file with colors as an attachment . If you know this please let me know.

  • Create a Excel File in a Background Job

    Hi SAP Gurus,
    I am trying to create an Excel file using a background job but it is not possible.
    In foreground mode i get a file.
    Can someone give an explanation for that? Or someone have a workaround ??
                   Best Regards
                          João Fernandes

    João,
    If you have successfully demonstrated that SAP can write an output to an excel file, then it can do this in background as well as foreground.  The problem is probably not with the fact that it is 'Excel', but that it is trying to write a file in the background to a destination file location that is unknown to the system.
    Generally, without special setup, SAP software is unaware of most file locations that are outside of the SAP system itself.  When you log on through the SAP Gui, the SAP back end can "learn" about certain additional file locations through your PC setup and the SAPGUI session.  This 'knowledge' is lost as soon as you commit your program to a background process.
    Talk to your Basis person, and tell him what you wish to do.  This functionality is possible to do, but probably not in the way you are expecting.
    Best Regards,
    DB49

  • Email an existing excel file in background !!!urgent please ...

    Hi Gurus….
    I wrote an Abap that creates an excel file using the OLE methods for Excel.
    After that i am trying to send the file that Already I have created as an email Attachment.
    I am using FM 'SO_DOCUMENT_REPOSITORY_MANAGER' .
    The problem is that I want to schedule the work to be executed in background but I can’t do it because I can’t pass the Popup Window .
    I say again that the file already exists !!!
    Can anyone help me ???
    Please ….
    Points will be rewarded !!!!

    hi
    in background no body will see the popwindows
    u should stop the popupwindow in front end itself....
    put okcode = save...
    otherwise go to that functionmodule comment the window
    if u comment the window no problem it will process everything

  • How can I create an Excel file?

    Hi,
    How can I create an Excel file using Forms 6i.
    What I'm doing is to create a file using TEXT_IO package an name it .XLS. If a read it double-clicking over the file, it opens Ok but If I open directly from Excel it opens the Convert dialog.
    I need to create an excel file as it was made from within Excel.
    Thank in advance,
    Benjamin

    When you are talking about subfiles, are you talking like Package contents of an application?
    Terminal application in Applications -> Utilities can give a command line grasp of all your files using the du command.
    Type
    man du
    when entering the terminal, followed by the enter key.
    Note, by default the terminal opens at the Home folder.   To navigate outside the Home folder enter "/Volumes/name of mounted drive/folder/subfolder" as your path.  If there are spaces in the name, putting quotes around the whole path can help.    If you end your du command with a > name.txt a text file with the name name.txt will be plugged into your Home directory.  That you can open with Excel and parse by /es thus giving you everything in Excel.

  • How do I create an excel file that has the volume output and the time at which it occured?

    Hello:
    I am using Labview to control a New Era Pump Systems automatic syringe pump and to record diameter measurements from a LaserMike optical comparator. My program is fully functional, the code is attached with all auxilliary files in the NE-50X folder. I mostly understand my program, I used drivers for the NE-50X pump found on the NI website to build my code and added to it as needed.
    If anyone has ideas about how to do any of these three things, your help is greatly appreciated. I have the output from the syringe pump going into a line graph while I run the test with the time on the x-axis and volume on the y-axis. How would I be able to create an excel file from this information? I would like the excel file to have the time in one column and the volume at that time in the next column. I though that I had wired it correctly, however I feel that the time seems to be a little off and very exact. Attached is the block diagram of what I have done.
    Hello:
    If anyone has ideas about how to do any of these three things, your help is greatly appreciated.
    Attachments:
    RATETEST.vi ‏202 KB

    Let me start by answering the specific question, and then I will provide some suggestions on the code.
    The function you want is the "Write to Spreadsheet File", which you're already using, albeit in a confusing means (more later). I was not able to find any place in your code where you're actually acquiring time information, so I don't understand your comment about the time not being exact. (I'm assuming you mean "not", even though that word was not in your actual sentence.)
    As for the code:
    As I mentioned, you're using the "Write to Spreadsheet File" twice, as well as the "Write to Measurement File" Express VI. All three seem to be logging the same information, though one of the "Write to Spreadsheet File" functions is logging some sort of volume and diameter information. Please pick one.
    You're looping around the path for one of the "Write to Spreadsheet File" functions, but not for the other two functions. Why are you looping the path in the first place?
    You' re continuously accruing data into an array to put onto an XY Graph. Please keep in mind that this means the program will slow down as it progresses as this array gets larger and larger, and LabVIEW needs to shuffle memory around. Depending on how fragmented your memory is, you may find the program will crash since LabVIEW cannot allocate a large enough contiguous block of memory for the array.
    Your wiring really needs to be cleaned up. Tip: Right-click on a wire and select "Clean Up Wire".
    In the middle of the diagram you have a case structure in which the True part has a single iteration loop that's adding 1 to the iteration and updating some local variable, and in the False part you're doing something else with it. I have no idea what you're trying to do, but surely there must be a better way to do it.
    You seem to have two tank indicators on top of each other on the front panel and then flipping the visibility of them based on some value. I would think that it would be easier to simply display both at the same time, no? As a user, I would find it somewhat perturbing to see the tanks appear and disappear.

  • Exception while creating a excel file in BPM 10g

    Hi,
    We are facing following issue while creating an excel file from BPM.
    java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at fuegoblock.net.web.NewJspAjaxController.processMethodInvocation(NewJspAjaxController.java:264) at fuegoblock.net.web.NewJspAjaxController.service(NewJspAjaxController.java:46) at fuego.web.execution.servlet.ServletRedirector$ControllerRedirector.forward(ServletRedirector.java:197) at fuego.web.execution.servlet.ServletRedirector.redirect(ServletRedirector.java:58) at fuego.web.papi.TaskExecutor.processRedirect(TaskExecutor.java:224) at fuego.web.papi.TaskExecutor.execute(TaskExecutor.java:104) at fuego.workspace.servlet.ExecutorServlet.doAction(ExecutorServlet.java:117) at fuego.workspace.servlet.BaseServlet.doPost(BaseServlet.java:229) at fuego.workspace.servlet.BaseServlet.doGet(BaseServlet.java:220) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at fuego.workspace.servlet.AuthenticatedServlet.service(AuthenticatedServlet.java:138) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at fuego.web.filter.SingleThreadPerSessionFilter.doFilter(SingleThreadPerSessionFilter.java:64) at fuego.web.filter.BaseFilter.doFilter(BaseFilter.java:63) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at fuego.web.filter.CharsetFilter.doFilter(CharsetFilter.java:48) at fuego.web.filter.BaseFilter.doFilter(BaseFilter.java:63) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) Caused by: java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Workbook at xobject.Views.ReportingView.exportToExcel(ReportingView.xcdl:9) ... 35 more Caused by: java.lang.ClassNotFoundException: org.apache.poi.ss.usermodel.Workbook at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 36 more
    There is a JSP file which invokes the method of BPM, which inturn creates a excel file.
    In JSP we are calling the method in the following way:
    function exportSelectedItemsToExcel(){
         var url="<f:invokeUrl var='reportingView' methodName='exportToExcel'/>";
         url = url + "&bpmRespContentType=application/vnd.ms-excel";
         var windowHandle = window.open(url,'windowName','width=800, height=600, resizable=1, menubar=1');
    POI jars are used to create the excel.
    Also we recently did the migration and applied a patchset of 10.3.3 on 10.3.2. In the previous verison(10.3.2) it was working perfectly fine. When i am trying to test it on localstudio, it is generating the excel file properly.
    Have any one faced any such issues while migration or any other time?

    Manifests are saved with the .mf file extension. Rename your manifest mainfest.mf.

  • Creating an Excel file from table with 40,000 records

    I need help with creating an Excel file for client that has a
    table of 40,000 records. I have code that generates the Excel and
    has worked well in the past but with this much data it is timing
    out.
    I've already informed the client that Excel has limit of
    66000 records. So it might be better to export to CSV as the data
    in this table is going to keep growing.
    If you have time to work with me on this , contact me a
    alexagui [at] gmail [dot] com
    and I can send you more details so you can put together an
    accurate quote.
    Thanks,
    Alex

    asdren_one wrote:
    > I need help with creating an Excel file for client that
    has a table of 40,000
    > records. I have code that generates the Excel and has
    worked well in the past
    > but with this much data it is timing out.
    >
    > I've already informed the client that Excel has limit of
    66000 records. So it
    > might be better to export to CSV as the data in this
    table is going to keep
    > growing.
    >
    > If you have time to work with me on this , contact me a
    alexagui [at] gmail
    > [dot] com
    > and I can send you more details so you can put together
    an accurate quote.
    For so many records my guess is that the concatenation times
    the most
    time so you'll need to use StringBuffer to build the string.
    Google for
    coldfusion and stringBuffer:
    http://www.stillnetstudios.com/2007/03/07/java-strings-in-coldfusion/
    Mack

  • How to create an Excel file from XML in the Receiver File Adapter Comm Ch

    How do I create an Excel file from XML in the Receiver File Adapter Communication Channel? I have my mapping done and I am outputting the file as a comma delimited csv file. However, the target can only process an Excel file (.xls). How can I generate an Excel in XI?
    I saw this blog, but I don't know how to create a XSLT transformation.
    /people/michal.krawczyk2/blog/2005/12/10/xi-generating-excel-files-without-the-java-nor-the-conversion-agent-not-possible
    Any help would be appreciated. Thanks.

    Here are the steps I took to create an XSLT transformation in XI 3.0:
    1. I created my source and target XSDs using XMLSpy.
    2. I created the XSLT mapping from source to target in XMLSpy (referencing the souce XSD schema).
    3. I created another XSLT mapping to format the target into Excel XML.
    4. Import the source and target XSDs in the IR's External Definitions
    5. Zip each XSLT mapping (.xls) and import it into the IR's Imported Archives
    6. Reference the XSL mappings in the Interface Mapping

  • How to create an EXCEL file in Presentation server

    hello experts,
    please suggest  me a solution for the following problem :
    I have an internal table with some data.
    how can i create an excel file with that data in Presentation Server.
    Thanks & Regards
    sasi.

    hi,
        u can use FM: 'DOWNLOAD'.
    it will prompt u for destination - just give the requd filename and extension.                      
    Ex:
        call function 'DOWNLOAD'
             exporting
                 filename                =
                  filetype                = 'DAT'
             tables
                  data_tab                = tb_output
                  fieldnames              = tb_fld_nam
             exceptions
                  invalid_filesize        = 1
                  invalid_table_width     = 2
                  invalid_type            = 3
                  no_batch                = 4
                  unknown_error           = 5
                  gui_refuse_filetransfer = 6
                  customer_error          = 7
                  others                  = 8.
    where,
             tb_output = internal table having the fields which u want in the O/P
    Ex:
             data:  begin of tb_output occurs 0,
                               name_1(20)      type c,
                               name_2(20)      type c,
                       end of tb_output.
             tb_fld_nam = Field headings :
    Ex:
             data:  begin of tb_fld_nam occurs 0,
                            name(25)              type c,
                      end of tb_fld_nam.
                     tb_fld_nam-name = 'Name 1'.
                     append tb_fld_nam.
                     tb_fld_nam-name = 'Name 2'.
                     append tb_fld_nam.
    Thanx & Regards,
    Ajoy

  • How to create an excel file from SAP?

    I needed to create an excel file(with out data) format with fields read from a table.

    check FM
    EXCEL_OLE_STANDARD_DAT
    Regards
    prabhu

  • How to create a excel files  XSL templates

    Hello,
    I want to create a excel file, and i started doing it using POI library, but that it's very hard, and I want a way to create excell files using xsl templates.
    I think that you can do it using apache cocoon, but i don't know how do it. Anyone has done it?
    Thanks

    Check out SsTemplates Spreadsheet Templates for Excel. We release this software a couple months ago based on work that we have done at Carbon Five. It has made working with POI to produce Excel documents in a Java environment an easy part of our development process.
    SsTemplates builds upon the Jakarta POI/HSSF libraries for writing Microsoft Office documents by providing a simple XML templating language for creating Excel documents similar to creating HTML pages with JSP and CSS.
    It's open source and available for download from SourceForge. You can read all about it at http://carbonfive.sourceforge.net/sstemplates/.

  • Create an excel file from java

    I am using Jakarta's POI to create an excel file from MySql. The POI works well when a samll amount of data was written from MySql (created .xls file less than 3500KB). The problem is when a large amount of data need to be written to an excel file, java.lang.OutOfMemoryError Exception in thread "main" appears. In my project, I really need to have a large amount of data to be wriiten ton excel file. Do somebody has good solution for it?
    Thanks

    What about using some text files like csv
    (comma-separated value) file? It is plain text but
    Excel (and other spreadsheet programs) will be able to
    read it.
    But then there will be no formatting and bells and
    whistles. It was just an idea.Excel will also read HTML <TABLE>'s, with full formatting. There are some extra tags for numeric formatting, also. Just create an HTML table, and save to a file with .xls extension, e.g.:
    <TABLE>
    <TR bgcolor="#00FF7F">
    <TH>Agency ID</TH>
    <TH>POS ID</TH>
    <TH>Machine Serial</TH>
    <TH>Disk Serial</TH>
    <TH>MAC ID</TH>
    <TH>System Manufacturer</TH>
    <TH>Machine Type</TH>
    <TH>BIOS Manufacturer</TH>
    <TH>BIOS Version</TH>
    <TH>BIOS Date</TH>
    </TR>
    <TR bgcolor="#9ACD32">
    <TD>1000</TD>
    <TD>1069</TD>
    <TD STYLE='vnd.ms-excel.numberformat:@'>US215199248</TD>
    <TD STYLE='vnd.ms-excel.numberformat:@'>5C5AE88F3</TD>
    <TD STYLE='vnd.ms-excel.numberformat:@'>000423155334</TD>
    <TD>Hewlett-Packard</TD>
    <TD>Desktop</TD>
    <TD>American Megatrends Inc.</TD>
    <TD>JA.01.03US</TD>
    <TD>07/19/2001</TD>
    </TR>
    </TABLE>

  • Create an Excel File Using OPEN DATASET Command

    Hey, everyone.
    How can I create an Excel file by using OPEN DATASET command ??
    The file is created but the columns are no seperated like thay should.
    I need to seperate the internal table's fields with a comma - How can I do it ?
    Here's my code:
    OPEN DATASET filename1 FOR OUTPUT IN TEXT MODE.
    IF SY-SUBRC = 0.
       LOOP AT gt_vend_info into gwa_vend_info.
         TRANSFER gwa_vend_info TO filename1.
         IF SY-SUBRC <> 0.
           EXIT.
         ENDIF.
       ENDLOOP.
    ENDIF.
    Thanks in advance.

    Hi Beki,
    REPORT  ZTESTAA.
    TYPE-POOLS:TRUXS.
    DATA: BEGIN OF ITAB OCCURS 0,
          VBELN LIKE VBAP-VBELN,
          POSNR LIKE VBAP-POSNR,
          END OF ITAB.
    DATA:
    ITAB1 TYPE TRUXS_T_TEXT_DATA.
    SELECT  VBELN
            POSNR
         UP TO 10 ROWS
         FROM VBAP
         INTO TABLE ITAB.
    CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
      EXPORTING
        I_FIELD_SEPERATOR    = ';'
      TABLES
        I_TAB_SAP_DATA       = ITAB
      CHANGING
        I_TAB_CONVERTED_DATA = ITAB1
      EXCEPTIONS
        CONVERSION_FAILED    = 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.
    OPEN DATASET filename1 FOR OUTPUT IN TEXT MODE.
    IF SY-SUBRC = 0.
    LOOP AT gt_vend_info into gwa_vend_info.
    TRANSFER gwa_vend_info TO filename1.
    IF SY-SUBRC <> 0.
    EXIT.
    ENDIF.
    ENDLOOP.
    ENDIF.
    the above code give CSV format file, all fields will be separated by ';'
    Regards
    vijay

Maybe you are looking for