Reagrding Excel download

Hi,
I have a query reagrding Excel download. Is it possible to download an Excel from SAP GUI in background using GUI_DOWNLOAD/WS_DOWNLOAD/DOWNLOAD?.
Please let me know any alternatives for my situation.
Thanks in advance
Ravi.

hi,
<b>reward if useful</b>
<b>GUI_* and WS_* function modules do not work in background</b>
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.
Download in Background in Excel Format
How to download the data in excel format directly while executing in background mode? 
If you will execute it in bacground with ws_download or download, it will be aoutomatically cancel. so what is the procedure to do this.  How is can directly read the spool from program?
<b>Download from background is possible, if you could setup the environment</b>
1. create a custom table first
    Table  : Y001
    Displayed fields:   4 of   4  Fixed columns:
       MANDT BNAME       Y_SITE    Y_PATH
       010      <userid>     <site>      cd <novell_path>
2. rewrite ws_download to z_download (light modification required, see attachment)
3. ask your basis team to make a copy of command FTP and CHMOD to ZFTP and ZCHMOD resp., make the setting according to your environment.
    1  *----
    2  * Changed By :
    3  * Changed On :
    4  * Changed    : NOVELL directory path based on SAP login id.
    5  *----
    6  TABLES: Y001.                                           
    7
    8  CONSTANTS: C_PATH(14) VALUE '/home/ftpuser/'.
    9
   10  DATA: BEGIN OF C_TAB,
   11          X(1) TYPE X VALUE '09',
   12        END OF C_TAB.
   13
   14  DATA: BUFFER(8000),
   15        FIELDNAME_OFFSET TYPE I,
   16  *     FULLPATH(128),
   17        FULLPATH LIKE SXPGCOLIST-PARAMETERS,
   18  *     CMDFULLPATH(128),
   19        CMDFULLPATH LIKE SXPGCOLIST-PARAMETERS,
   20        CMD(40),
   21        IBTCXPM LIKE BTCXPM OCCURS 0.
   22
   23  FUNCTION Z_DOWNLOAD.
   24  *"----
   25  ""Local interface:
   26  *"  IMPORTING
   27  *"     VALUE(FILENAME)
   28  *"     VALUE(LOCATION)
   29  *"  TABLES
   30  *"      DATA_TAB
   31  *"      FIELDNAMES OPTIONAL
   32  *"----
   33
   34    DATA: WS_LINE TYPE I.
   35
   36    FIELD-SYMBOLS: <F>.
   37
   38    CHECK NOT FILENAME IS INITIAL.
   39
   40    CONCATENATE C_PATH FILENAME INTO FULLPATH.
   41    OPEN DATASET FULLPATH IN TEXT MODE FOR OUTPUT.
   42
   43    DESCRIBE TABLE FIELDNAMES LINES WS_LINE.
   44    IF WS_LINE NE 0.
   45      PERFORM FIELDNAMES_2_BUFFER TABLES FIELDNAMES CHANGING BUFFER.
   46      FIELDNAME_OFFSET = STRLEN( BUFFER ).
   47      TRANSFER BUFFER TO FULLPATH LENGTH FIELDNAME_OFFSET.
   48    ENDIF.
   49
   50    LOOP AT DATA_TAB.
   51      CLEAR BUFFER.
   52      CLEAR FIELDNAME_OFFSET.
   53      DO.
   54        ASSIGN COMPONENT SY-INDEX OF STRUCTURE DATA_TAB TO <F>.
   55        IF SY-SUBRC NE 0.  EXIT.  ENDIF.
   56        WRITE <F> TO BUFFER+FIELDNAME_OFFSET.
   57        CONDENSE BUFFER.
   58        FIELDNAME_OFFSET = STRLEN( BUFFER ).
   59        WRITE C_TAB TO BUFFER+FIELDNAME_OFFSET(1).
   60        ADD 1 TO FIELDNAME_OFFSET.
   61      ENDDO.
   62      TRANSFER BUFFER TO FULLPATH LENGTH FIELDNAME_OFFSET.
   63    ENDLOOP.
   64
   65    CLOSE DATASET FULLPATH.
   66
   67    CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
   68         EXPORTING
   69              COMMANDNAME                   = 'ZCHMOD'
   70              ADDITIONAL_PARAMETERS         = FULLPATH
   71         TABLES
   72              EXEC_PROTOCOL                 = IBTCXPM
   73         EXCEPTIONS
   74              NO_PERMISSION                 = 1
   75              COMMAND_NOT_FOUND             = 2
   76              PARAMETERS_TOO_LONG           = 3
   77              SECURITY_RISK                 = 4
   78              WRONG_CHECK_CALL_INTERFACE    = 5
   79              PROGRAM_START_ERROR           = 6
   80              PROGRAM_TERMINATION_ERROR     = 7
   81              X_ERROR                       = 8
   82              PARAMETER_EXPECTED            = 9
   83              TOO_MANY_PARAMETERS           = 10
   84              ILLEGAL_COMMAND               = 11
   85              WRONG_ASYNCHRONOUS_PARAMETERS = 12
   86              CANT_ENQ_TBTCO_ENTRY          = 13
   87              JOBCOUNT_GENERATION_ERROR     = 14
   88              OTHERS                        = 15.
   89
   90    CONCATENATE C_PATH FILENAME '_cmd' INTO CMDFULLPATH.
   91    OPEN DATASET CMDFULLPATH IN TEXT MODE FOR OUTPUT.
   92    CASE LOCATION.     "location A, B, C, D on a network
   93      WHEN 'A  '.
   94 
   95        TRANSFER 'open xx.xxx.xx.xx' TO CMDFULLPATH.        
   96        TRANSFER 'user sapftp <pwd>' TO CMDFULLPATH.      
   97      WHEN 'B  '.                                           
   98        TRANSFER 'open xx.xxx.xx.xx' TO CMDFULLPATH.        
   99        TRANSFER 'user sapftp <pwd>' TO CMDFULLPATH.    
  100      when 'C  '.
  101        TRANSFER 'open xx.xxx.xx.xx' TO CMDFULLPATH.
  102        TRANSFER 'user sapftp <pwd>' TO CMDFULLPATH.
  103      when 'D  '.
  104        TRANSFER 'open xx.xxx.xx.xx' TO CMDFULLPATH.
  105        TRANSFER 'user sapftp <pwd>' TO CMDFULLPATH.
  106      WHEN OTHERS.
  107    ENDCASE.
  108
  109
  110
  111
  112  *start>
  113    CLEAR Y001.
  114    SELECT SINGLE Y_PATH INTO Y001-Y_PATH
  115                         FROM Y001 WHERE BNAME = SY-UNAME
  116                                     AND Y_SITE = LOCATION.  
  117    TRANSFER Y001-Y_PATH TO CMDFULLPATH.
  118  *<end
  119    CONCATENATE 'lcd' C_PATH INTO CMD SEPARATED BY SPACE.
  120    TRANSFER CMD TO CMDFULLPATH.
  121    CLEAR CMD.
  122    CONCATENATE 'put' FILENAME INTO CMD SEPARATED BY SPACE.
  123    TRANSFER CMD TO CMDFULLPATH.
  124    TRANSFER 'bye' TO CMDFULLPATH.
  125    CLOSE DATASET CMDFULLPATH.
  126
  127    CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
  128         EXPORTING
  129              COMMANDNAME                   = 'ZCHMOD'
  130              ADDITIONAL_PARAMETERS         = CMDFULLPATH
  131         TABLES
  132              EXEC_PROTOCOL                 = IBTCXPM
  133         EXCEPTIONS
  134              NO_PERMISSION                 = 1
  135              COMMAND_NOT_FOUND             = 2
  136              PARAMETERS_TOO_LONG           = 3
  137              SECURITY_RISK                 = 4
  138              WRONG_CHECK_CALL_INTERFACE    = 5
  139              PROGRAM_START_ERROR           = 6
  140              PROGRAM_TERMINATION_ERROR     = 7
  141              X_ERROR                       = 8
  142              PARAMETER_EXPECTED            = 9
  143              TOO_MANY_PARAMETERS           = 10
  144              ILLEGAL_COMMAND               = 11
  145              WRONG_ASYNCHRONOUS_PARAMETERS = 12
  146              CANT_ENQ_TBTCO_ENTRY          = 13
  147              JOBCOUNT_GENERATION_ERROR     = 14
  148              OTHERS                        = 15.
  149
  150    CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
  151         EXPORTING
  152              COMMANDNAME                   = 'ZFTP'
  153  **          commandname                   = 'ZFTP'
  154              ADDITIONAL_PARAMETERS         = CMDFULLPATH
  155         TABLES
  156              EXEC_PROTOCOL                 = IBTCXPM
  157         EXCEPTIONS
  158              NO_PERMISSION                 = 1
  159              COMMAND_NOT_FOUND             = 2
  160              PARAMETERS_TOO_LONG           = 3
  161              SECURITY_RISK                 = 4
  162              WRONG_CHECK_CALL_INTERFACE    = 5
  163              PROGRAM_START_ERROR           = 6
  164              PROGRAM_TERMINATION_ERROR     = 7
  165              X_ERROR                       = 8
  166              PARAMETER_EXPECTED            = 9
  167              TOO_MANY_PARAMETERS           = 10
  168              ILLEGAL_COMMAND               = 11
  169              WRONG_ASYNCHRONOUS_PARAMETERS = 12
  170              CANT_ENQ_TBTCO_ENTRY          = 13
  171              JOBCOUNT_GENERATION_ERROR     = 14
  172              OTHERS                        = 15.
  173
  174  ENDFUNCTION.
  175
  176  ----
  177  *       FORM FIELDNAMES_2_BUFFER                                      *
  178  ----
  179  *       ........                                                      *
  180  ----
  181  *  -->  FIELDNAMES                                                    *
  182  *  -->  BUFFER                                                        *
  183  ----
  184  FORM FIELDNAMES_2_BUFFER TABLES FIELDNAMES CHANGING BUFFER.
  185    CLEAR BUFFER.
  186    CLEAR FIELDNAME_OFFSET.
  187    LOOP AT FIELDNAMES.
  188      WRITE FIELDNAMES TO BUFFER+FIELDNAME_OFFSET.
  189      CONDENSE BUFFER.
  190      FIELDNAME_OFFSET = STRLEN( BUFFER ).
  191      WRITE C_TAB TO BUFFER+FIELDNAME_OFFSET(1).
  192      ADD 1 TO FIELDNAME_OFFSET.
  193    ENDLOOP.
  194    FIELDNAME_OFFSET = FIELDNAME_OFFSET - 1.
  195    IF FIELDNAME_OFFSET >= 0.
  196      WRITE SPACE TO BUFFER+FIELDNAME_OFFSET(1).
  197    ENDIF.
  198  ENDFORM.
