Create an Excel format file in background w/DATASET Cmds?

I have heard that you can create a file into an excel format file in background mode using dataset commands - anyone know how to do this?  Thanks!

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

Similar Messages

  • Generate and send Excel format file by mail in bakground.

    Hi fellows, i have a requirement, which is to generate an excel file in background and send it attached by e-mail. This file have many characteristics like Freeze pane, Auto filters, and some other format characteristics, One of the ways for achieving this kind of characteristics is using OLE or Desktop Office Integration, but both run in foreground. Other way i found is formatting the excel using XML and then at the moment of sending it by mail, changing extension for xls, but the problem is that it occupies too much space, i imagine cause it is raw xml, for example for a file for 1,000 records and 14 columns generates a file of 1.6Mb which is not like generating the same file using OLE or DOI (24Kb).
    I would like to know if there is a way to use an excel component or another way that takes less space for generating the file with format and also send it by e-mail in background??
    Thanks.
    Noe.

    is 1.6 MB the smallest size you can generate, did you remove every optional tag?
    XLSX format is a compressed XML format valid since office 2007. Maybe you can try to generate it? (I don't exactly know which ZIP algorithm it requires, SAP can compress using the ZLIB Compression Library)
    You may also attach a Windows server to SAP via RFC. You should create an RFC server. You may have a look at this [sdn article - Communication to Presentation Server in Background Mode|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2] for some clues about running an RFC server. I guess you could use a VB script on the server.
    For sending emails, this is a separate question, you may have a look at wiki: sending mails - home page.

  • Converting Text seperated file into excel format file without opening Excel

    Hello Sir,
    I am posting this question again,since i did not get any response,sorry for the inconvinience caused..
    I have a Text file(Test.txt,the data inside it is in specific format seperated by TAB) which i would like to convert it into an Excel file(Test.xsl) without opening MS-Excel.Is there any java code to accomplish it.If yes, can i please get the source code for the same or some Utility.
    I am working on a Windows 2000 platform, on J2EE application server and on CRM based application.
    I had gone through many topics related to my problem,but could not get satisfactory results...
    Any help would be appreciated,
    Thanks in advance

    Hello Sir,
    I am rephrasing my question,i have a Comma Separated File (1042-1.txt)which i would like to convert it into an Excel file (1042-1.xls) without opening MS-Excel using java code...
    So that the data in the Text file gets populated into the columns of the Excel sheet using the java code.
    I am working on a CRM based application and the application is generating a Text file(1042-1.txt) through PL/SQL Packages on the Servers particular directory and this file is getting Downloaded.
    My requirment is that the Users of my application should be presented with an Excel file(1042-1.xls), so that they do not have to Open the Text file in Excel and then do the Importing...instead they should be provided with the Excel file itself...
    Please Can anybody provide me with a solution for the same...
    Thanks,
    Regards.

  • Creating own mbox format file

    Hi all,
    I know we can use JavaMailAPI to read mails by using POP3 server. POP3 able to read only files in mbox format. Now i want to create my own file in mbox format and read it with JavaMailAPI. How can i create my own file( with some example mailid's, headers, and attachments) in mbox format?. Do u have any idea?. Plz, give a solution.
    thanks,
    MAYA

    If you want to create a file that contains a single message in mbox format,
    create the message as a MimeMessage and use the writeTo method to write
    it to the file. All you'll need to do is first write a UNIX-style "From" line before
    the message.
    If you want to create a file that contains a collection of messages, you'll want
    an mbox provider for JavaMail. You can find references to several such
    providers on the JavaMail Third Party Products download page.

  • Excel Format File Upload in SAP APO 4.0

    I have an file on desktop with .xls format. This file I need to upload in SAP ztable in APO .... kindly suggest the various techinques availabe for this....
    kindly find the attached code for the same which I have written..... request you to suggest on this...
    This APO is not supporting following Function module
    1. KCD_EXCEL_OLE_TO_INT_CONVERT
    2. ALSM_EXCEL_TO_INTERNAL_TABLE
    I am attaching the code...
    EPORT ZTEST_EXCEL NO STANDARD PAGE HEADING MESSAGE-ID zsn.
    DATA: Begin of i_temp occurs 0,
           Z_LOCATION like ztest_tran-z_location,
            z_product  like ztest_tran-z_location,
            Z_0_30_DAYS like ztest_tran-Z_0_30_DAYS,
            Z_31_59_DAYS like ztest_tran-Z_31_59_DAYS,
            Z_OVER_59_DAYS like ztest_tran-Z_OVER_59_DAYS,
          End of i_temp.
          data : i_temp1 like i_temp OCCURS 0 WITH HEADER LINE.
          DATA : begin of itab_file occurs 0,
            line(255) type c,
          end of itab_file.
    DATA: v_file type string.
    selection-screen begin of block b1.
    parameters: fl_file like rlgrap-filename lower case.
    selection-screen end of block b1.
      v_file = fl_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = V_FILE
       FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = ' '
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = I_TEMP
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    ..........

  • Looking to create fully editable PDF files with background images

    Hello and thank you, I create menu's and flyers for a group of restaurants. I need to make text editable PDF menus with background images. I believe Livecycle is able to do this, but would really like to hear it from someone who knows for sure. Again thank you.
    Cheers,
    Charlie

    Yes it can. Download a free trial and try it out.

  • Create XML format file in bulk insert with a data file with out delimiter

    Hello
    I have a date file with no delimiter like bellow
    0080970393102312072981103378000004329392643958
    0080970393102312072981103378000004329392643958
    I just know 5 first number in a line is for example "ID of bank"
    or 6th and 7th number in a line is for example "ID of employee"
    Could you help me how can I create a XML format file?
    thanks alot

    This is a fixed file format. We need to know the length of each field before creating the format file. Say you have said the first 5 characters are Bank ID and 6th to 7th as Employee ID ... then the XML should look like,
    <?xml version="1.0"?>
    <BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <RECORD>
      <FIELD ID="1"xsi:type="CharFixed"LENGTH="5"/>
      <FIELD ID="2"xsi:type="CharFixed"LENGTH="2"/>
      <FIELD ID="3" xsi:type="CharFixed" LENGTH="8"/>
      <FIELD ID="4" xsi:type="CharFixed" LENGTH="14"/>
      <FIELD ID="5" xsi:type="CharFixed" LENGTH="14"/>
      <FIELD ID="6" xsi:type="CharFixed" LENGTH="1"/>
    </RECORD>
    <ROW>
      <COLUMNSOURCE="1"NAME="c1"xsi:type="SQLNCHAR"/>
      <COLUMNSOURCE="2"NAME="c2"xsi:type="SQLNCHAR"/>
      <COLUMN SOURCE="3" NAME="c3" xsi:type="SQLCHAR"/>
      <COLUMN SOURCE="4" NAME="c4" xsi:type="SQLINT"
    />
      <COLUMN SOURCE="5" NAME="c5" xsi:type="SQLINT"
    />
    </ROW>
    </BCPFORMAT>
    Note: Similarly you need to specify the other length as well.
    http://stackoverflow.com/questions/10708985/bulk-insert-from-fixed-format-text-file-ignores-rowterminator
    Regards, RSingh

  • Exporting report to excel format via VBA to work in 2007 runtime

    Hi
    What code can I use to export a report to excel format file which will work in Access 2007 runtime?
    Thanks
    Regads

    As I know, you can easily export the data from an MS Access Report to Excel, but it's really hard to get the formats exported along with the data, or just not doable at all. 
    Please see these links:
    http://www.howtogeek.com/howto/microsoft-office/export-an-access-2003-report-into-excel-spreadsheet/
    http://www.access-programmers.co.uk/forums/showthread.php?t=143884
    Also:
    https://social.msdn.microsoft.com/Forums/office/en-US/826a30c5-775e-4a51-b639-2ffb046bfe85/formatted-access-report-to-excel
    Also, keep in mind...it's easy to export the data from a report to Excel.  You can certainly setup Excel as a template, which has all the formatting applied and just sits on your disk drive...somewhere...waiting for you to dump new data into it from
    a new report...whenever you need it.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

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

  • 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

  • ALV Grid to be run in background & to generate output file in Excel format

    I use  REUSE_ALV_GRID_DISPLAY in my program for the ALV output
    My Requirement is Program to be run in a background since it is getting timed out when executed in foreground and also to generate the output file in Excel format. And we are using 4.6 C version.
    how do i attain this?

    Hello,
    One alternate solution can be :
    Execute your report in background and then send the data to Spool .
    From this spool , you can download the data in excel file.
              SUBMIT xyz TO SAP-SPOOL
                 SPOOL PARAMETERS gt_print_parameters.
    Regards,
    Sandeep

  • 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

  • Merge Excel cells when creating file for Background job

    Hi Experts
    I need to create an Excel document and within the excel sheet merge some cells, I can get that done via OLE.
    My problem though comes in with... the Report needs to be scheduled as a background job and therefore OLE does not work!!!
    Does any of you have another solution to merge cells while running in background??
    Your thoughts are greatly appreciated.
    Vic

    Hi Vic,
    You can use the xml transformations for formatting excel. For my case I needed multiple sheets including glossary sheet to be mailed in a particular format , which was achieved by using transformations.
           CALL TRANSFORMATION z_xls_xxx
                SOURCE table = i_tmp_b[]
                RESULT XML wa_xmlstr.
            TRY.
                cl_bcs_convert=>string_to_solix(
                   EXPORTING
                     iv_string   = wa_xmlstr
                   iv_codepage = '4103'  "suitable for MS Excel, leave empty
                     iv_add_bom  = 'X'     "for other doc types
                   IMPORTING
                     et_solix  = l_bin
                     ev_size   = l_size ).
              CATCH cx_bcs.
                MESSAGE e445(so).
            ENDTRY.

  • Report is executing in background and need data(output) in excel format

    Report is executing in background and need data(output) to get downloaded in excel format in my PC from an internal table;;in any drive i.e. C: or D: .When executing in backround it prompt to user with which location excel file to be saved and the name of file.How to download in background in excel format?
    Edited by: PRASHANT BHATNAGAR on Aug 26, 2008 6:24 AM

    Hi
    Download a report to excel with format (border, color cell, etc)
    Try this program...it may help you to change the font ..etc.
    Code:
    REPORT ZSIRI NO STANDARD PAGE HEADING.
    this report demonstrates how to send some ABAP data to an
    EXCEL sheet using OLE automation.
    INCLUDE OLE2INCL.
    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
    TABLES: SPFLI.
    DATA  H TYPE I.
    table of flights
    DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
    *&   Event START-OF-SELECTION
    START-OF-SELECTION.
    read flights
      SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
    display header
      ULINE (61).
      WRITE: /     SY-VLINE NO-GAP,
              (3)  'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (4)  'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (8)  'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
      ULINE /(61).
    display flights
      LOOP AT IT_SPFLI.
      WRITE: / SY-VLINE NO-GAP,
               IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
      ENDLOOP.
      ULINE /(61).
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-007
           EXCEPTIONS
                OTHERS     = 1.
    start Excel
      CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
    PERFORM ERR_HDL.
      SET PROPERTY OF H_EXCEL  'Visible' = 1.
    CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'
    PERFORM ERR_HDL.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-008
           EXCEPTIONS
                OTHERS     = 1.
    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.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    changes by Kishore  - start
    CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP  EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    tell user what is going on
      SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    changes by Kishore  - end
    disconnect from Excel
         CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING  #1 = 'C:\SKV.XLS'.
      FREE OBJECT H_EXCEL.
      PERFORM 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.
      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.
    *&      Form  ERR_HDL
          outputs OLE error if any                                       *
    -->  p1        text
    <--  p2        text
    FORM ERR_HDL.
    IF SY-SUBRC <> 0.
      WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
      STOP.
    ENDIF.
    ENDFORM.                    " ERR_HDL
    Regards
    Murali Papana

Maybe you are looking for

  • Ipad to connect to apple tv

    how do i get the ipad to play on apple tv.  i have home share on but i do not know how to make my ipad play

  • T420s parts delay...anyone else seeing this

    We have a 1 month old t420s that had the mainboard die (wil not power on, power button just slow flashes)  We where just told that Dec. 24th would be the earlest the parts depo would have the mainboard!!  Anyone else seeing this type of delay?  This

  • Re-download Acrobat 9 Standard

    I have an individual license for Acrobat 9 Standard and need to re-download it, but it does not show up in my order history and it isn't available on the list of Downloads on the website.  How can I repdownload this product?

  • Job  ZINF_TRANS_ACK_FILE_CITI is not active- Cancellation not possible!

    hi, one job is in ready state from long time and unable to stop/delete. Error is like job is not active- cancellation not possible. Kindly someone suggest me how to cancel the job on priority. Thanks in advance!! Regards, Jeevan Reddy

  • Copy control problem : Delivery to Billing

    Hi Guys, I am facing a strange problem regarding copy control between delivery and billing document. The case is as below: When I am creating an F2 Invoice from LF Delivery the header texts from the LF Delivery is getting copied into the header taxt