Issue with Data download to excel from ALV

Hi,
I am trying to download data to excel from ALV.
The number of records are 26000.
When I am trying to download I am getting an error displaying a pop up saying that
problems came up in the following areas during the load
TABLE
The log displayed is not clear.
I need to know the limitations while downloading to excel... I tried in SDN but of no use. I am using office 2007.
What is the max downloading limit(MB)
What must be the Length of line that can be downloaded.
Regards

Hi ,
First check whether your ALV grid OUTPUT   is Consistent or Not   .
if there are any inconsistency  then you need to rectify that  .
for Checking COnsistency / Inconsistency  .do following steps
1) execute ALV report 
2) Press Shift+Mouse Right Button (Twice)  in blank area of report 
3) you will get result   whether ALV is good or not .
regards
Deepak.

Similar Messages

  • Issue with data download to excel

    Hi all,
    iam downloading data from table to excel sheet.
    when i see in the excel sheet i don't see the leading zero's
    say if i have value in table as 0001234 but in excel when i download i see as 1234
    instead i want it exactly it is in my table
    this is the code
    data : begin of it_heading occurs 0,
            line(30) type c,
           end of it_heading.
    it_heading-line = 'ABC'.
    append it_headING.
    it_headING-line = 'XYZ'.
    append it_headING.
    call function 'WS_DOWNLOAD'
    exporting
      BIN_FILESIZE                  = ' '
      CODEPAGE                      = ' '
       filename  = p_file
       filetype                      = 'DAT'
        mode                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
      COL_SELECT                    = ' '
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      tables
        data_tab                      = it_data
        fieldnames                    = it_heading
    exceptions
       file_open_error               = 1
       file_write_error              = 2
       invalid_filesize              = 3
       invalid_type                  = 4
       no_batch                      = 5
       unknown_error                 = 6
       invalid_table_width           = 7
       gui_refuse_filetransfer       = 8
       customer_error                = 9
       others                        = 10
    if sy-subrc eq 0.
    endif.
    Thanks
    Kajol

    The date field has nothing to do with the progarm, only with excel sheet. you can try increasing the length in the progam for the date field before pushing to excel and check it.
    gui_download has got some extra features when compared to ws_download.
    You can check this for some info
    http://help.sap.com/saphelp_erp2005/helpdata/en/79/c554a3b3dc11d5993800508b6b8b11/frameset.htm
    http://www.sapdevelopment.co.uk/file/file_otherpc.htm
    WS_UPLOAD and WS_DOWNLOAD, the function modules used until now are not part of the standard set of ABAP commands. They are used to display the file interface on the presentation server. WS_UPLOAD and WS_DOWNLOAD are not compatible with USs and have been replaced by GUI_UPLOAD and GUI_DOWNLOAD.
    The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also allows you to write Unicode format to the local hard drive. For a description of these interfaces, refer to the documentation for each function module, available under SAP Easy Access " Development " Function Builder " Goto " Documentation.
    Instead of using the function modules, you can use the static methods GUI_UPLOAD and GUI_DOWNLOAD of the global class CL_GUI_FRONTEND_SERVICES.
    award points if it helps.

  • Download to excel from alv display

    Hi,
    How to download to excel from alv display.I am using object oriented abap for using alv.If i click export->spreadsheet i am getting fatal error and if i export->local file->spreadsheet i am getting only the column names and heading but no contents.Can anyone tell me how to overcome this problem.
    Regards,
    Sowmya.

    Hi Sowmya,
    Just put break point near FM reuse_alv_grid_display and check if internal table which is used to display output is popullated or not.
    Regards Sachin.

  • Taking download into excel from ALV Grid - header is printing in two lines

    Hi All,
    I have a scenario where I am taking the download from ALV grid to an excel sheet. Now the header of the ALV (column names) is appearing in two lines in the downloaded excel sheet while items (records of the ALV table) are getting displayed in a single line.
    This download is taken from the standard download to local file (spreadsheet) button provided by SAP for ALVs.
    I am using function module "Reuse_alv_grid_display" for the purpose.
    Can somebody provide an idea how I can avoid the header printing in two lines and keep the length as it is.
    Thanks in Advance,
    Chandan

    Hi..
    1. Pass header name in internal table appned first line.
    2. after that pass u r data .
    3. Use  FM. WS_DOWNLOAD 
    Salil ......
    Edited by: salil chavan on Nov 26, 2008 11:07 AM

  • Download to excel from alv grid

    I developed a alv report and I have one percentage field(say PER) in the grid.When I sum on that field PER then it comes in my formula basis.Suppose If I have 5 line items and all PER field have a value 2 then when I sum in PER column then it come 7 inseted of 10 becoze of my formula basis and it comes perfect.But my query is when I download to excel then it comes real value 10 insted of 7. here my formula basis sum which is 7 for all 5 line items is not comming. Can any body help me how will it come?
    Thanks,
    Rakesh

    Hi
    try this code----
    *&      Form  DOWNLOAD_EXCEL_TEMPLATE
          text
    -->  p1        text
    <--  p2        text
    FORM download_excel_template .
      TYPES: BEGIN OF lt_data,
                field1(20),
                field2(30),
                field3(20),
                field4(20),
                field5(20),
                field6(30),
                field7(15),
                field8(10),
                field9(10),
                field10(20),
                field11(20),
                field12(10),
                field13(20),
                field14(20),
              END OF lt_data.
      DATA: lv_file TYPE rlgrap-filename,
            li_data TYPE STANDARD TABLE OF lt_data,
            wa_data TYPE lt_data,
            lv_pathcheck type c,
            lv_file1 type string.
      wa_data-field1 = ''.
      APPEND wa_data TO li_data.
      REFRESH gi_header.
      wa_header-name = 'Company Code'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Main Asset Number'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Asset Sub Number'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Document Date'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Posting Date'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Asset Value Date'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Item Text'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Reference'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Allocation'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Amount Posted'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Percentage Rate'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Quantity'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Prior-Yr Quantity'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Curr-Yr Quantity'.
      APPEND wa_header TO gi_header.
      lv_file = gv_file.
      lv_file1 = gv_file.
      CALL METHOD cl_gui_frontend_services=>directory_exist
        EXPORTING
          directory            = lv_file1
        RECEIVING
          result               = lv_pathcheck
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          wrong_parameter      = 3
          not_supported_by_gui = 4
          OTHERS               = 5.
       FIND '.xls' IN lv_file IGNORING CASE.
      IF sy-subrc = 0.
        REPLACE '.XLS' IN lv_file WITH ' ' IGNORING CASE.
      ENDIF.
      FIND '.TXT' IN lv_file IGNORING CASE.
      IF sy-subrc = 0.
        REPLACE '.TXT' IN lv_file WITH ' ' IGNORING CASE.
      ENDIF.
      CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
        EXPORTING
          file_name                 = lv_file
          data_sheet_name           = 'DATA'
        TABLES
          data_tab                  = li_data
          fieldnames                = gi_header
        EXCEPTIONS
          file_not_exist            = 1
          filename_expected         = 2
          communication_error       = 3
          ole_object_method_error   = 4
          ole_object_property_error = 5
          invalid_pivot_fields      = 6
          download_problem          = 7
          OTHERS                    = 8.
      IF sy-subrc <> 0.
        MESSAGE ID gv_msgid TYPE 'E' NUMBER 002.
      ENDIF.
    ENDFORM.                    " DOWNLOAD_EXCEL_TEMPLATE
    regards,
    Prashant

  • Download to excel from ALV via portal

    HI,
    Could anyone out there help me resolve one issue which I am facing.
    We have developed a ALV report and the same is working fine in GUI screen and also the various ALV features such as Download to Local File, Print Preview and others are working very well.
    But if I deploy the same report on EP. The report is executing just fine but all the ALV features such as download to excel file and all other features are not working as desired.
    I have done some reasearch on this issue and everytime people talk about having the updated Java version and to run this features on IE 7 or below. We have tried all these but still no luck.
    Request you to provide your valuable inputs which can help me resolve this issue.
    Thanks much!
    Regards,
    Sumanth

    Hi,
    I guess this is due to the gui statements like call screen for popup to download which will not work in browser, instead of using FM for ALV or CL_GUI_ALV_GRID class, try using CL_SALV CLasses or create ALV in Web dynpro and integrate it in portal which will work well.
    Hope this helps u.,
    Thanks & Regards,
    Kiran.

  • Why is the spreadsheet empty when users download to Excel from ALV grid?

    Users are seeing SAP GUI transaction results display in the ALV Grid when running an SAP Report; however, when they click the Download to Excel icon the spreadsheet is empty.  When they use List...Export...Spreadsheet, the spreadsheet is filled.
    This seems to only be happening with 'Z' transactions.  Standard delivered transactions are OK.
    Using SAP GUI for Windows and Excel 2003.

    Hi All,
    I also have same Problem I my case when i click on 'Microsoft Excel' it does nothing. It does not even open a sheet.
    Please suggest,
    regards,
    Vinit

  • PO No is not coming complete in length while downloading in excel from ALV

    Hi to all
    My problem is
    I have declared
    EBELN LIKE EBAN-EBELN.
    length is 10.
    Now in ALV report it is showing complete PO no but
    when downloading itto excel , last digit is cut, only 9 digits are displayed.
    Why it is so.
    Please guide me...
    Thanks & regards
    Anubhav

    Hi
    Please try to declre the field EBELN as character of length 10 in the internal table for ALV.
    EBELN type char(10)
    <REMOVED BY MODERATOR>
    Thanks
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 6:00 PM

  • Short Dump when downloading to EXCEL from ALV

    Hi,
    I have an ALV grid display program. The data in the grid is displayed correctly. But when trying to download the data to excel it gives a short dump.
    Assignment error: Overwriting a protected field.
    What happened?
    Error in ABAP application program.
    The current ABAP program "SAPLKKBL" had to be terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    Some times it allows to download the data, but sometimes it gives short dump.
    Thanks,
    Deepthi

    This is my part of the code:
      i_fieldcat-key     = gc_x.
      i_fieldcat-no_zero = gc_x.
      i_fieldcat-fix_column  = 'X'.
      i_fieldcat-hotspot = gc_x.
      perform bild_fieldcat using
        '' 'AUFNR' 'GT_REPORT ' ' '  'CAUFV'  ' '  'C' '12' ' '.
      perform bild_fieldcat using
        '' 'DISGR' 'GT_REPORT ' ' '  'MARC' ' '  'C' '4' ' '.
      perform bild_fieldcat using
        '' 'AUART' 'GT_REPORT ' ' '  'CAUFV' ' '  'C' '04' ' '.
      perform bild_fieldcat using
        '' 'DISPO' 'GT_REPORT ' ' '  'CAUFV' ' ' 'C' '06' ' '.
      i_fieldcat-no_zero = gc_x.
      perform bild_fieldcat using
        '' 'MATNR' 'GT_REPORT ' ' '  'MARA' ' '  'C' '18' ' '.
      i_fieldcat-no_zero = gc_x.
      perform bild_fieldcat using
        '' 'CHARG' 'GT_REPORT ' ' '  'MDFA' ' ' 'C' '14' ' ' .
    *begin insert RCHALASA
      i_fieldcat-no_zero = gc_x.
      i_fieldcat-fix_column  = 'X'.
      perform bild_fieldcat using
        '' 'FTRMI' 'GT_REPORT ' ' '  'CAUFV' ' ' 'D' '08' ' '.
    *end insert
      i_fieldcat-no_zero = gc_x.
      i_fieldcat-fix_column  = 'X'.
      perform bild_fieldcat using
        '' 'GLTRP' 'GT_REPORT ' ' '  'CAUFV'  ' '  'D' '10' ' '.
      i_fieldcat-no_zero = gc_x.
      perform bild_fieldcat using
        '' 'GLTRS' 'GT_REPORT' ' '  'CAUFV' ' ' 'D' '10' ' '.
      perform bild_fieldcat using
        '' 'GSTRP' 'GT_REPORT' ' '  'CAUFV' ' '  'D' '10' ' '.
      perform bild_fieldcat using
        '' 'AGE' 'GT_REPORT' ' '  ' ' 'Age'  'C' '08' ' '.
      i_fieldcat-no_zero = gc_x.
    i_fieldcat-do_sum  = gc_x.
      i_fieldcat-fix_column  = 'X'.
      perform assign_alv_qty_format.
      perform bild_fieldcat using
        '' 'GAMNG' 'GT_REPORT' ' '  ' '  'Order Qty'  'QUAN' '09' ' '.
      perform bild_fieldcat using
        '' 'STK_PROD_FLAG' 'GT_REPORT' ' '   ' '  'Stk/Prod'  'C' '06' ' '.
      i_fieldcat-no_zero = gc_x.
    i_fieldcat-do_sum  = gc_x.
      i_fieldcat-fix_column  = 'X'.
      perform assign_alv_qty_format.
      perform bild_fieldcat using
        '' 'IGMNG' 'GT_REPORT' ' '  ' ' 'Order Yield Qty' 'QUAN' '11' ' '.
      i_fieldcat-no_zero = gc_x.
    i_fieldcat-do_sum  = gc_x.
      i_fieldcat-fix_column  = 'X'.
      perform assign_alv_qty_format.
      perform bild_fieldcat using
        '' 'IASMG' 'GT_REPORT' ' ' ' ' 'Order Scrap Qty'  'QUAN' '11' ' '.
    **begin insert RCHALASA
      perform bild_fieldcat using
         '' 'YIELD_PER' 'GT_REPORT' ' ' ' ' 'Yield'  'C' '05' ' '.
    **end insert
    DATA: col_pos like sy-colno.
    col_pos = '17'.
      loop at gt_oper.
        gv_tabix = sy-tabix.
        i_fieldcat-no_zero = gc_x.
        i_fieldcat-do_sum  = gc_x.
        i_fieldcat-fix_column  = 'X'.
       col_pos = col_pos + 1.
        perform assign_alv_qty_format.
        gv_yield6(03) = gt_oper-vornr1(03).
    *begin insert RCHALASA
        move gt_oper-ltxa1 to gv_text.
      translate gv_text to upper case.
    gv_text = gv_yield.
    *end insert
        gv_tabixn = gv_tabix.
        gv_yield+6(03) = gv_tabixn.
        gv_fieldname = gv_yield.
        translate gv_fieldname to upper case.
        perform bild_fieldcat using
         '' gv_fieldname 'GT_REPORT' ' ' ' ' gv_text  'QUAN' '04' ' '.
       perform assign_alv_qty_format.
      gv_scrap6(03) = gt_oper-vornr1(03).
      select single
             grdtx
             from trugt
             into gv_text1
             where
             grund = gt_oper-vornr
             and werks in s_werks.
       gv_text = gv_scrap.
       i_fieldcat-no_zero = gc_x.
       gv_tabixn = gv_tabix.
      gv_scrap+6(03) = gv_tabixn.
       gv_fieldname = gv_scrap.
       translate gv_fieldname to upper case.
       perform bild_fieldcat using
         gv_fieldname 'GT_REPORT' ' ' gv_text1 'X' 'QUAN' '08' ' '.
       clear gv_text1.
      endloop.  " GT_OPER
      DATA: count type c.
      DESCRIBE table gt_grund lines count.
      loop at gt_grund into gl_grund.
        gv_tabix = sy-tabix.
        i_fieldcat-no_zero = gc_x.
        i_fieldcat-do_sum  = gc_x.
        i_fieldcat-fix_column  = 'X'.
        perform assign_alv_qty_format.
        if gl_grund-grund is initial.
          gl_grund = 'NONE'.
          gv_text = gl_grund.
        else.
           gv_text = gl_grund-grdtx.
        endif.
        gv_tabixn = gv_tabix.
        gv_scrap_code+11(03) = gv_tabixn.
        gv_fieldname = gv_scrap_code.
        translate gv_fieldname to upper case.
       col_pos = col_pos + 1.
        perform bild_fieldcat using
          '' gv_fieldname 'GT_REPORT' 'XMNGA' 'AFRU'  gv_text  'QUAN' '12' ' ' .
      endloop.  " GT_OPER
      gb_layout-zebra = 'X'.
      gb_print-no_print_listinfos = 'X'.
      gb_variant-variant = p_varia.
      perform create_events using gt_events[].
      call function 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          text = 'Reading SAP Records.......'(600).
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = gv_repid
                i_callback_top_of_page   = 'TOP_OF_PAGE'
               i_callback_pf_status_set = 'SET_STATUS'
                i_callback_user_command  = 'CALL_UP_SAP_TRANS'
                it_fieldcat              = i_fieldcat[]
                is_layout                = gb_layout
                i_grid_title             = gb_title
                i_default                = 'X'
                i_save                   = 'X'
                is_variant               = gb_variant
                is_print                 = gb_print
                it_events                = gt_events[]
           tables
                t_outtab                 = gt_report
           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.
    ***********ALV SUBROUTINE**************
    TYPE-POOLS: slis.
    DATA: gv_repid            LIKE sy-repid.
    DATA: i_fieldcat          TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA: gb_layout           TYPE slis_layout_alv.
    DATA: gb_selfield         TYPE slis_selfield.
    DATA: gb_print            TYPE slis_print_alv.
    DATA: i_sort              TYPE  slis_t_sortinfo_alv WITH HEADER LINE.
    DATA: gv_keyinfo          TYPE SLIS_KEYINFO_ALV.
    DATA: gb_variant          LIKE disvariant,
          gb_def_variant      LIKE disvariant.
    DATA: gb_title(70).
    DATA: gt_events           TYPE slis_t_event,
          gt_sort             TYPE SLIS_T_SORTINFO_ALV,
          gt_list_top_of_page TYPE slis_t_listheader,
          g_status_set        TYPE slis_formname VALUE 'PF_STATUS_SET',
          g_user_command      TYPE slis_formname VALUE 'USER_COMMAND',
          g_top_of_page       TYPE slis_formname VALUE 'TOP_OF_PAGE',
          g_end_of_page       TYPE slis_formname VALUE 'END_OF_PAGE',
          g_top_of_list       TYPE slis_formname VALUE 'TOP_OF_LIST',
          g_end_of_list       TYPE slis_formname VALUE 'END_OF_LIST'.
    DATA: it_event_exit TYPE slis_t_event_exit WITH HEADER LINE.
    *--- Rotinas ---
    FORM alv_init.
      CLEAR: gb_variant.
      gv_repid = sy-repid.
      gb_variant-report = gv_repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
           EXPORTING
                i_save     = 'A'
           CHANGING
                cs_variant = gb_variant
           EXCEPTIONS
                not_found  = 2.
      IF sy-subrc = 0.
        p_varia = gb_variant-variant.
      ENDIF.
    ENDFORM.                    " ALV_INIT
    FORM alv_f4.
      gb_variant-report = gv_repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
           EXPORTING
                is_variant = gb_variant
                i_save     = 'A'
           IMPORTING
                es_variant = gb_variant
           EXCEPTIONS
                not_found  = 2.
      IF sy-subrc = 2.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        p_varia = gb_variant-variant.
      ENDIF.
    ENDFORM.                                                    " ALV_F4
    FORM bild_fieldcat USING x_pos x_field x_tab x_reffld x_ref x_text x_type x_tam x_sym.
      i_fieldcat-col_pos       = x_pos.
      i_fieldcat-fieldname     = x_field.
      i_fieldcat-tabname       = x_tab.
      i_fieldcat-ref_fieldname = x_reffld.
      i_fieldcat-ref_tabname   = x_ref.
      i_fieldcat-seltext_l     = x_text.
      i_fieldcat-seltext_m     = x_text.
      i_fieldcat-seltext_s     = x_text.
      i_fieldcat-ddictxt  = 'M'   .
      i_fieldcat-inttype       = x_type.
      i_fieldcat-outputlen     = x_tam.
      i_fieldcat-symbol        = x_sym.
      APPEND i_fieldcat.
      CLEAR  i_fieldcat.
    ENDFORM.                    " BILD_FIELDCAT
    FORM create_events USING rt_events TYPE slis_t_event.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                i_list_type = 0
           IMPORTING
                et_events   = rt_events.
      READ TABLE rt_events WITH KEY name = slis_ev_top_of_page
                               INTO ls_event.
      IF sy-subrc = 0.
        MOVE g_top_of_page TO ls_event-form.
        APPEND ls_event TO rt_events.
      ENDIF.
    ENDFORM.                    "

  • Last digit truncates while downloading to Excel from ALV Grid

    Hi All,
    I have been using REUSE_ALV_LIST_DISPLAY and REUSE_ALV_GRID_DISPLAY in my report program.
    While i use REUSE_ALV_GRID_DISPLAY and downloading the data to a local file(Excel) the last digit of the Vendor code is truncated. But in REUSE_ALV_LIST_DISPLAY the datas are downloaded correctly as displayed in the ALV.
    I have copied the code for the reference.
    REPORT  zfirp001                                .
    TYPE-POOLS: slis.
    TABLES: bsak.
    SELECT-OPTIONS:  s_bukrs FOR bsak-bukrs,
                     s_lifnr FOR bsak-lifnr,
                     s_blart FOR bsak-blart,
                     s_augdt FOR bsak-augdt,
                     s_zterm FOR bsak-zterm.
    PARAMETERS:      s_list AS CHECKBOX,
                     s_vari LIKE disvariant-variant.
    DATA: g_ext_num(24) TYPE c.
    DATA: BEGIN OF gt_bsak OCCURS 0,
            bukrs LIKE bsak-bukrs,
            lifnr LIKE bsak-lifnr,
            augdt LIKE bsak-augdt,
            gjahr LIKE bsak-gjahr,
            belnr LIKE bsak-belnr,
            blart LIKE bsak-blart,
            zterm LIKE bsak-zterm,
          END OF gt_bsak.
    DATA: BEGIN OF gt_bseg OCCURS 0,
            bukrs LIKE bseg-bukrs,
            belnr LIKE bseg-belnr,
            gjahr LIKE bseg-gjahr,
            wrbtr LIKE bseg-wrbtr,
            projk LIKE bseg-projk,
            shkzg LIKE bseg-shkzg,
            hkont LIKE bseg-hkont,
          END OF gt_bseg.
    ALV
    DATA: gt_fieldtab TYPE slis_t_fieldcat_alv,
          g_save(1)   TYPE c,
          g_variant   LIKE disvariant.
    DATA: BEGIN OF gt_result OCCURS 0,
            bukrs       LIKE bsak-bukrs,
            lifnr       LIKE bsak-lifnr,
            name1       LIKE lfa1-name1,
            augdt       LIKE bsak-augdt,
            gjahr       LIKE bsak-gjahr,
            belnr       LIKE bsak-belnr,
            blart       LIKE bsak-blart,
            zterm       LIKE bsak-zterm,
            wrbtr       LIKE bseg-wrbtr,
            waers       LIKE bkpf-waers,
            ext_num(24) TYPE c,
            txt20       LIKE skat-txt20,
            usr00       LIKE prps-usr00,
            usr01       LIKE prps-usr01,
            usr02       LIKE prps-usr02,
            usr03       LIKE prps-usr03,
          END OF gt_result.
    CONSTANTS: c_credit(1)       TYPE c VALUE 'H',
               c_x(1)            TYPE c VALUE 'X',
               c_en(2)           TYPE c VALUE 'EN',
               c_mrc(4)          TYPE c VALUE 'CA01'.
    *====================================================
    INITIALIZATION.
      PERFORM initialize_variant.
    AT SELECTION-SCREEN.
      PERFORM pai_of_selection_screen.
    *====================================================
    START-OF-SELECTION.
      REFRESH gt_result.
    find clearing documents
      SELECT        bukrs
                    lifnr
                    augdt
                    gjahr
                    belnr
                    blart
                    zterm
             INTO   TABLE gt_bsak
             FROM   bsak
             WHERE  bukrs  IN s_bukrs
             AND    lifnr  IN s_lifnr
             AND    augdt  IN s_augdt
             AND    blart  IN s_blart
             AND    zterm  IN s_zterm.
      CHECK NOT gt_bsak[] IS INITIAL.
      LOOP AT gt_bsak.
    read WBS items
        SELECT        bukrs
                      belnr
                      gjahr
                      dmbtr
                      projk
                      shkzg
                      hkont
               INTO   TABLE  gt_bseg
               FROM   bseg
               WHERE  bukrs  = gt_bsak-bukrs
               AND    belnr  = gt_bsak-belnr
               AND    gjahr  = gt_bsak-gjahr
               AND    projk  > space.
        gt_result-bukrs = gt_bsak-bukrs.
        gt_result-lifnr = gt_bsak-lifnr.
        gt_result-augdt = gt_bsak-augdt.
        gt_result-belnr = gt_bsak-belnr.
        gt_result-gjahr = gt_bsak-gjahr.
        gt_result-blart = gt_bsak-blart.
        gt_result-zterm = gt_bsak-zterm.
    document currency
        SELECT SINGLE waers
               INTO   gt_result-waers
               FROM   bkpf
               WHERE  bukrs  = gt_bsak-bukrs
               AND    belnr  = gt_bsak-belnr
               AND    gjahr  = gt_bsak-gjahr.
    vendor name
        SELECT SINGLE name1
               INTO   gt_result-name1
               FROM   lfa1
               WHERE  lifnr  = gt_result-lifnr.
    for each accounting document
        LOOP AT gt_bseg.
    convert to external WBS
          CALL FUNCTION 'PSPNUM_INTERN_TO_EXTERN_CONV'
            EXPORTING
              edit_imp  = c_x
              int_num   = gt_bseg-projk
            IMPORTING
              ext_num   = gt_result-ext_num
            EXCEPTIONS
              not_found = 1
              OTHERS    = 2.
    debit or credit
          IF gt_bseg-shkzg = c_credit.
            gt_result-wrbtr = gt_bseg-wrbtr.
          ELSE.
            gt_result-wrbtr = gt_bseg-wrbtr * -1.
          ENDIF.
    GL short Text
          SELECT SINGLE txt20
                 INTO   gt_result-txt20
                 FROM   skat
                 WHERE  spras  = c_en
                 AND    ktopl  = 'CA01'
                 AND    saknr  = gt_bseg-hkont.
    user fields
          SELECT SINGLE usr00
                        usr01
                        usr02
                        usr03
                 INTO  (gt_result-usr00,
                        gt_result-usr01,
                        gt_result-usr02,
                        gt_result-usr03)
                 FROM   prps
                 WHERE  pspnr  = gt_bseg-projk.
    append to result table
          APPEND gt_result.
        ENDLOOP.
      ENDLOOP.
    *====================================================
    END-OF-SELECTION.
      PERFORM initialize_fieldcat USING gt_fieldtab[].
      g_variant-report = sy-repid.
      g_save           = 'A'.
      IF s_list = 'X'.
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            it_fieldcat = gt_fieldtab
            i_default   = 'A'
            i_save      = g_save
            is_variant  = g_variant
          TABLES
            t_outtab    = gt_result.
      ELSE.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            it_fieldcat = gt_fieldtab
            i_default   = 'A'
            i_save      = g_save
            is_variant  = g_variant
          TABLES
            t_outtab    = gt_result.
      ENDIF.
    *&      Form  initialize_variant
    FORM initialize_variant.
      g_save = 'A'.
      CLEAR g_variant.
      g_variant-report = sy-repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save     = g_save
        CHANGING
          cs_variant = g_variant
        EXCEPTIONS
          not_found  = 2.
      IF sy-subrc = 0.
        s_vari = g_variant-variant.
      ENDIF.
    ENDFORM.                               " INITIALIZE_VARIANT
    *&      Form  pai_of_selection_screen
    FORM pai_of_selection_screen.
      IF NOT s_vari IS INITIAL.
        MOVE s_vari TO g_variant-variant.
        CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
          EXPORTING
            i_save     = g_save
          CHANGING
            cs_variant = g_variant.
      ELSE.
        PERFORM initialize_variant.
      ENDIF.
    ENDFORM.                    " PAI_OF_SELECTION_SCREEN
    *&      Form  initialize_fieldcat
    FORM initialize_fieldcat USING p_fieldtab TYPE slis_t_fieldcat_alv.
      DATA: l_fieldcat TYPE slis_fieldcat_alv.
      CLEAR l_fieldcat.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'BUKRS'.
      l_fieldcat-seltext_L  = 'Company'.
      l_fieldcat-outputlen  = '8'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'LIFNR'.
      l_fieldcat-seltext_L  = 'Vendor'.
      l_fieldcat-outputlen  = '10'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'NAME1'.
      l_fieldcat-seltext_L  = 'Name'.
      l_fieldcat-outputlen  = '35'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'AUGDT'.
      l_fieldcat-seltext_L  = 'Cleared'.
      l_fieldcat-outputlen  = '10'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'GJAHR'.
      l_fieldcat-seltext_L  = 'Year'.
      l_fieldcat-outputlen  = '5'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'BELNR'.
      l_fieldcat-seltext_L  = 'Document'.
      l_fieldcat-outputlen  = '10'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'BLART'.
      l_fieldcat-seltext_L  = 'Type'.
      l_fieldcat-outputlen  = '4'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'ZTERM'.
      l_fieldcat-seltext_L  = 'Pay Terms'.
      l_fieldcat-outputlen  = '4'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'WRBTR'.
      l_fieldcat-seltext_L  = 'Amount'.
      l_fieldcat-outputlen  = '13'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'WAERS'.
      l_fieldcat-seltext_L  = 'CURR'.
      l_fieldcat-outputlen  = '5'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'EXT_NUM'.
      l_fieldcat-seltext_L  = 'WBS'.
      l_fieldcat-outputlen  = '24'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'TXT20'.
      l_fieldcat-seltext_L  = 'Short Text'.
      l_fieldcat-outputlen  = '20'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'USR00'.
      l_fieldcat-seltext_L  = 'H/O File Ref'.
      l_fieldcat-outputlen  = '20'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'USR01'.
      l_fieldcat-seltext_L  = 'Local File Ref'.
      l_fieldcat-outputlen  = '20'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'USR02'.
      l_fieldcat-seltext_L  = 'INFORM Agree ID'.
      l_fieldcat-outputlen  = '10'.
      APPEND l_fieldcat TO p_fieldtab.
      l_fieldcat-tabname    = 'GT_RESULT'.
      l_fieldcat-fieldname  = 'USR03'.
      l_fieldcat-seltext_L  = 'INFM Prim Ag ID'.
      l_fieldcat-outputlen  = '10'.
      APPEND l_fieldcat TO p_fieldtab.
    ENDFORM.                    " INITIALIZE_FIELDCAT
    Could the experts do help to overcome the probs.
    Thanks in Advance.
    Regards,
    Anbalagan.V

    Hi Anbalagan,
    i've tested your program - but it works fine (Rel. 4.6C,SAPKB46C30)
    download is ok and direct transfer (excel inplace) is ok.
    but i've a question to the selection of waers in your program -
    why do you select waers from bkpf and not from bsak ?
    i think sel. of bkpf is'nt necessary !
    regards Andreas

  • Issue with data populated in excel attachment

    Hi Folks,
    Im an emailing the report output as excel attachement. In the excel file, im getting only the header line and NOT the details, pls help me where im going wrong.
    regds,
    BG

    hi pls find the code im using as below.
    TYPES : BEGIN OF ty_output,
                  no(18) TYPE c,
           soh(13) TYPE c,
           qty(13) TYPE c,
           matnr TYPE mara-matnr,
           maktx TYPE makt-maktx,
           labst TYPE mard-labst,
           avl_qty TYPE bapicm61v-wkbst,
           END OF ty_output.
    DATA:
    docdata LIKE sodocchgi1,
    objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
    objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE,
    tab_lines TYPE sy-tabix.
    DATA: lv_labst(13) TYPE c,
             lv_avl_qty(13) TYPE c,
             t_output TYPE STANDARD TABLE OF ty_output,
              wa_output LIKE LINE OF t_output.
    CONSTANTS: con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
                 con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
    Body
    docdata-obj_name = 'Mail_Excel_File'.
    docdata-obj_descr = 'Excel file attachment'.
    objtxt = 'Attached is the sample Excel file'.
    APPEND objtxt.
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ TABLE objtxt INDEX tab_lines.
    docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    CLEAR objpack-transf_bin.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = 'RAW'.
    APPEND objpack.
    Attachment
    *i_data-a = 'Sample'.
    *i_data-b = 'File'.
    *CONCATENATE i_data-a i_data-b INTO objbin.
    *APPEND objbin.
    CONCATENATE 'NO 'SOH'
                  'QTY' 'MATNR ' 'MAKTX'
                  'LABST' 'AVL_QTY'  INTO objbin SEPARATED BY con_tab.
      CONCATENATE con_cret objbin INTO objbin.
      APPEND objbinst.
      CLEAR objbin.ut
    wa_output-no = '123456'.
    wa_output-soh = '39000'.
    wa_output-qty = '39000'.
    wa_output-matnr = '123-456'.
    wa_output-maktx = 'test'.
    lv_labst = '39,000'.
    lv_avl_qty = '39,000'.
        CONCATENATE wa_output-no wa_output-soh
                    wa_output-qty wa_output-matnr
                    wa_output-maktx lv_labst
                    lv_avl_qty
                    INTO objbin SEPARATED BY con_tab.
        CONCATENATE con_cret objbin INTO objbin.
        APPEND objbin.
        CLEAR objbin.
    DESCRIBE TABLE objbin LINES tab_lines.
    objpack-doc_size = tab_lines * 255.
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num = 1.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = 'XLS'.
    docdata-obj_name = 'Excel_File_Attachment'.
    objpack-obj_descr = 'Excel File Attachment'.
    APPEND objpack.
    Create the list of recipients
    reclist-receiver = mail address.
    reclist-rec_type = 'U'.
    reclist-express = 'X'.
    APPEND reclist.
    Send the e-mail
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        document_data              = docdata
        put_in_outbox              = 'X'
        commit_work                = 'X'
      TABLES
        packing_list               = objpack
        contents_bin               = objbin
        contents_txt               = objtxt
        receivers                  = reclist
      EXCEPTIONS
        too_many_receivers         = 1
        document_not_sent          = 2
        document_type_not_exist    = 3
        operation_no_authorization = 4
        parameter_error            = 5
        x_error                    = 6
        enqueue_error              = 7
        OTHERS                     = 8.
    COMMIT WORK.

  • Issue with Date Datatype while importing from SQL Server to OBIEE

    Hi,
    We have a column in SQL Server Database with datatype as Date. When we imported this column into the Physical layer of OBIEE rpd,
    the datatype of this column is getting converted to VarChar automatically. Has anyone faced this issue before?
    Please let me know if you have a solution for this.
    Thanks in advance.

    Hi,
    How are you passing this date parameter ?
    Instead of passing this parameter in date format, you can pass this as string and then in PL/SQL package, you can convert this string to date.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Issue with data Validation while migrating from one application to another

    Hi All,
    I am having a strange issue Kindly please help me .
    I have a data form which have data validation on each cell.The dataform is quite large and contain data for 4 accounts and year (Jan to Dec) combination .The issue is that I when I migrate this data form to other application which is just the replica of the main application. The validation on each cells changes its reference points.
    I have 5 more similar data form and I need to migrate then to other application and also on production sever. Is there any way that while exporting and importing them using formutil.cmd or other way that the validation cells reference does not change its reference point.
    For ex I have validation on Cell A5,A6..........AA6 after migrating it changes to A1,A1.........AA1.
    I am using 11.1.2.1.0 version of Hyperion Planning
    Kindly please help.
    Thanks in advance
    Vikash
    Edited by: user11391767 on Nov 30, 2011 10:47 AM

    Hi Mehmet,
    I tried using the FormDefUtil.cmd .But by using this the reference points of validation changes to first cell when imported.
    Thanks
    Vikash

  • Download to Excel from ALV

    Hi,
       I ran the program 'BALVEX02' and i got the output i clicked on ALV standard application tool bar button 'Spreadsheet' (Ctrl_shift+F7) and unfortunately i selected HTML format radio button and selected check box that 'Always use the same format'. I need to change that format to excel. How can i get that pop-up box again. Looks like simple but could not see the alternative.
    Thanks

    Moderator message - Please do not add a meaningless comment when you mark a post as solved. It only brings old posts to the top of the forum list and pushes current ones down.
    Rob

  • Download to excel from front end - percent coming as date

    download to excel from front end - percent coming as date
    Hi,
    i'm using below method to dowload to excel from frontend (Backened is R/3).
    1) l_string will have the entire xls date ( with sepeartor cl_abap_char_utilities=>horizontal_tab and cl_abap_char_utilities=>newline)
    2) Converitng string to xstring using FM SCMS_STRING_TO_XSTRING
    3) pumping excel date to browser using  IF_HTTP_ENTITY~SET_DATA
    4) creating URL using GUID_CREATE fm.
    it's downloding the excel file but funny date.
    example
    percentage 1.5 coming as Jan 50 and Percent 3.5 coming March 50.
    How to avoid this funny conversion.
    ...Nandha

    Hi Nanda,
    have you tried to change the number format of the corresponding cells in excel to percentage?
    BR Steffen

Maybe you are looking for