Message was edited by: Ashok Kumar Prithiviraj

Similar Messages

  • Excel Download of a Web SAP BW Report asks userid and password.please help

    Dear BW folks,
    Issue: When I run a specific SAP BW Report from Web and download the same into excel & csv.
    When I open the excel file downloaded, it asks me user name and password to enter. csv file downloaded doesn't ask.
    The report has 0cust_sales hierarchy and SBU hierarchy.
    Is there any thing to do with these hierarchies that the excel download is asking user name and password?
    Please help me out!!!!! This report needs to be downloaded into excel sent to my manager.....
    Regards
    Pavan

    Hi Pavan
    It is possible,please refer the below link
    Report execution without prompting user id
    Providing un-secured access to a web report.
    Also, for the time being, you can run the query and save a workbook and sent across
    These will resolve the issue
    Thanks
    Pavan Agarwal

  • Problem in ALV to Excel Download

    Good Morning Experts,
      I am facing one issue related ALV to excel Download.
    I Developed one custom report the output is correct displaying.
    the output is like for example i am taking 3 columns (plant, material, amt).
    plant material amt
    1001  aaa     1000
    1001  bbb     2000
    while downloading to excel
    it displaying like
    plant
    material
    amt
    1001
    aaa
    1000
    1001
    bbb
    2000
    I dont know why its coming like that.
    this is my code
    DEFINE field_cat.
    wa_field-row_pos = &1.
    wa_field-fieldname = &2.
    wa_field-tabname = &3.
    wa_field-seltext_m = &4.
    wa_field-outputlen = &5.
    wa_field-currency = &6.
    wa_field-ref_fieldname = &7.
    wa_field-ref_tabname = &8.
    APPEND wa_field to it_field.
    clear wa_field.
    END-OF-DEFINITION.
    field_cat '1' 'BUKRS' 'IT_FINAL' 'Company Code' '6' '' '' ''.
    field_cat '2' 'BUTXT' 'IT_FINAL' 'Comp Descrip' '25' '' '' ''.
    field_cat '3' 'LIFNR' 'IT_FINAL' 'Vendor No' '10' '' '' ''.
    field_cat '4' 'NAME1' 'IT_FINAL' 'Vendor Name' '35' '' '' ''.
    field_cat '5' 'STRAS' 'IT_FINAL' 'Vendor Addres' '35' '' '' ''.
    field_cat '6' 'FDGRV' 'IT_FINAL' 'Nature Of Work' '30' '' '' ''.
    field_cat '7' 'DMBTR' 'IT_FINAL' 'Net Amount' '16' 'X' 'WAERS' 'IT_FINAL'.
    field_cat '8' 'QBSHB' 'IT_FINAL' 'TDS Amount' '16' 'X' 'WAERS' 'IT_FINAL'.
    field_cat '9' 'TOTAL' 'IT_FINAL' 'Total Amount' '16' 'X' 'WAERS' 'IT_FINAL'.
    it_layout-zebra = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = sy-repid
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
       IS_LAYOUT                         = it_layout
       IT_FIELDCAT                       = it_field
       I_SAVE                            = 'X'
      TABLES
        t_outtab                          = it_final
    EXCEPTIONS
       PROGRAM_ERROR                     = 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.
    endform.                    " DISPLAY_ALV
    FORM TOP_OF_PAGE.
    REFRESH it_head. CLEAR it_head.
    wa_head-typ = 'H'.
    wa_head-info = 'Vendorwise Expense Details'.
    APPEND wa_head to it_head.
    wa_head-typ = 'S'.
    IF NOT s_MONAT-high is INITIAL.
      CONCATENATE 'Period : ' p_gjahr '.' s_MONAT-low ' to ' p_gjahr '.' s_MONAT-high INTO wa_head-info.
    ELSE.
      CONCATENATE 'Period : ' p_gjahr '.' s_MONAT-low INTO wa_head-info.
    ENDIF.
    APPEND wa_head to it_head.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        it_list_commentary       = it_head.
    ENDFORM.
    Regards,
    Dhina..

    Hi,
    You can also try in this way
    in the output screen
      click List (in app tool bar) -> Export -> Spreadsheet
    and save at your desired location.
    (It will be save in .mhtml format , just rightclick on it and you can open it with excel )
    Then you will be able to view in your required format.
    Regards,
    koolspy.

  • Excel download feature in Web Dynpro Abap using OAOR document

    Hi Friends,
    I am facing an issue in implementing excel download feature in Web Dynpro.
    Problem: I have stored an excel document in OAOR. I am displaying data on screen using ALV display in WDA.
    I will provide a button to download excel in toolbar of ALV. When user clicks on this button i need to pick the document from OAOR and fill that with my screen values and download it to users desktop.
    Please help me in this. Problem is when i am calling these classes c_oi_container_control_creator=>get_container_control and cl_gui_custom_container from my View's method they are returning error.
    Thanks & Regards,
    Saud

    HI,
    You cannot use GUI classes and methods in web dynpro . That will dump.
    Instead you can use file down load UI element or..
    If you have the content in xstring format use ATTACH_FILE_TO_RESPONSE method of CL_WD_RUNTIME_SERVICES class.
    Regards,
    Madhu

  • Dump while running a program with OLE Excel download facility in ITS

    Hi,
    Because of some complex requirment, I had created a report program which will download the data to an Excel sheet using SAP OLE Automation Controller. For this report i had created a tcode too.
    The report which i developed is perfectly working fine in SAPGUI. But if i access the same report throught SAP ITS serice. I am getting a dump. Please find below the dump details. I am not able to figure it out why the dump is not coming in SAPGUI.
    Runtime Errors         MESSAGE_TYPE_X
    Date and Time          09.03.2010 05:35:41
    Short text
    The current application triggered a termination with a short dump.
    What happened?
    The current application program detected a situation which really
    should not occur. Therefore, a termination with a short dump was
    triggered on purpose by the key word MESSAGE (type X).
    |
    Error analysis
    Short text of error message:
    Control Framework : Error processing control
    Long text of error message:
    Diagnosis
    An error occurred when the system tried to process the commands
    from the Automation Queue on the presentation server.
    There are several possible reasons for this:
    - The installation of the SAP GUI on the presentation server is
    faulty or obsolete.
    - There is an error in the application program
    - There is an error in the SAPGUI or an integrated control
    Procedure
    1. Make sure that you have imported the appropriate Support
    Package, the current kernel, and GUI patch for the release of your
    system
    2. Check whether the error occurs locally on one or a few PCs, or
    generally on all PCs. Note whether the error only occurs for some
    users, for example because of a specific Customizing setting.
    If it only occurs locally, this suggests an installation problem
    with the PC. Check the installation; if necessary, reinstall the
    software. In the dump, search for the SY-MSGLI field, since it may
    point to the cause of the error.
    3. Activate the Automation Trace (in accordance with SAP Note
    158985).
    4.Start the transaction and continue until the screen immediately
    before the dump.
    5. From the System -> Utilities menu, choose Autom. Queue,
    Synchronous Processing.
    The status bar of the GUI displays the text:
    "Automation synchron flush mode on"
    6. If you now proceed with the application, the short dump will
    display the ABAP call that caused the error; the Automation Trace
    will contain the error on the presentation server.
    7. If necessary, load the short dump and trace files on to
    sapservX, so that SAP can analyze them.
    Technical information about the message:
    Message class....... "CNDP"
    Number.............. 006
    Variable 1.......... " "
    Variable 2.......... " "
    Variable 3.......... " "
    Variable 4.......... " "
    How to correct the error
    Probably the only way to eliminate the error is to correct the program.
    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:
    "MESSAGE_TYPE_X" " "
    "SAPLOLEA" or "LOLEAU02"
    "AC_SYSTEM_FLUSH"
    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.
    User and Transaction
    Client.............. 120
    User................ "XXXXXX"
    Language Key........ "E"
    Transaction......... "ZGA_BEACON_SOX_RPT "
    Transactions ID..... "4B95E2560EB62F9AE10000000A241C33"
    Program............. "SAPLOLEA"
    Screen.............. "ZGA_REP_BEACON_SOX_REPORT 9000"
    Screen Line......... 0
    Information on Caller ofr "HTTP" Connection:
    Plug-in Type.......... "HTTP"
    Caller IP............. "10.36.28.52"
    Caller Port........... 8000
    Universal Resource Id. "/sap/bc/gui/sap/its/webgui/~flNUQVRFPTIzNzIxLjAxNC4wNC4
    wNA=="

    Hi All,
    FYI.....
    As I said because of my complex requirement, i am using OLE excel download facilities to download the data. ITS wont support this OLE download facility.  This can be done only through local SAP GUI.
    The reason for this is that, when i am using this download facility through SAP GUI, OLE object thats used in my report program will directly talk to the Local OLE excel objects (i.e. the local installed Excell application) and download the data. But if it's through ITS, my program wont be able to communicate with the local excel OLE objects because of this i am getting a DUMP.
    Thank You all for the support. All the best in future. 
    Regards
    Maneesh Chandran

  • Excel download from ALV grid, for characters more than 1020

    Hi,
    When i am trying to download the report which is having character more than 1020, it is coming in two rows. I want all fields in one row. Please give solutions.
    I am using below field catalog.
    Car Eligibility
      CLEAR lw_fieldcat.
      lw_fieldcat-fieldname = text-001.
      lw_fieldcat-reptext_ddic = text-011.
      lw_fieldcat-tabname = text-021
      APPEND lw_fieldcat TO gt_fieldcat.
    I am using below FM.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          is_layout          = gt_layout
          it_fieldcat        = gt_fieldcat[]
          it_sort            = gt_sort[]
          it_events          = gt_events[]
        TABLES
          t_outtab           = gt_data
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    Thanks in Advance,
    Ravi Kumar

    ravi,
    its not about how you have used your field catalog or how you called ALV FM. its excel download functionality,
    what you need to do is:
    set pf-status '<<some value>>' -> you can find where to pass in ALV FM call.
    then add a application toolbar button though this pf status.
    then at  use_command event, check sy-ucomm and if its the same as your new icons fcode then use the method to download it in excel.

  • 'REUSE_ALV_GRID_DISPLAY' Excel-download without dialog

    Hi everybody,
    we have a couple of reports displayed in dialog mode by using FM 'REUSE_ALV_GRID_DISPLAY'.
    Now the question arose if there might be a possibility to perform an Excel-download NOT by pressing the dialog function button but instead with parameters such as path and filename given by the calling program, without any user-interaction, maybe even without having the report started in dialog but in batch/background mode instead. I don't see a solution to this. Does anybody else?
    regards
    Andreas

    basically what you are saying is that as soon as the user executes the program, the output also should get downloaded to a predefined location in the user PC, without any further user interaction.
    Right? if yes
    you have the data in an itab (which is passed to T_OUTTAB tables parameter)
    in the PBO (immediately after filling the itab with data before calling the function 'REUSE_ALV_GRID_DISPLAY'
    call gui_download and pass filename, and the itab.
    but you have to make sure thru a check to see this download happens only once during a session.
    and this wont work in batchmode.
    REgards
    Raja

  • Excel download not working in REUSE_ALV_GRID_DISPLAY

    hi,
    can someone tell me why excel download funtionality doesnt work in grid display. i tried examples like balvst0*_grid and it seems those doesnt work too.
    is there any example where i can see excel download working with grid.
    regards,
    ravi.

    Hi,
    Also check this program for FM REUSE_ALV_GRID_DISPLAY..You can use LIST -> EXPORT -> SPREADSHEET to see the values in a excel..
    TYPE-POOLS: slis.
    DATA: BEGIN OF itab OCCURS 0,
            vbeln TYPE vbeln,
          END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
            selkz TYPE char1,
            vbeln TYPE vbeln,
            posnr TYPE posnr,
            netpr TYPE netpr,
            matnr TYPE matnr,
          END OF itab1.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'SELKZ'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-checkbox  = 'X'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: S_FIELDCATALOG.
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'VBELN'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'POSNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'POSNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'NETPR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'NETPR'.
    s_fieldcatalog-do_sum    = 'X'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '5'.
    s_fieldcatalog-fieldname = 'MATNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'MATNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    DATA: s_layout TYPE slis_layout_alv.
    s_layout-subtotals_text            = 'SUBTOTAL TEXT'.
    SELECT vbeln UP TO 10 ROWS
           FROM
           vbak
           INTO TABLE itab.
    IF NOT itab[] IS INITIAL.
      SELECT vbeln posnr
             FROM vbep
             INTO CORRESPONDING FIELDS OF TABLE itab1
             FOR ALL ENTRIES IN itab
             WHERE vbeln = itab-vbeln.
    ENDIF.
    DATA: v_repid TYPE syrepid.
    v_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
              i_callback_program = v_repid
              it_fieldcat        = t_fieldcatalog
              is_layout          = s_layout
         TABLES
              t_outtab           = itab1
         EXCEPTIONS
              program_error      = 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.
    Thanks,
    Naren

  • ALV Excel Download problem ( Special Character)

    Hi,
    I am unable to download completely in XLS format from ALV grid. When i tried in couple of ways there is a special character( " ) in one of the filed. Due to the same Excel download has some problem. I tested by removing those and it worked fine, 
    Please suggest me to solve the issue.
    Thanks,
    Bhanu Gattu,

    Data strings with special characters can not be downloaded into XLS format from ALV grid. In my case, I replaced the special character " with space and I could download the data into excel.

  • Excel download truncated characters

    Hi,
    I have a strange problem. I am trying to download an ALV report in a excel format to the work station and the last character of one of the many fields,Vendor Number, gets truncated. Strangely this problem is confined to quality and production environments, and the same excel download works fine in the development environment.
    I have searched for replies in the forum that suggest program corrections but I would like to know how the same report download works correctly in development.

    Hi,
    The issue is due to fieldcatalog not being populated properly and in the Layout - Column width optimize is checked. In this case the contents are display till the heading ( For ex: if the heading is 'Vendor' ) the conents will be displayed with a maximum length of 6 characters instead of 10 with ".."  at the end truncating the output.
    The reason why its working in development and not in Quality or production is that the maximum vendor number in development is less than or equal to 6 digits where as in quality or production its more. Please check.
    Solution: If you are populating the field catalog manuallly, populate the ref_field and ref_table ( For ex: wth 'LIFNR' and 'LFA1' respectively ).
    Edited by: Suman Jagu on May 9, 2011 11:48 AM

  • Excel download from ALV not working inproduction

    Hi all,
    I am using "set_table_for_first_display" for alv display. the excel download from alv is woking fine in development and quality stystem but in production only first 3-4 rows are getting downloaded. Other rows donot appear in excel.
    Any Idea !!!
    Thanks
    Madhu

    Hi Experts,
    I have noticed that same problem is occuring in development system also with same set of data . The ascii file created has some missing rows. I guess its due to some special characters though i am not able to see any special character . Any solution for this.
    Regs
    madhu

  • Repetition of header in ALV output once excel download is selected

    Hi Experts,
    I have alv report where I use FM as below
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program     = w_repid
          i_callback_top_of_page = 'TOP-OF-PAGE'  "see FORM
          is_layout              = l_layout
          it_fieldcat            = lt_fieldcat
          it_sort                = l_sort
          i_save                 = 'X'
        TABLES
          t_outtab               = itab
        EXCEPTIONS
          program_error          = 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.
    and top of page as below
    FORM top-of-page.
    * Title
      w_header-typ  = 'H'.
      w_header-info = text-033.
      APPEND w_header TO t_header.
      CLEAR w_header.
    * Report Name
      w_header-typ  = 'S'.
      w_header-key = text-034.
      w_header-info =  sy-repid.
      APPEND w_header TO t_header.
      CLEAR w_header.
    * Date
      w_header-typ  = 'S'.
      w_header-key = text-035.
      CONCATENATE  sy-datum6(2) '.'+
                   sy-datum4(2) '.'+
                   sy-datum(4) INTO w_header-info.
      APPEND w_header TO t_header.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_header.
    ENDFORM.                    "top-of-page
    Its displaying well in output, but when I select excel download, the header is getting printed 4 times in the alv output and in the excel download it is printing twice. Please advise how to keep the header once. Note : I am not using any paging concept, simple header at the top.
    Please advise.
    Regards,
    Kiran.

    Hi kiran,
    While creating top-of-page,
    You have to refresh your header internal table before populating it with data i.e,
    FORM TOP.
    Refresh IT_HEADER                   -->with this the header text will not get repeatedly printed
    WA_HEADER-TYP = 'S'.
    WA_HEADER-KEY = TEXT-001.
    WA_HEADER-INFO = SY-REPID.
    APPEND WA_HEADER TO IT_HEADER.
    CLEAR WA_HEADER.
    WA_HEADER-TYP = 'S'.
    WA_HEADER-KEY = TEXT-002.
    WA_HEADER-INFO = SY-UNAME.
    APPEND WA_HEADER TO IT_HEADER.
    CLEAR WA_HEADER.
    WA_HEADER-TYP = 'S'.
    WA_HEADER-KEY = TEXT-003.
    WA_HEADER-INFO = SY-DATUM.
    APPEND WA_HEADER TO IT_HEADER.
    CLEAR WA_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        it_list_commentary       = IT_HEADER
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.
    Hope it helps you
    Regards
    Mansi

  • ALV Excel download problem

    Hi,
    I am trying to download ALV report to excel but the columns in the o/p is appearing in two rows.
    THe ALV report has 82 columns in o/p.Is there any restriction on the no of columns that can be downloaded in excel.Please help.
    Thanks,
    Sutapa.

    Hi Sutapa,
    Kindly go through this link below for ALV Excel Download:
    Re: how to view alv grid output in excel format(not downloading to pc)
    Hope it helps
    Regrds
    Mansi

  • Trigger event of Excel download in ALV

    From my menu bar on the screen can i trigger the alv
    excel download feature.

    Hi Kaushik,
    Check out the function module ALV_XXL_CALL.
    Srinivas

  • Configurations Required for Excel download in IR

    Hi,
    Please let me know the configurations req for enabling Excel download feature from Interactive report.
    Currently i see only CSV and PDF options in report attributes page.
    Regards,
    CKLP

    Hi,
    You need advanced printing engine e.g. BI publisher
    You can start check these links
    http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html
    http://carlback.blogspot.com/2007/03/apex-cocoon-pdf-and-more.html
    http://ubuntuforums.org/showthread.php?t=1004742
    Search more information e.g. Apache POI and FOP from this forum
    Br,Jari

Maybe you are looking for

  • Change layout of Viewer  in 10g

    I was wondering if there are more people having problems with the fact that changing the layout of the viewer in the iAS applies to all users, and since it is the only way to change the layout, this can cause problems in large organisations with diff

  • Reinstalling Elements 11 after upgrading from Windows XP to Windows 7?

    Any idea how I can reinstall Elements 11  (Premier and Photoshop) after upgrading from Windows XP to Windows 7?

  • Re-Assign Serial Number

    Asalam-o-Alekum I want to re-generate serial number on the basis of Starting & Ending Dates. For Example I am having Table called TM_BILLING BILL_NUMBER VARCHAR2(12) having primary key BILL_NUMBER_RG VARCHAR2(12) no primary key BILL_DATE DATE BILL_EN

  • Core Audio - Sample rate

    I've just got myself a copy of Logic Pro 8 as a complete newbie and have hit a bit of a hurdle within 24 hours of opening the software. I was using the software without a problem just tinkering around using a Carillion MIDI interface to play some sof

  • Syncing 4 devices under 1 account

    We have 4 different Ipads and need to register all four under one account. We've got one registered and able to log in to IStore. The others are not allowing connection to the store. Also, software not recognizing devices when plugged in to PCs.