Control Excel properties in ABAP report - Background mode

Hi,
We have a requirement to send a excel sheet attachment through mail.This report should have the option to
to run in background.We should be able to control the properties of the excel sheet.(Eg column width ,cell format)
I could control the excel properties through OLE object,.But i came to know that OLE objects can not be used in background.
Is there any other way to acheive this?
Regards,
Charumathi

Hi Charumathi,
Check the below link. It may help u a little bit.
[Function module to download to Excel worksheet.;

Similar Messages

  • Uploading Excel File in SAP In Background Mode

    Dear All,
    We require to upload Excel File in SAP in Background Mode.
    Could anyone suggest me the Function Module for this?
    Or any other method..........please.
    Thanks in advance for ur kind help.
    Best Regards,
    Prasad

    hi check this..
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2
    Download in Background
    http://sapabap.iespana.es/sap/info/rfcexec/rfcexec_e.htm
    Reward if find useful

  • Download an excel file in background mode

    Hi All,
    I need to download a file from a ABAP  report to the local workstation in background mode. I tried GUI_DOWNLOAD but it is failing in the background.
    Is there any way to download the excel file in the background. I am thinking of generating the spool.
    Please let me know if anybody has worked on the same requirement. Any help would be highly appreciated.
    Thanks a lot.
    Regards,
    Priti

    You be able to use the function "WS_DONLOAD" ?
    parameters: p_fnam like  rlgrap-filename memory id fnam obligatory.
    data: begin of t_registro occurs 0,
            registro(1000),
          end of t_registro.
          describe table t_registro lines sy-tfill.
          if sy-tfill gt 0.
            l_tam = strlen( p_fnam ).
            call function 'WS_DOWNLOAD'
                 exporting
                      filename                = p_fnam
                 tables
                      data_tab                = t_registro
                 exceptions
                      file_open_error
                      file_write_error
                      invalid_filesize
                      invalid_type
                      no_batch
                      unknown_error
                      invalid_table_width
                      gui_refuse_filetransfer
                      customer_error.
            if sy-subrc <> 0.
              open dataset p_fnam for output in text mode.
              if sy-subrc = 0.
                loop at t_registro.
                  transfer t_registro to p_fnam.
                endloop.
                close dataset p_fnam.
                write:/ 'Se genero el archivo:', p_fnam(l_tam).
              else.
                write:/ 'No se pudo generar el archivo:', p_fnam(l_tam).
              endif.
              close dataset p_fnam.
            else.
              write:/ 'Se genero el archivo:', p_fnam(l_tam).
            endif.
       endif.
    I hope this works for you.
    See ya.
    Ar@

  • Export data to Excel through a ABAP program run in batch mode

    Dear Experts,
      The requirement is that a ABAP report should run through background job, which will do the followiing :
       1) Collect data from predifined CRM tables ( Activity , Order for example ).
       2) Create a Excel file in a Application Server ( physical file server location ) location.
       3) Push the data collected in the step 1 to the Excel file.
       I have found 2 function modules which does the export to Excel after creating the Excel file. They are :
        a) XXL_FULL_API
        b) MS_EXCEL_OLE_STANDARD_DAT
       But it seems that the ABAP report needs to run in the foreground ( correct me if i am wrong ) in order to create the Excel file.
       Please can anyone suggest a possible ABAP code to achieve OR how to use these FMs in background mode ?
      The excel creation needs to be automated and send to a administrator email id every day, so the need of exporting the data in background mode arises.
    Thanks and regards,
    Sudipta

    hi,
    In SM36, you can create a job(give your report prog name)..
    call the fun. module by storing all the values into final int. table it_data.
    but u need to open one excel file in your desktop...
      v_file = 'C:\file.xls'.  " path should be like this...
    CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = v_file
         filetype                      = 'xls'
      has_field_separator           = 'X'
      HEADER_LENGTH                 = 0
      read_by_line                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          data_tab                      = it_data
    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.
    regards
    vijay

  • How to upload a Excel document in background mode

    Hello there, how are you?
    I am doing an interface program that needs to upload an excel document into an internal table, to do this I used the FM ALSM_EXCEL_TO_INTERNAL_TABLE. The problem with this FM is that only works in foregroung mode, If I run the programin bcakground the FM does not work.
    I would like to know if exist a way to upload an excel document into an internal table, for a program that have to be execute in background mode.
    Thanks in advance
    Best Regards
    Alexis Ramirez

    *& Form application_server
    * text
    * --> p1 text
    * <-- p2 text
    *----------------------------------------------------------------------*FORM APPLICATION_SERVER .
    TYPE-POOLS: KCDE.
    DATA : lt_intern TYPE kcde_cells OCCURS 0 WITH HEADER LINE.*DATA : INTERN1 TYPE KCDE_INTERN.FILE = PATH.
    OPEN DATASET FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.**--- Display error messages if any.IF SY-SUBRC NE 0.
    MESSAGE E001(ZSD_MES).
    EXIT.* ENDIF.ELSE.
    DO.
    READ DATASET FILE INTO Wa_TAB.
    append wa_tab to IT_TAB.
    IF SY-SUBRC <> 0.
    EXIT.
    ENDIF.
    ENDDO.
    clear wa_TAB.
    LOOP AT IT_TAB into wa_tab.
    CASE wa_tab-COL.
    WHEN '0001'.
    WA_TAB2-PLANT = wa_tab-VALUE.
    WHEN '0002'.
    WA_TAB2-STGE_LOC = wa_tab-VALUE.
    WHEN '0003'.
    WA_TAB2-MATERIAL = wa_tab-VALUE.
    WHEN '0004'.
    WA_TAB2-QUANTITY = wa_tab-VALUE.
    WHEN '0005'.
    WA_TAB2-BASE_UOM = wa_tab-VALUE.
    WHEN '0006'.
    WA_TAB2-COSTCENTER = wa_tab-VALUE.
    ENDCASE.
    AT END OF ROW.
    APPEND WA_TAB2 TO IT_TAB2.
    CLEAR WA_TAB2.
    ENDAT.
    clear wa_tab.
    ENDLOOP.
    ENDIF.
    CLOSE DATASET FILE.
    ENDFORM. " application_server
    Refer here:[How to Read Excel file from Application or Presentation Server and Download into Internal Table. |https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/how%252bto%252bread%252bexcel%252bfile%252bfrom%252bapplication%252bor%252bpresentation%252bserver%252band%252bdownload%252binto%252binternal%252btable.]

  • ABAP control - Excel spreedsheet generation

    Hi,
    I am programming generation of the Excel document from ABAP. I created additional popupscreen where the Excel should be shown with the generated spreedsheet and I have following questions:
    - I used the example program SAPRDEMOEXCELINTEGRATION2 as a reference for my development. I created my own class and method to generate Excel spreedsheet, I use following objects/methods like in reference program:
    c_oi_container_control_creator=>get_container_control
    CREATE OBJECT container
             EXPORTING container_name = 'CONTAINER'.
    CALL METHOD lc_control->init_control
    CALL METHOD lc_control->get_link_server
    CALL METHOD link_server->start_link_server
    To retrieve the document form from repository:
    CALL METHOD in_bds_document->get_info
      CALL METHOD in_bds_document->get_with_url
    And to generate the XLS:
    CALL METHOD control->get_document_proxy
        CALL METHOD proxy->open_document
        CALL METHOD proxy->get_spreadsheet_interface
    It works perfect, the Excel is shown in the popup dialog window. When the window is closed, following releasing methods are executed:
    CALL METHOD proxy->is_destroyed
        CALL METHOD proxy->close_document
        CALL METHOD proxy->save_document_to_table
        CALL METHOD proxy->release_document
        CALL METHOD cl_gui_cfw=>dispatch.
        IF NOT lc_bds_instance IS INITIAL.
          FREE lc_bds_instance.
        ENDIF.
        IF NOT link_server IS INITIAL.
          CALL METHOD link_server->stop_link_server.
          FREE link_server.
        ENDIF.
        IF NOT lc_control IS INITIAL.
          CALL METHOD lc_control->destroy_control.
          FREE lc_control.
        ENDIF.
        LEAVE TO SCREEN 0.
    So it looks like all the objects are released after the Excel generation. The problem is that when the user immediately run the
    program again, the Excel is not shown - just an empty popup dialog screen. Anybody has any idea what is wrong?
    - Second question. This method requires to have Excel installed on the presentation frontend. So it can be used in normal dialog programming, but how to generate .XLS file in BSP? The code upper can't be used because SAP GUi is not available in this schema. Is the generating .HTML file with CONTENT-TYPE: .xls the only method to generate .XLS?
    Thank you!
    Edited by: Wojciech Walczak ITMAXI.COM on Aug 12, 2009 11:57 AM

    /people/alvaro.tejadagalindo/blog/2009/02/05/excel-ole-and-abap--create-fancy-reports
    https://wiki.sdn.sap.com/wiki/display/Snippets/ALV%2bGrid%2bDisplay%2bwith%2bcheckbox%2bto%2bprocess%2bselected%2brecords%2bat%2bruntime

  • Running a Dynpro-based Report as a Job/in Background mode

    Hello,
    i've got a report which hasn't got a selection-screen as its startscreen, but a complex dynpro and is based on different start-buttons and not only the "basic" F8/Run-Button. the users still would like to be able to run the report in background mode and as an automated weekly job. moreover they want to use their own configuration/variant for date-fields etc., just like they are used from a selection-screen. is this possible "out of the box" with a dynpro-based report or how can i archive this through my own programming logic?
    thanks for your help,
    dsp

    Hi,
    I guess yes, but since you seem to have several processes possible at startup (those buttons), you will have to code a new bit of code at the start of your application. This to choose the correct process... you should have a new statement like
    IF sy-batch IS NOT INITIAL.
         "Perform batch process
    ELSE.
         "Perform normal run
    ENDIF.
    For the variant, I'm not sure to really get the idea... Do the users already use variants with the actual version? or is there no selection screen at all? If not, you should use one and set-up parameters to pre-fill your dynpro fields...
    Kr,
    Manu

  • Execution of Report with Tabstrips in Background Mode

    Hi everyone,
                  I have used 2 tabstrips in my report. When I choose the second tabstrip, give the related I/P's and then execute in Background mode. The O/P generated is coming for the 1st tabstrip instead of what I'd selected.
    How could I execute the report in Background Mode for my Second Tabstrip? Any changes to be done in my Coding?
    Please throw some light into this !!!!
    Regards,
    Ramakrishnan.G

    Hi
    You may have attached user command to your tabs in definition -
    <b>DATA : TAB1, TAB2.
    SELECTION-SCREEN BEGIN OF TABBED BLOCK TB FOR 2 LINES.
    SELECTION-SCREEN TAB (15) TABNAME1 USER-COMMAND TAB1 DEFAULT SCREEN 101.
    SELECTION-SCREEN TAB (15) TABNAME2 USER-COMMAND TAB3 DEFAULT SCREEN
    102.
    ...</b>
    Now in
    <b>
    INITIALIZATION.
      TABNAME1 = 'TAB1'.
      TABNAME2 = 'TAB2'.
    AT SLECTION-SCREEN.
    IF TB-ACTIVETAB = 'TAB1'.
        TAB1 = 'X'.
        TAB2 = ' '.
      ELSE.
        TAB1 = ' '.
        TAB2 = 'X'.
      ENDIF.
    START-OF-SELECTION.
    IF TAB1 = 'X'.
      PERFORM ROUTINE_FOR_TAB1.
    ELSE.
       PERFORM ROUTINE_FOR_TAB2.
    ENDIF.</b>
    Cheers.
    ( Dont forget to reward if answers helped )

  • Using a report layout in background mode

    Is is possible to apply a saved report layout like you apply to the alv grid to a csv file run in background mode?

    Hi Cynthia ,
    I can figure out one way :
    SUBMIT ZREPORT TO SAP-SPOOL LAYOUT 'ZLAYOUT'
    VIA SELECTION-SCREEN
    DESTINATION 'locl'
    KEEP IN SPOOL 'X'
    IMMEDIATELY 'X'
    WITHOUT SPOOL DYNPRO
    AND RETURN.
    This will return the report in your layout to the spool and can be downloaded as well.
    Thanks
    Naresh

  • Change of ABAP report properties by RFC

    Hi there,
    does anyone know a function module SE37 (remote capable!!!)
    which can change the properties of an existing ABAP report (authorization group, title, etc.)
    Thanks on advance,
    Andi

    >
    A. Hartmann wrote:
    > Hi there,
    > does anyone know a function module SE37 (remote capable!!!)
    > which can change the properties of an existing ABAP report (authorization group, title, etc.)
    >
    > Thanks on advance,
    > Andi
    Hi A. Hartmann,
      There are function modules that can be used to change Texts, Status, Menus etc...All these might not be remote enabled but then we can always write an API to Wrap these function modules. They are as follows:-
    Function Modules                     Description
    RS_CUA_ABAR_CHANGE             Change the Menu Bars
    RS_CUA_CHANGE                  Graphical User Interface: Change a
    RS_CUA_FUNL_CHANGE             Change Function Texts
    RS_CUA_MENU_CHANGE             Changes to Menu List
    RS_CUA_PFKL_CHANGE             Change Function Key Settings
    RS_CUA_SINGLE_ABAR_CHANGE      Change a Menu Bar
    RS_CUA_SINGLE_MENU_CHANGE      Change a menu
    RS_CUA_SINGLE_PFK_CHANGE       Change A Function Key Setting
    RS_CUA_SINGLE_TITLE_CHANGE
    RS_CUA_STATEXT_CHANGE          Change status short texts
    RS_CUA_TITLE_CHANGE
    Regards,
    Ravi.

  • How to shedule an abap report to run paralely in more background session

    I wander how to shedule an abap report to run paralely in more background session.
    I am afraid of parallel locking.

    Hi,
    You can schedule different jobs with same program name.
    Use ENQUEUE_ & DEQUEUE_ to lock/unlock the records being process. The lock objects can be created in SE11.
    Best regards,
    Prashant

  • 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 report error while downloading to excel.

    Hello All,
    I have a abap report which displayes the output in frontend and I want to download it to the excel file.
    When i choose from menu bar the options like--
    LIST-> MOVE ->Save to PC File.  some of the negative values get merged into one single value.
    I have two different negative values say 115  10-  in one cell but when I download it to the excel file this value is dispalyed as          -11510         .    Also I ahve noticed that only the values with one negative sign are dispalyed wrongly.
    The values with -115 -10 are dispalyed correctly.
    Could anyone please let me know why this happens?
    Many Thanks,
    Komal.

    Hi Komal  ,
    I have two different negative values say 115 10- in one cell but when I download it to the excel file this value is dispalyed as -11510 . Also I ahve noticed that only the values with one negative sign are dispalyed wrongly.
    as  value 115 10- are in one cell in output  they will be saved as one  -11510 only  .
    But i don't understand  why you are saving  115 and 10- in one cell or one  column  if they are two different  value    .
    regards
    Deepak.
    Edited by: Deepak Dhamat on Aug 10, 2011 11:07 AM

  • Running ABAP Report in background

    Hello,
    I am getting timed out error when I execute my report program.
    I believd running the report can do it for now.
    Can you please tell me detils on  how I should proceed on dev, qa and production environment.
    Regards,
    Sameer.

    Hello Sameer,
    You need to schedule the ABAP program in SM36 transaction.
    Following are the steps:
    1. Fill general data like Job Name, Job class and click on step button from application menu
    2. Fill ABAP program details on this screen like ABAP Report Name, Variant Name (If any) and save it.
    3. Go to SM37 transaction (Background Job monitor)
    4. On initial screen newly created job will be filtered by user name or using job name.
    5. it will be listed in job queue with Scheduled status.
    6. Select the Job from listing and click on Release button from application toolbar
    7. depending on your requirement you can release job immediately and it will start running as an when background wp is allocated to this job.
    8. Or else you can schedule it with some frequency using other options like Date/Time, or using other events to trigger it.
    Check if this can help.
    Thanks,
    Augustin.

  • Running abap reports in the background when clicked on Webdynpro Button

    Hi Experts,
    I have requirement where when clicked on a Button in a Webdynpro application, it needs to run an abap reports in the background and I need to pass some parameters to the report.
    Is it possible to do that? if yes, please guide me though.
    Reward points for useful tips.
    Sabbir
    Edited by: Sabbir Ahmed on Oct 17, 2008 8:05 AM
    Edited by: Armin Reichert on Oct 24, 2008 10:05 AM

    you can use rfc's model  for this na?
    pass the parameters to the RFC and through that RFC run the report,
    with regards
    shanto aloor.

Maybe you are looking for