After reports running in background job need to get automatically open in excel sheet

Dear All,
I have a requirement which is new to me ,
Once the user runs the report in background  system is displaying the output in HTML format .... But the Users needs to open in Excel sheet .
kindly  do the needful
Regards
Srikanth BG

Hi Srikanth,
Excel processing in background is currently not possible using standard ways. There exist a really good external library that allows you to handle Excel files, and even create them in background. So you could create a final, ready to use Excel file from your background run that can then be opened.
You might have a look at the library here: http://wiki.scn.sap.com/wiki/display/ABAP/abap2xlsx
Maybe it helps and suits your needs.
Cheers,
Marc

Similar Messages

  • Report run in background, attachment needs to be sent to user via email

    Hi all,
    we have a PDF solution which allows the system to send a PDF document as attachment via email to the recipient, all one needs to do is type in recipient email to a predefined PDF printer.
    What i need is a similar solution but instead of PDF it has to be an Excel file attached to email.
    The enduser does not have authorization to use SM36.
    Searching the Web (and with help from our Basis team) i have found several ideas but not sure as it would mean coding programs and so on.
    Is there an easier way?
    regards
    RM

    Hi all,
    we have a PDF solution which allows the system to send a PDF document as attachment via email to the recipient, all one needs to do is type in recipient email to a predefined PDF printer.
    What i need is a similar solution but instead of PDF it has to be an Excel file attached to email.
    The enduser does not have authorization to use SM36.
    Searching the Web (and with help from our Basis team) i have found several ideas but not sure as it would mean coding programs and so on.
    Is there an easier way?
    regards
    RM

  • Run the Report as a Background job and Get the Output in Excel in Local PC

    Hello Gurus,
    I have one following requirement.
    One should be able to run the report as a background job and it should be possible to get the report in Excel format, also when running the report in background. The excel report should have the same information and look as the current SAPreport.
    Please provide some solution.
    Any helpful answer get surely awarded.
    Thanks a lot,
    Varlanir

    GUI_* WS_* Function In Background, CSV Upload
    GUI_* and WS_* function modules do not work in background
    When scheduling a job in the background the appropriate statement to read in your file is OPEN DATASET, and the file must be on the file system that the SAP server can see.
    At anytime, a user can switch of the Personal Computers even though the job is still running in the background.  Therefore GUI_* and WS_* function modules are not designed to work in that way, as they need to access your personal computer  file.
    To choose the correct download method to used, you can check the value of SY-BATCH in your code,
    if it is 'X' use OPEN DATASET and if it is ' ' use WS_UPLOAD.
    *-- Open dataset for reading
    DATA:
      dsn(20) VALUE '/usr/test.dat',
      rec(80).
    OPEN DATASET dsn FOR INPUT IN TEXT MODE.
    IF sy-subrc = 0.
      DO.
        READ DATASET dsn INTO rec.
        IF sy-subrc <> 0.
          EXIT.
        ELSE.
          WRITE / rec.
        ENDIF.
      ENDDO.
    ENDIF.
    CLOSE DATASET dsn.
    *-- Open dataset for writing
    DATA rec(80).
    OPEN DATASET dsn FOR OUTPUT IN TEXT MODE.
      TRANSFER rec TO '/usr/test.dat'.
    CLOSE DATASET dsn.
    What is the difference when we use upload, ws_upload, gui_upload function modules?
    UPLOAD, WS_UPLOAD, GUI_UPLOAD, are used in BDC concepts.  ie., Batch Data Communication.
    Batch Data Conversion is a concept where user can transfer the Data from non SAP to SAP R/3.  So , in these various Function Modules are used.
    UPLOAD---  upload a file to the presentation server (PC)
    WS_UPLOAD----    Load Files from the Presentation Server to Internal ABAP Tables.
    WS means Work Station.
    This is used upto SAP 4.6 version.
    GUI_UPLOAD-------    Replaces WS_UPLOAD. Upoad file from presentation server to the app server.  From 4.7 SAP version it is replaced.
    How to Upload csv file to SAP?
    Common File Download Upload Questions:
    How  you upload the data from text file to sap internal table?  From my knowledge its by upload or gui_upload. 
    How you download the data from sap internal table to text file?
    How  you upload the data from xls (excel) file to sap internal table how you download the data from sap internal table to xls(excel) file.
    You can upload data from presentation server to an internal table using gui_upload. Use gui_download to download from internal table to flat file.
    Use fm ALSM_EXCEL_TO_INTERNAL_TABLE to upload data frm excel.
    Use function module GUI_UPLOAD
    The FILETYPE refer to the type of file format you need: For e.g 'WK1' - Excel format , 'ASC' - Text Format etc.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'C:\test.csv'
       FILETYPE                      = 'ASC'
      TABLES
        DATA_TAB                      = itab
    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.

  • Read Error logs after running the background jobs

    Hi,
    How to read the error logs after running the background jobs. In our scenarion we are running the COHV transaction to release the production orders in background. But we are not finding the error logs after background job. We would like to read the error logs and correct for further processing.
    Kindly suggest.
    Thanks & Regards,
    N. Laxman

    Hi
    you can check the  back ground jobs defined by any user in SM37 and where you can see the spool and job logs as well.
    plz check in your case and revert back
    Regards
    Anupam Sharma

  • How to submit a program after completion of a background job

    Hi Experts,
    I have a small issue. In my report program i am calling one transaction using call transaction it will trigger a background job. After completion of this background job i need to submit another program, Because the background job updating few values, using this value only the second program functionality will works.
    Currently when i execute my report its calling 1st program and triggering the background job. Once the job started again the program triggering the next program. Here after competion of the background job only this program should submit next program. Anyone kindly suggest some clue.
        CALL TRANSACTION 'ZSAPRCK60' USING    zbdcdata
                                OPTIONS  FROM g_s_options
                                MESSAGES INTO msg_tab.
    SUBMIT SAPRCK10    VIA SELECTION-SCREEN
                        WITH kalaid = p-kalaid
                        WITH kaladat = sy-datum
                        WITH PARALLEL = 'X'
                        WITH SERVNUM = '10'
                        WITH backgr = 'X'
                        AND RETURN.
    Mohana

    Hi,
    There is one function module there which gives you the job status .. if the job is finished then the value will be 'F'.I don't exactly remember the FM but then you can search with BDLSTATUS or BDSTATUS in SE37..
    do.
    call fm BD****STATUS
    IF STATUS (IMPORT PARAMTER) eq 'F'.
    exit.
    endif.
    enddo.
    Regards,
    Nagaraj

  • Office intergration - run as background job

    Hi,
      I have a word template merged with data using "Desktop Office Integration".
      Currently word template will be opened before data merging is done.
      Is it possible to run as background job, which word template can merge with data in backend? If possible, how should i work on it?
    Kindly advise.
    Thanks,
    Ginnie

    Hi,
      Thanks for your prompt reply.
      Is there any other methods which i can pull my data from table and merge to a word document?
      Or is it possible to generate PDF in this case?
      I need it to be a backend job.
      Any suggestion? Kindly advise.
    thanks,
    ginnie

  • Regarding email attachement while running a background job

    Dear Experts,
    When i am running a background job for any ALV report (standard or custom report) <b>automatically</b> the output is going to an e-mail address as a HTML file attachment. I want to change it to EXCEL file attachment.
    Please help me on this issue..
    Kind Regards,
    Tom

    Hi Prasanna,
    Thank you for your reply.  I am not using any code for sending the mail to the recipient E-mail address, system is taking care automatically.
    Few settings were done in SCOT transaction from basis, but no where they mentioned file type is .HTM.
    From my end i have done the following steps.
    1. go to SM36, give a job name.
    2. press on step push button , give the ABAP program name ( any ALV program, i mean standard report or Z report), give the variant and save.
    3. Come back . press on Spool list recipient push button give the e-mail address, press copy button on the  pop up window.
    4. press on start condition button , press on Immediate option and save.
    5. again press on Save button in the screen.
    now here job will be scheduled immediately, go to SM37 check your job status, if it is completed, automatically system is sending an e-mail with the ".HTM" attachment file output to the recipient e-mail address.
    i am not doing any coding part here.
    my concern is system should send the e-mail with ".XLS" file output attachment.
    please advise on this.
    Regards,
    Tom.

  • ABAP report to monitor Background Jobs (SM37)

    Hi,
    I need an ABAP report to monitor Background Jobs (SM37) which can monitor following things:
    1) All jobs which got cancelled based upon the hours field specified in the customizing table.
    2)All jobs which are active till the current date.
    Hope to receive your precious response!
    Thanks
    Mehar
    Moderator message : Spec dumping not allowed, search for available information.  Thread locked.
    Edited by: Vinod Kumar on Nov 22, 2011 3:36 PM

    Hi,
    I need an ABAP report to monitor Background Jobs (SM37) which can monitor following things:
    1) All jobs which got cancelled based upon the hours field specified in the customizing table.
    2)All jobs which are active till the current date.
    Hope to receive your precious response!
    Thanks
    Mehar
    Moderator message : Spec dumping not allowed, search for available information.  Thread locked.
    Edited by: Vinod Kumar on Nov 22, 2011 3:36 PM

  • ABAP program to run in Background job

    Hi,
    We have a custumized program (SO Creation) calling some functions (like: WS_QUERY, WS_UPLOAD, WS_DOWNLOAD, CREATE_TEXT and CALL TRANSACTION VA01) and can only run thru dialog process (foreground).  Is it possible to convert it to something that can run thru background job?
    Please help.
    Thanks.

    Hi Deo ,
    Unfortunately cl_gui_frontend_services will not work in background.
    Please have a look at following information about cl_gui_frontend_services :
    The class CL_GUI_FRONTEND_SERVICES contains static methods for the following areas:
    File functions
    Directory functions
    Registry
    Environment
    Write to / read from clipboard
    Upload / download files
    Execute programs / open documents
    Query functions, such as Windows directory, Windows version, and so on
    Standard dialogs (open, save, directory selection)
    To Use this, you should be bit familier with OO ABAP Concepts. So I will suggest you to go through with OO concepts of ABAP. It will be of great help to you.
    Regards,
    Nikhil

  • Background job BI_ODSA_ASD is getting cancelled, set privilege at db level

    Hi,
    Background job BI_ODSA_ASD is getting cancelled,
    i have increased the tablespace, still no luck,
    last time i faced the same problem at that time , i gave some permission at oracle level which worked fine, i dont not remember now,
    it was something like GRANT PRIVILEGE SAPSYS SAPCON...... (not sure)
    if anyone knows please let me know.
    Regards,
    SM

    Runtime Errors         UNCAUGHT_EXCEPTION
    Exception              CX_SDB_ORA_PROGRAM_ERROR
    Date and Time          20.09.2007 15:46:44
    Short text
    An exception occurred that was not caught.
    What happened?
    The exception 'CX_SDB_ORA_PROGRAM_ERROR' was raised, but it was not caught
    anywhere along
    the call hierarchy.
    Since exceptions represent error situations and this error was not
    adequately responded to, the running ABAP program
    'CL_SDB_ORA_UPDATE_STATS=======CP' has to be
    terminated.
    What can you do?
    Note down which actions and inputs caused the error.
    To process the problem further, contact you SAP system
    administrator.
    Using Transaction ST22 for ABAP Dump Analysis, you can look
    at and manage termination messages, and you can also
    keep them for a long time.
    Error analysis
    An exception occurred which is explained in detail below.
    The exception, which is assigned to class 'CX_SDB_ORA_PROGRAM_ERROR', was not
    caught and
    therefore caused a runtime error.
    The reason for the exception is:
    &#1600;bernehmen
    The occurrence of the exception is closely related to the occurrence of
    a previous exception "CX_SQL_EXCEPTION", which was raised in the program
    "CL_SQL_STATEMENT==============CP",
    specifically in line 31 of the (include) program
    "CL_SQL_STATEMENT==============CM002".
    The cause of the exception was:
    ORA-20000: Insufficient privileges
    ORA-06512: at "SYS.DBMS_STATS", line
    2150
    ORA-06512: at "SYS.DBMS_STATS", line 14112
    ORA-06512: at line 1
    How to correct the error
    If the error occures in a non-modified SAP program, you may be able to
    find an interim solution in an SAP Note.
    If you have access to SAP Notes, carry out a search with the following
    keywords:
    "UNCAUGHT_EXCEPTION" "CX_SDB_ORA_PROGRAM_ERROR"
    "CL_SDB_ORA_UPDATE_STATS=======CP" or "CL_SDB_ORA_UPDATE_STATS=======CM00I"
    "UPDATE_STATS"
    If you cannot solve the problem yourself and want to send an error
    notification to SAP, include the following information:
    1. The description of the current problem (short dump)
    To save the description, choose "System->List->Save->Local File
    (Unconverted)".
    2. Corresponding system log
    Display the system log by calling transaction SM21.
    Restrict the time interval to 10 minutes before and five minutes
    after the short dump. Then choose "System->List->Save->Local File
    (Unconverted)".
    3. If the problem occurs in a problem of your own or a modified SAP
    program: The source code of the program
    In the editor, choose "Utilities->More
    Utilities->Upload/Download->Download".
    4. Details about the conditions under which the error occurred or which
    actions and input led to the error.

  • Error while opening the EXCEL Sheet from a Report Program

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

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

  • How can I mail the Job Log in the form of an excel sheet?

    Daily I have to monitor a Job and I have to retrieve the Job Log in an excel sheet, Format the excel sheet, and then mail the excel sheet and the Job Status(Finished/Cancelled) to Client/Person Incharge.
    I want to automate this entire process. Please guide me, how can I write a program that mails the Job Log, in the form of an excel sheet, to the Client?
    Edited by: Jiten Rajendra Barai on Nov 25, 2008 3:03 PM

    Hi,
    You can use this FM to mail the excel sheet.
    SO_NEW_DOCUMENT_ATT_SEND_API1
    Also have a look at the below thread, it might be very helpful.
    Sending Excel attachment in E-mail
    Cheers...

  • Need sql query to import from excel sheet

    Hey , i need sql query to import from excel sheet.
    i work in a company where i need to daily update the data from excel sheet.
    if i get a shortcut method i ill be very thank full to you guys to reduce my work upto 10 %.

    any query which can inert from excel file?
    Sort of. Certainly not anything as simple as what you seem to hope for. Check out this very good PHP class:
    PHPExcel - Home

  • Need to open the excel sheet in the selection screen

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

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

  • Report program when run in background job getting cancelled immediately

    Hi
    When i run a program in foreground i am able to see the output. But when run in background not able to run the job successfully. The job is getting cancelled immediately.
    I am using the below function module for output display. Should i need to pass any parameters in the below function module so that i can run the program in background  successfully.
      CALL METHOD DETAIL_GRID->SET_TABLE_FOR_FIRST_DISPLAY     
          EXPORTING                                            
            IS_LAYOUT         = IS_LAYOUT                    
            I_SAVE            = 'A'                        
            IS_VARIANT        = GS_VARIANT                   
          CHANGING                                           
            IT_FIELDCATALOG   = IT_FIELDCATALOG               
            IT_OUTTAB         = BLOCKED_STOCK_TAB_ALV[].     
    Please suggest.
    Thanks and regards
    Rajani Yeluri

    Hi Rajani.
      ALV require the DRYPOR(screen) for display but incase you run in back ground which have to write to spool but in spool we can only write in format of LIST REPORT not inter-active report like ALV. That why
    system cancelled your process immediately.
    Hope it helps.
    Sayan.

Maybe you are looking for