Get contents of  ALV variant selected!

Hi All,
I have a requirement to download fields of an ALV report to excel. I use different variants in my program . So based on the variant selected I need to download only those fields. Can  you tell how to get the fields of  a particluar variant?
Regards,
Rakesh

Hi,
Wt r u asking i don't know? Deponds upon the variants the output data my be differ not fields.
U can save the layout for that particular variants.
option is
I_SAVE             = 'X '
Thanks,
Shankar

Similar Messages

  • Change Column content of ALV Variant

    Hi,
    I need to add a field in an existing variant for the layout of an ALV report. What I did was to add a field in a structure using Append Structure. The text that I first entered was wrong (field label of the data type of the field). Now, when I run the ALV Report, then when I choose to add a hidden field in the variant(setting>display variant>Current...), the wrong text is appearing even if I've already modified the field label of the data type.
    Do I need to adjust something in order for the "Column Content" of the variant to be displayed properly?

    After you made the change to the ALV catalog, try to re-create the variant again.
    Thanks & regards,
    Hadiman

  • Getting content and address of select-options (created dynamically)

    Hi guys,
    Suppose I have a dynamically created select-options in a program
    SELECT-OPTIONS it_ranges FOR ...
    Let's say I can determine its name ( IT_RANGES ) only during program execution.
    Now I know I can use field symbols to get its content like below:
    FIELD-SYMBOLS: <fs>.
    "here I will have content of the table in <FS>
    ASSIGN ('IT_RANGES[]') TO <fs>.
    ...but I would like to know how can I get the content of this select-options table through date reference
    TYPES: BEGIN OF t_ranges,
            sign TYPE c,
            option(2) TYPE c,
            low TYPE i,
            high TYPE i,
           END OF t_ranges.
    "let say tt_ranges is of the same type like IT_RANGES
    TYPES: tt_ranges TYPE TABLE OF t_ranges.
    DATA: ref TYPE REF TO data.
    CREATE DATA ref TYPE tt_ranges.
    The above will only create typed reference to table but I want it to point to my table IT_RANGES. The statement below don't work here.
    GET REFERENCE OF ('IT_RANGES[]') INTO ref.
    Is there any other way I can get (using data reference)?
    1) address of this select-options table
    2) content of this select-options table
    Thanks for help in advance
    M.
    Edited by: Marcin Pciak on Nov 28, 2008 11:33 AM

    Statement CREATE DATA would only make sense when you are trying to create the dynamic select options. You can use the addition TYPE HANDLE in order to create the Range Table. Check method implementation CREATE_RANGE_TABLE in class CL_WDR_SELECT_OPTIONS.
    Once the Select-option is created, you need to use the GET REFERENCE to get the data reference of the Select-options. We can't specify the dynamic reference with brackets in the GET REFERENCE statement. So, you need to use the field-symbols to do the dynamics.
    DATA: ref TYPE REF TO data.
    DATA: ref_fs TYPE REF TO data.
    FIELD-SYMBOLS: <fs>.
    DATA: w_range TYPE i.
    SELECT-OPTIONS it_rang FOR w_range.
    START-OF-SELECTION.
      GET REFERENCE OF it_rang[] INTO ref.
      ASSIGN ('IT_RANG[]') TO <fs>.
      GET REFERENCE OF <fs> INTO ref_fs.
      write: 'done'.
    Regards,
    Naimesh Patel

  • Remove first 30 characters from get-content

    hello
    i have a one liner which reads a file and filter it based on my criteria. the output is very lengthy. i need to remove the first 35 characters of that in order to have a clear result with no unwanted information
    Get-Content D:\netlogon.bak | Select-String -Pattern "CHI-*"
    after I filter based on pattern, i want to remove the first 35 charaters. how can i do this?
    thank you

    Get-ContentD:\netlogon.bak
    | Select-String
    -Pattern
    "CHI-*" | %{$_.SubString(35,$_.Length-35)}
    \_(ツ)_/

  • Help needed on ALV variant with new GUI screen is created by set PF status

    Hi Gurus,
    I have created a new GUI screen for ALV grid display thru set pf-status, since i need two buttons on application toolbar.
    have been passing parameters to alv_grid_display FM for display-*
    i_save            = 'A'
    is_variant        = gwa_variant
    I have an ALV variant selection paramter on selection screen.
    Please guide me with some pointers on how to implement ALV variant selection thru selection screen.
    Many Thanks,
    Madan

    Hi,
    Search default variant for the report
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
           EXPORTING
                i_save     = 'A'
           CHANGING
                cs_variant = i_variant1
           EXCEPTIONS
                not_found  = 2.
    If default variant is found , use it as default.
    Else , use the variant LAYOUT1.
      IF sy-subrc = 0.
        p_var = i_variant1-variant.
      ELSE.
        p_var = 'LAYOUT1'.
      ENDIF.
    endform.                    " SUB_VARIANT_INIT
    *&      Form  SUB_CHECK_PVAR
    Once the user has entered variant, check about its existence
    FORM SUB_CHECK_PVAR.
    If the name of the variable is not blank, check about its existence
    if not p_var is initial.
      clear i_variant.
      i_variant-report = sy-repid.
      i_variant-variant = p_var.
      CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
             EXPORTING
                  I_SAVE     = 'A'
             CHANGING
                  CS_VARIANT = I_VARIANT.
    If no such variant found , flash error message
         if sy-subrc ne 0 .
          message e398(00) with 'No such variant exists'.
         else.
    If variant exists , use the variant name to populate structure
    I_VARIANT1 which will be used for export parameter : IS_VARIANT
    in the function module : REUSE_ALV_GRID_DISPLAY
           clear i_variant1.
           move p_var to i_variant1-variant.
           move sy-repid to i_variant1-report.
         endif.
    else.
       clear i_variant.
    endif.
    ENDFORM.                    " SUB_CHECK_PVAR
    *&      Form  SUB_VARIANT_F4
    Display a list of various variants of the report when the
    user presses F4 key in the variant field
    form SUB_VARIANT_F4.
    i_variant-report = sy-repid.
    Utilising the name of the report , this function module will
    search for a list of variants and will fetch the selected one into
    the parameter field for variants
    CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
           EXPORTING
                IS_VARIANT         = I_VARIANT
                I_SAVE             = 'A'
                I_DISPLAY_VIA_GRID = 'X'
           IMPORTING
                ES_VARIANT         = I_VARIANT1
           EXCEPTIONS
                NOT_FOUND          = 1
                PROGRAM_ERROR      = 2
                OTHERS             = 3.
      IF SY-SUBRC = 0.
        P_VAR = I_VARIANT1-VARIANT.
    ENDIF.
    endform.                    " SUB_VARIANT_F4
    Thanks
    Ashu

  • Switching between ALV variants

    Hi Experts
    Is there any way to switch between the variants of an ALV without using the std dropdown available in alv header.
    I have a requirement to navigate to various views depending on the current ALV variant selected by the user in my application.
    Thanks and Regards
    Karthick

    Hi Experts
    Is there any way to switch between the variants of an ALV without using the std dropdown available in alv header.
    I have a requirement to navigate to various views depending on the current ALV variant selected by the user in my application.
    Thanks and Regards
    Karthick

  • Read Dynamic Selection contents of a Variant for QE51N

    Hi Folks,
    Need your help here !
    In my report, I wish to read the Variants along with their contents created for transaction QE51N.
    I tried using function module RS_VARIANT_CONTENTS and its working good, but not to my requirements. The function module returns only the selection screen contents of a given variant. It does not return the contents in 'Dynamic Selection' (Free Selection).
    I read somewhere that the function module returns dynamic selection contents only if the report use Logical Database. To my understanding, the program for QE51N (SAPLQEES) do not use LDB.
    So is there any way by which I can get dynamic selection contents of a variant?
    Any suggestions / pointers would be a great help.
    Thank you.
    Regards,
    Sud.

    Hi,
    Did you find somethings? I have the same issue.
    I would like to add some new fields on Dynamic Selection screen of QE51N.
    Thanks in advance.
    KR,
    Arnaud

  • ALV GRID - Get setting of the variants

    Dear All,
    I have a program which provides a list with ALV - the user can give his ALV variant on the selection-screen.
    I have to know the setting of the variant chosen - Field - Sort - subtotal - This program could be ran in background, that why I have to know all these information by the variant name .
    Goal : Let the user chose the layout he wants, and then, the program take over all information he wants and sends by mail the result in an excel file.
    Does someone know how to do ?
    Thanks a lot
    Nat

    Hi  go through  the fallowing code,
    DATA: sp TYPE  syldb_sp,
          l_params       LIKE  vanz OCCURS 0 WITH HEADER LINE,
          l_params_nonv  LIKE  vanz OCCURS 0 WITH HEADER LINE,
          l_selop        LIKE  vanz OCCURS 0 WITH HEADER LINE,
          l_selop_nonv   LIKE  vanz OCCURS 0 WITH HEADER LINE,
          valutab        LIKE  rsparams OCCURS 0 WITH HEADER LINE,
          objects        LIKE  vanz OCCURS 0 WITH HEADER LINE,
          free_selections_desc TYPE  rsdynbrepi OCCURS 0,
          free_selections_value TYPE  rsseldyn OCCURS 0,
          g_subrc LIKE sy-subrc VALUE 0.
    SELECT report variant FROM varid
                INTO CORRESPONDING FIELDS OF
                TABLE it_varid
                WHERE report = sy-repid.
        IF sy-subrc <> 0.
          REFRESH it_varid.
        ENDIF.
        LOOP AT it_varid.
          CLEAR p_run.
          CALL FUNCTION 'RS_VARIANT_CONTENTS'
            EXPORTING
              report                = it_varid-report
              variant               = it_varid-variant
              execute_direct        = 'X'
            IMPORTING
              sp                    = sp
            TABLES
              l_params              = l_params
              l_params_nonv         = l_params_nonv
              l_selop               = l_selop
              l_selop_nonv          = l_selop_nonv
              valutab               = valutab
              OBJECTS               = OBJECTS
              free_selections_desc  = free_selections_desc
              free_selections_value = free_selections_value
            EXCEPTIONS
              variant_non_existent  = 1
              variant_obsolete      = 2
              OTHERS                = 3.
    Regards,
    Vijay

  • Free the contentes of alv tree

    how to free the contents of alv tree?

    Hi kailash,
    Good Check the below example program for ALV Tree ( Complete Example)
    Demo Program on ALV Tree Control
    REPORT  zdemo_alv_tree.
    CLASS cl_gui_column_tree DEFINITION LOAD.
    CLASS cl_gui_cfw DEFINITION LOAD.
    DATA tree1  TYPE REF TO cl_gui_alv_tree_simple.
    INCLUDE <icon>.
    INCLUDE bcalv_simple_event_receiver.
    DATA: gt_sflight      TYPE sflight OCCURS 0,   " Output-Table
          gt_fieldcatalog TYPE lvc_t_fcat,         " Field Catalog
          gt_sort         TYPE lvc_t_sort,         " Sorting Table
          ok_code         LIKE sy-ucomm.           " OK-Code
    END-OF-SELECTION.
      CALL SCREEN 100.
    *&      Form  BUILD_FIELDCATALOG
    This subroutine is used to build the field catalog for the ALV list
    FORM build_fieldcatalog.
    get fieldcatalog
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'SFLIGHT'
        CHANGING
          ct_fieldcat      = gt_fieldcatalog.
    change fieldcatalog
      DATA: ls_fieldcatalog TYPE lvc_s_fcat.
      LOOP AT gt_fieldcatalog INTO ls_fieldcatalog.
        CASE ls_fieldcatalog-fieldname.
          WHEN 'CARRID' OR 'CONNID' OR 'FLDATE'.
            ls_fieldcatalog-no_out = 'X'.
            ls_fieldcatalog-key    = ''.
          WHEN 'PRICE' OR 'SEATSOCC' OR 'SEATSMAX' OR 'PAYMENTSUM'.
            ls_fieldcatalog-do_sum = 'X'.
        ENDCASE.
        MODIFY gt_fieldcatalog FROM ls_fieldcatalog.
      ENDLOOP.
    ENDFORM.                               " BUILD_FIELDCATALOG
    *&      Form  BUILD_OUTTAB
    Retrieving the data from the table and filling it in the output table
    of the ALV list
    FORM build_outtab.
      SELECT * FROM sflight INTO TABLE gt_sflight.
    ENDFORM.                               " BUILD_OUTTAB
    *&      Form  BUILD_SORT_TABLE
    This subroutine is used to build the sort table or the sort criteria
    FORM build_sort_table.
      DATA ls_sort_wa TYPE lvc_s_sort.
    create sort-table
      ls_sort_wa-spos = 1.
      ls_sort_wa-fieldname = 'CARRID'.
      ls_sort_wa-up = 'X'.
      ls_sort_wa-subtot = 'X'.
      APPEND ls_sort_wa TO gt_sort.
      ls_sort_wa-spos = 2.
      ls_sort_wa-fieldname = 'CONNID'.
      ls_sort_wa-up = 'X'.
      ls_sort_wa-subtot = 'X'.
      APPEND ls_sort_wa TO gt_sort.
      ls_sort_wa-spos = 3.
      ls_sort_wa-fieldname = 'FLDATE'.
      ls_sort_wa-up = 'X'.
      APPEND ls_sort_wa TO gt_sort.
    ENDFORM.                               " BUILD_SORT_TABLE
    *&      Module  PBO  OUTPUT
    This subroutine is used to build the ALV Tree
    MODULE pbo OUTPUT.
      IF tree1 IS INITIAL.
        PERFORM init_tree.
      ENDIF.
      SET PF-STATUS 'ZSTATUS'.
    ENDMODULE.                             " PBO  OUTPUT
    *&      Module  PAI  INPUT
    This subroutine is used to handle the navigation on the screen
    MODULE pai INPUT.
      CASE ok_code.
        WHEN 'EXIT' OR 'BACK' OR 'CANC'.
          PERFORM exit_program.
        WHEN OTHERS.
          CALL METHOD cl_gui_cfw=>dispatch.
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                             " PAI  INPUT
    *&      Form  exit_program
          free object and leave program
    FORM exit_program.
      CALL METHOD tree1->free.
      LEAVE PROGRAM.
    ENDFORM.                               " exit_program
    *&      Form  register_events
    Handling the events in the ALV Tree control in backend
    FORM register_events.
    define the events which will be passed to the backend
      DATA: lt_events TYPE cntl_simple_events,
            l_event TYPE cntl_simple_event.
    define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_click.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
      APPEND l_event TO lt_events.
      CALL METHOD tree1->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
    set Handler
      DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
      CREATE OBJECT l_event_receiver.
      SET HANDLER l_event_receiver->on_add_hierarchy_node
                                                            FOR tree1.
    ENDFORM.                               " register_events
    *&      Form  build_header
          build table for header
    FORM build_comment USING
          pt_list_commentary TYPE slis_t_listheader
          p_logo             TYPE sdydo_value.
      DATA: ls_line TYPE slis_listheader.
    LIST HEADING LINE: TYPE H
      CLEAR ls_line.
      ls_line-typ  = 'H'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      ls_line-info = 'ALV TREE DEMO for ****************'.
      APPEND ls_line TO pt_list_commentary.
      p_logo = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "build_comment
    *&      Form  init_tree
    Building the ALV-Tree for the first time display
    FORM init_tree.
      PERFORM build_fieldcatalog.
      PERFORM build_outtab.
      PERFORM build_sort_table.
    create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c,
            l_custom_container TYPE REF TO cl_gui_custom_container.
      l_tree_container_name = 'TREE1'.
      CREATE OBJECT l_custom_container
          EXPORTING
                container_name = l_tree_container_name
          EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
    create tree control
      CREATE OBJECT tree1
        EXPORTING
            i_parent              = l_custom_container
            i_node_selection_mode =
                                  cl_gui_column_tree=>node_sel_mode_multiple
            i_item_selection      = 'X'
            i_no_html_header      = ''
            i_no_toolbar          = ''
        EXCEPTIONS
            cntl_error                   = 1
            cntl_system_error            = 2
            create_error                 = 3
            lifetime_error               = 4
            illegal_node_selection_mode  = 5
            failed                       = 6
            illegal_column_name          = 7.
    create info-table for html-header
      DATA: lt_list_commentary TYPE slis_t_listheader,
            l_logo             TYPE sdydo_value.
      PERFORM build_comment USING
                     lt_list_commentary
                     l_logo.
    repid for saving variants
      DATA: ls_variant TYPE disvariant.
      ls_variant-report = sy-repid.
    register events
      PERFORM register_events.
    create hierarchy
      CALL METHOD tree1->set_table_for_first_display
        EXPORTING
          it_list_commentary = lt_list_commentary
          i_logo             = l_logo
          i_background_id    = 'ALV_BACKGROUND'
          i_save             = 'A'
          is_variant         = ls_variant
        CHANGING
          it_sort            = gt_sort
          it_outtab          = gt_sflight
          it_fieldcatalog    = gt_fieldcatalog.
    expand first level
      CALL METHOD tree1->expand_tree
        EXPORTING
          i_level = 1.
    optimize column-width
      CALL METHOD tree1->column_optimize
        EXPORTING
          i_start_column = tree1->c_hierarchy_column_name
          i_end_column   = tree1->c_hierarchy_column_name.
    ENDFORM.                    " init_tree
    Good Luck and thanks
    AK

  • How to find number of columns used in a ALV variant

    I need to know how many column is active ( will be shown in the ALV report ) related to a specific ALV Variant.
    Example :
    The structure of my internal table has 147 columns.
    The user in a specific ALV variant has chosen 25 columns of those 147 colums, so I need to know that this ALV variant will show 25 columns.
    Thanks!   Jo  

    Hi Max,
    Thanks for hints.
    Finnally I did the verification at the beginning of my process.
    Because I need the information before getting the data, so I called the METHOD with a "dummy" table,
    and I received the info of what I need, the number of column related to a specific ALV Variant.
    I used :
      ls_variant-report    = sy-repid.
      ls_variant-variant   = p_alvvar.   "<<<  Select-option field for AVL Variant
      ls_variant-log_group = 'L01'.
        CALL METHOD lo_grid1->set_table_for_first_display
          EXPORTING
            i_structure_name     = 'MY_STRUCTURE'
            is_variant          = ls_variant
            is_layout           = ls_layout
            i_save               = 'A'
            i_default            = 'X'
            I_BYPASSING_BUFFER   = 'X'
          CHANGING
            it_fieldcatalog     = LT_FIELDCATALOG
            it_outtab            = lt_dummy[].      
        CALL METHOD lo_grid1->GET_FRONTEND_FIELDCATALOG
          IMPORTING
            ET_FIELDCATALOG =  LT_FIELDCATALOG.
      loop at LT_FIELDCATALOG into ls_FIELDCATALOG where no_out = space.
              add 1 to LV_NB_COLUMNS.
      endloop.
    Jo  

  • Regarding ALV variant...

    Hi...
    How to use variants in ALV?
    Please tell me step by step,how to implent variants in ALV?
    Regards
    Sandeep.

    hi sandeep,
    Variants are used to save the data and retrieve the same when required. This is an option used in ALV.
    SAP provides standard interfaces for initializing and retrieving the display variant information. This includes three function modules and four subroutines.
    1. REUSE_ALV_VARIANT_DEFAULT_GET.
    This FM is used to get the default variant for the report if it has been set.
    EXPORTING
    I_SAVE : Controls the storage mode. Allowed values are :
    ‘A‘ : Standard and user specific variants
    ‘U’ : User specific variants
    ‘X’ : Standard Variants
    CHANGING
    CS_VARIANT : Gets the default variant in a structure like DISVARIANT.
    2. REUSE_ALV_VARIANT_F4
    This FM is used to get the possible values of the variants on the selection screen.
    EXPORTING
    IS_VARIANT : Structure of this parameter is like DISVARIANT. Pass the program name through this.
    I_SAVE : Controls type of variant to be displayed in value help. Allowed values are
    ‘A‘ Standard and user specific variants
    ‘U’ User specific variants
    ‘X’ Standard Variants
    IMPORTING
    E_EXIT : If this parameter is blank then user has selected some variant.
    ES_VARIANT :
    Selected variant is populated in this work area. It’s of structure like DISVARIANT.
    3.REUSE_ALV_VARIANT_EXISTENCE
    This FM is used to check existence of a
    display variant.
    EXPORTING
    I_SAVE : Type of variant. Allowed values are
    ‘A‘ Standard and user specific variants
    ‘U’ User specific variants
    ‘X’ Standard Variants
    CHANGING
    CS_VARIANT : Pass on variant details. The structure of this field is like DISVARIANT.
    &#61607; DATA AREAS TO BE DECLARED FOR VARIANTS :
    Data, which will be, used by the standard function modules in ALV for variants. A sample data deceleration is as mentioned below.
    DATA: WS_X_VARIANT LIKE DISVARIANT,
    WS_VARIANT LIKE DISVARIANT,
    WS_SAVE TYPE C,
    WS_EXIT TYPE C,
    WS_REPID LIKE SY-REPID.
    REUSE_ALV_VARIANT_DEFAULT_GET
    Text
    Read default layout (description only, w/o field catalog)
    Functionality
    Provides the default variant for the list specified in the structure
    parameter CS_VARIANT of a program.
    REUSE_ALV_VARIANT_F4
    Text
    Display variant selection dialog box
    Functionality
    Possible entries help, if the variant is defined explicitly as an input
    field on a screen. The selection must be specified by at least partially
    filling the parameter structure IS_VARIANT.
    REUSE_ALV_VARIANT_EXISTENCE
    Text
    Checks whether a display variant exists
    CS_VARIENTS holds the information about varients like:
    ABAP Program Name
    Mgt. ID for repeated calls from the same program
    Logical group name
    User name for user-specific storage
    Layout
    Description for layout
    Dependent variant entry vector
    Functionality
    This function module checks the existence in the database of a display
    variant passed in the interface.
    check this example in the below link
    http://www.sap-img.com/abap/use-simple-alv-functions-to-make-reporting-easy.htm
    **if useful don't forget to reward with points...**

  • Apply ALV variant before export file in background task

    Hi all,
    I'm working on an ALV report.
    As my report should deal with a great amount of data, it's sometimes running in background.
    Users want the result to be sent by mail (in .CSV format so that they can use it in excel).
    For now, the sending is OK but the file contains all fields of the internal table (no specific filter, no sort...).
    How can i apply ALV variant (i.e keeping some of the fields, filter the list an so on) to the internal table before i build the file ?
    Thanks

    Salut Jérôme,
    un vieux (très vieux) code que j'avais fait.
    le but était d'envoyer par email le résultat d'un ALV grid.
    il t'en manque une partie, mais le principal est dedans
    *   Procédure P_GEN_HTML.                                              *
    *   Génération d'un email en HTML.                                     *
    form p_gen_html.
    data : struct_zgre000_s2 type zgre000_s2 ,
            v_es_layout       type lvc_s_layo ,
            v_e_var_save(1) ,
            v_e_var_def(1) ,
            m_calculate_totals(1) value 'X' ,
            itab_mt_data      type lvc_t_data ,
            itab_mt_info      type lvc_t_info ,
            itab_mt_sort      type lvc_t_sort ,
            itab_mt_filter    type lvc_t_filt ,
            itab_mt_filter_i  type lvc_t_fidx ,
            itab_html         type swl_html_t ,
            m_cl_variant      type ref to cl_alv_variant ,
            mt_outtab         type ref to data ,
            object_hd_change  like sood1 occurs 0 with header line,
            objpara           like selc  occurs 0 with header line,
            receivers         like zbc_receivers occurs 0 with header line ,
            ms_total_options      type lvc_s_toto,
            mt_grouplevels_filter type lvc_t_grpl ,
            m_sumlevel            type i ,
            itab_lt_grouplevels type kkblo_t_grouplevels ,
            itab_lt_sort        type kkblo_t_sortinfo.
      field-symbols: <lt_ct00> type standard table,
                     <lt_ct01> type standard table,
                     <lt_ct02> type standard table,
                     <lt_ct03> type standard table,
                     <lt_ct04> type standard table,
                     <lt_ct05> type standard table,
                     <lt_ct06> type standard table,
                     <lt_ct07> type standard table,
                     <lt_ct08> type standard table,
                     <lt_ct09> type standard table.
    * Ref the field-symbols.
      data mt_ct00 type ref to data .
      data mt_ct01 type ref to data .
      data mt_ct02 type ref to data .
      data mt_ct03 type ref to data .
      data mt_ct04 type ref to data .
      data mt_ct05 type ref to data .
      data mt_ct06 type ref to data .
      data mt_ct07 type ref to data .
      data mt_ct08 type ref to data .
      data mt_ct09 type ref to data .
      v_gjahr1 = p_gjahr + 1.
      v_gjahr2 = p_gjahr + 2.
      v_gjahr3 = p_gjahr + 3.
    * Alimente la table ITAB_ZGRE000_S2.
      loop at itab_otp_grid.
        move : itab_otp_grid-astnr to struct_zgre000_s2-zdemandeur ,
               itab_otp_grid-astna to struct_zgre000_s2-zdemandeurt ,
               itab_otp_grid-pspn  to struct_zgre000_s2-zprojet ,
               itab_otp_grid-pspn2 to struct_zgre000_s2-zotp ,
               itab_otp_grid-post1 to struct_zgre000_s2-zdesotp ,
               itab_otp_grid-pspnr to struct_zgre000_s2-zotp2 ,
               itab_otp_grid-stat  to struct_zgre000_s2-zstatut ,
               itab_otp_grid-usr02 to struct_zgre000_s2-zoneutil ,
               itab_otp_grid-budgt to struct_zgre000_s2-zbudgettotal ,
               itab_otp_grid-engag to struct_zgre000_s2-zengagtotal ,
               itab_otp_grid-dispo to struct_zgre000_s2-zdispototal ,
               itab_otp_grid-depen to struct_zgre000_s2-zdepentotal ,
               itab_otp_grid-budgn to struct_zgre000_s2-zbudget ,
               itab_otp_grid-le    to struct_zgre000_s2-zlatest ,
               itab_otp_grid-depea to struct_zgre000_s2-zdepense ,
               itab_otp_grid-pourc to struct_zgre000_s2-zpourcen ,
               itab_otp_grid-budg1 to struct_zgre000_s2-zbudget1 ,
               itab_otp_grid-budg2 to struct_zgre000_s2-zbudget2 ,
               itab_otp_grid-budg3 to struct_zgre000_s2-zbudget3 ,
               itab_otp_grid-natur to struct_zgre000_s2-znature.
        append struct_zgre000_s2 to itab_zgre000_s2.
      endloop.
      refresh itab_fieldcatalog.
    * Alimentation de la table ITAB_FIELDCATALOG.
      call function 'LVC_FIELDCATALOG_MERGE'
           exporting
                i_structure_name   = 'ZGRE000_S2'
                i_bypassing_buffer = ' '
                i_buffer_active    = ' '
           changing
                ct_fieldcat      = itab_fieldcatalog.
    * Les modifications des colonnes.
      loop at itab_fieldcatalog into tmp_fieldcatalog.
        case tmp_fieldcatalog-fieldname.
          when 'ZDEMANDEUR'.
            move : ' '            to tmp_fieldcatalog-do_sum ,
                   'Demandeur'    to tmp_fieldcatalog-scrtext_s ,
                   'Demandeur'    to tmp_fieldcatalog-scrtext_m ,
                   'Demandeur'    to tmp_fieldcatalog-scrtext_l ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '10'           to tmp_fieldcatalog-outputlen .
          when 'ZDEMANDEURT'.
            move : ' '            to tmp_fieldcatalog-do_sum ,
                   'Demandeur'    to tmp_fieldcatalog-scrtext_s ,
                   'Demandeur'    to tmp_fieldcatalog-scrtext_m ,
                   'Demandeur'    to tmp_fieldcatalog-scrtext_l ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '30'           to tmp_fieldcatalog-outputlen .
          when 'ZPROJET'.
            move : ' '            to tmp_fieldcatalog-do_sum ,
                   'Projet'       to tmp_fieldcatalog-scrtext_s ,
                   'Projet'       to tmp_fieldcatalog-scrtext_m ,
                   'Projet'       to tmp_fieldcatalog-scrtext_l ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '10'           to tmp_fieldcatalog-outputlen .
          when 'ZOTP'.
            move : ' '            to tmp_fieldcatalog-do_sum ,
                   'OTP'          to tmp_fieldcatalog-scrtext_s ,
                   'OTP'          to tmp_fieldcatalog-scrtext_m ,
                   'OTP'          to tmp_fieldcatalog-scrtext_l ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
          when 'ZDESOTP'.
            move : ' '            to tmp_fieldcatalog-do_sum ,
                   'Libellé OTP'  to tmp_fieldcatalog-scrtext_s ,
                   'Libellé OTP'  to tmp_fieldcatalog-scrtext_m ,
                   'Libellé OTP'  to tmp_fieldcatalog-scrtext_l ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
          when 'ZOTP2'.
            move : ' '            to tmp_fieldcatalog-do_sum ,
                   'OTP niveau 2' to tmp_fieldcatalog-scrtext_s ,
                   'OTP niveau 2' to tmp_fieldcatalog-scrtext_m ,
                   'OTP niveau 2' to tmp_fieldcatalog-scrtext_l ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
          when 'ZSTATUT'.
            move : ' '            to tmp_fieldcatalog-do_sum ,
                   'Statut'       to tmp_fieldcatalog-scrtext_s ,
                   'Statut'       to tmp_fieldcatalog-scrtext_m ,
                   'Statut'       to tmp_fieldcatalog-scrtext_l ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '10'           to tmp_fieldcatalog-outputlen .
          when 'ZONEUTIL'.
            move : ' '            to tmp_fieldcatalog-do_sum ,
                   'Zone util'    to tmp_fieldcatalog-scrtext_s ,
                   'Zone util'    to tmp_fieldcatalog-scrtext_m ,
                   'Zone util'    to tmp_fieldcatalog-scrtext_l ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '10'           to tmp_fieldcatalog-outputlen .
          when 'ZNATURE'.
            move : ' '            to tmp_fieldcatalog-do_sum ,
                   'Nature'       to tmp_fieldcatalog-scrtext_s ,
                   'Nature'       to tmp_fieldcatalog-scrtext_m ,
                   'Nature'       to tmp_fieldcatalog-scrtext_l ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '10'           to tmp_fieldcatalog-outputlen .
          when 'ZBUDGETTOTAL'.
            move : 'X'            to tmp_fieldcatalog-do_sum ,
                   'Bud. total'   to tmp_fieldcatalog-scrtext_s ,
                   'Budget total' to tmp_fieldcatalog-scrtext_l ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
          when 'ZENGAGTOTAL'.
            move : 'X'            to tmp_fieldcatalog-do_sum ,
                   'Eng. total'   to tmp_fieldcatalog-scrtext_s ,
                   'Engagement total' to tmp_fieldcatalog-scrtext_l ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
          when 'ZDISPOTOTAL'.
            move : 'X'            to tmp_fieldcatalog-do_sum ,
                   'Disp total'  to tmp_fieldcatalog-scrtext_s ,
                   'Disponible total' to tmp_fieldcatalog-scrtext_l ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
          when 'ZDEPENTOTAL'.
            move : 'X'            to tmp_fieldcatalog-do_sum ,
                   'Dep. total'   to tmp_fieldcatalog-scrtext_s ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
            concatenate 'Depenses totales'
                        p_perio
                        p_gjahr
                        into tmp_fieldcatalog-scrtext_l.
          when 'ZBUDGET'.
            move : 'X'            to tmp_fieldcatalog-do_sum ,
                    v_zero        to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
            concatenate 'Bud '
                        p_gjahr
                        into tmp_fieldcatalog-scrtext_s
                        separated by ' '.
            concatenate 'Budget Exercice:'
                        p_gjahr
                        'Version:'
                        p_vers1
                        into tmp_fieldcatalog-scrtext_l
                        separated by ' '.
          when 'ZLATEST'.
            move : 'X'            to tmp_fieldcatalog-do_sum ,
                   'Latest'       to tmp_fieldcatalog-scrtext_s ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
            concatenate 'Latest Exercice:'
                        p_gjahr
                        'Version:'
                        p_vers2
                        into tmp_fieldcatalog-scrtext_l
                        separated by ' '.
          when 'ZDEPENSE'.
            move : 'X'            to tmp_fieldcatalog-do_sum ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
            concatenate 'Dep'
                        p_gjahr
                        into tmp_fieldcatalog-scrtext_s
                        separated by ' '.
            concatenate 'Depense Exercice:'
                        p_gjahr
                        into tmp_fieldcatalog-scrtext_l
                        separated by ' '.
          when 'ZPOURCEN'.
            move : ' '            to tmp_fieldcatalog-do_sum ,
                   '% Dep/LE'     to tmp_fieldcatalog-scrtext_s ,
                   'Pourcentage dépense VS LE'
                                  to tmp_fieldcatalog-scrtext_l ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
          when 'ZBUDGET1'.
            move : 'X'            to tmp_fieldcatalog-do_sum ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
            concatenate 'Bud'
                        v_gjahr1
                        into tmp_fieldcatalog-scrtext_s
                        separated by ' '.
            concatenate 'Budget Exercice:'
                        v_gjahr1
                        into tmp_fieldcatalog-scrtext_l
                        separated by ' '.
          when 'ZBUDGET2'.
            move : 'X'            to tmp_fieldcatalog-do_sum ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
            concatenate 'Bud'
                        v_gjahr2
                        into tmp_fieldcatalog-scrtext_s
                        separated by ' '.
            concatenate 'Budget Exercice:'
                        v_gjahr2
                        into tmp_fieldcatalog-scrtext_l
                        separated by ' '.
          when 'ZBUDGET3'.
            move : 'X'            to tmp_fieldcatalog-do_sum ,
                   v_zero         to tmp_fieldcatalog-no_zero ,
                   '20'           to tmp_fieldcatalog-outputlen .
            concatenate 'Bud'
                        v_gjahr3
                        into tmp_fieldcatalog-scrtext_s
                        separated by ' '.
            concatenate 'Budget Exercice:'
                        v_gjahr3
                        into tmp_fieldcatalog-scrtext_l
                        separated by ' '.
        endcase.
        move 'X' to tmp_fieldcatalog-tech_comp.
        modify itab_fieldcatalog from tmp_fieldcatalog.
      endloop.
      call function 'WS_DOWNLOAD'
        EXPORTING
          FILENAME                      =
    '\RNEMS0025BU_girodf1$Desktopit_field.txt'
          FILETYPE                      = 'DAT'
        tables
          data_tab                      = itab_fieldcatalog.
      data : begin of it_tmp_data occurs 1000 ,
               buff(136) ,
               zbudgetttotal(20) ,
               zengagtotal(20) ,
               zdispottotal(20) ,
               zdepentotal(20) ,
               zbudget(20) ,
               zlatest(20) ,
               zdepense(20) ,
               zpourcen(20) ,
               zbudget1(20) ,
               zbudget2(20) ,
               zbudget3(20) ,
               waers(5) ,
             end   of it_tmp_data.
    break girodf1.
      loop at itab_zgre000_s2 into struct_zgre000_s2.
        move struct_zgre000_s2+0(136) to it_tmp_data-buff .
        move-corresponding struct_zgre000_s2 to it_tmp_data.
        append it_tmp_data.
      endloop.
      call function 'DOWNLOAD'
        EXPORTING
    *     BIN_FILESIZE                  = ' '
    *     CODEPAGE                      = ' '
          FILENAME                      =
    '\RNEMS0025BU_girodf1$Desktopit_data.txt'
          FILETYPE                      = 'DAT'
    *     ITEM                          = ' '
    *     MODE                          = ' '
    *     WK1_N_FORMAT                  = ' '
    *     WK1_N_SIZE                    = ' '
    *     WK1_T_FORMAT                  = ' '
    *     WK1_T_SIZE                    = ' '
    *     FILEMASK_MASK                 = ' '
    *     FILEMASK_TEXT                 = ' '
    *     FILETYPE_NO_CHANGE            = ' '
    *     FILEMASK_ALL                  = ' '
    *     FILETYPE_NO_SHOW              = ' '
          SILENT                        = 'S'
    *     COL_SELECT                    = ' '
    *     COL_SELECTMASK                = ' '
    *     NO_AUTH_CHECK                 = ' '
    *   IMPORTING
    *     ACT_FILENAME                  =
    *     ACT_FILETYPE                  =
    *     FILESIZE                      =
    *     CANCEL                        =
        tables
          data_tab                      = it_tmp_data.
    *  call function 'DOWNLOAD'
    *    EXPORTING
    *      FILENAME                      =
    *'\RNEMS0025BU_girodf1$Desktopit_data.txt'
    *      FILETYPE                      = 'ASC'
    *    tables
    *      data_tab                      = itab_zgre000_s2.
    * Complete.
      call function 'LVC_FIELDCATALOG_MERGE'
           exporting
                i_structure_name   = 'ZGRE000_S2'
                i_bypassing_buffer = ' '
                i_buffer_active    = ' '
           changing
                ct_fieldcat      = itab_fieldcatalog.
      call function 'LVC_FIELDCAT_COMPLETE'
        EXPORTING
    *     I_COMPLETE             =
          IS_LAYOUT              = v_es_layout
          I_REFRESH_BUFFER       = ''
          I_BUFFER_ACTIVE        = ''
    *   IMPORTING
    *     E_EDIT                 =
        changing
          ct_fieldcat            = itab_fieldcatalog.
      call function 'LVC_SORT_COMPLETE'
        exporting
          it_fieldcat       = itab_fieldcatalog
        changing
          ct_sort           = itab_mt_sort.
      call function 'ALV_DATA_EXPORT'
        exporting
          i_report                = ''
          IT_FIELDCAT             = itab_fieldcatalog
        tables
          it_data                 = itab_zgre000_s2.
    * Recherche de la variante d'affichage.
      move : sy-repid to struct_variant-report ,
             sy-uname to struct_variant-username ,
             '2'      to struct_variant-handle.
      if p_vgrid ne space.
        move p_vgrid to struct_variant-variant.
      endif.
    * Ne pas demander d'explication, merci :)
      get reference of itab_zgre000_s2 into mt_outtab.
    * Créé l'objet variant.
      create object m_cl_variant
             exporting
               it_outtab             = mt_outtab
               it_fieldcatalog       = itab_fieldcatalog
               it_sort               = itab_mt_sort
               it_filter             = itab_mt_filter
               is_variant            = struct_variant
               is_layout             = v_es_layout
               i_variant_save        = v_e_var_save
               i_variant_default     = v_e_var_def.
      move : 'A' to v_e_var_save ,
             'X' to v_e_var_def .
      call method m_cl_variant->set_values
           exporting it_outtab             = mt_outtab
                     it_fieldcatalog       = itab_fieldcatalog
                     it_sort               = itab_mt_sort
                     it_filter             = itab_mt_filter
                     is_variant            = struct_variant
                     is_layout             = v_es_layout
                     i_variant_save        = v_e_var_save
                     i_variant_default     = v_e_var_def.
       loop at itab_fieldcatalog into tmp_fieldcatalog
            where tabname ne space.
         exit.
       endloop.
    * Recherche de la variante.
      call method m_cl_variant->load_variant
           exporting i_tabname          = tmp_fieldcatalog-tabname
                     i_bypassing_buffer = 'X'
                    i_dialog           = space.
      create data  mt_ct00 like itab_zgre000_s2.
      create data  mt_ct01 like itab_zgre000_s2.
      create data  mt_ct02 like itab_zgre000_s2.
      create data  mt_ct03 like itab_zgre000_s2.
      create data  mt_ct04 like itab_zgre000_s2.
      create data  mt_ct05 like itab_zgre000_s2.
      create data  mt_ct06 like itab_zgre000_s2.
      create data  mt_ct07 like itab_zgre000_s2.
      create data  mt_ct08 like itab_zgre000_s2.
      create data  mt_ct09 like itab_zgre000_s2.
      assign mt_ct00->* to <lt_ct00>.
      assign mt_ct01->* to <lt_ct01>.
      assign mt_ct02->* to <lt_ct02>.
      assign mt_ct03->* to <lt_ct03>.
      assign mt_ct04->* to <lt_ct04>.
      assign mt_ct05->* to <lt_ct05>.
      assign mt_ct06->* to <lt_ct06>.
      assign mt_ct07->* to <lt_ct07>.
      assign mt_ct08->* to <lt_ct08>.
      assign mt_ct09->* to <lt_ct09>.
    * Recherche des valeurs à partir de la variante sélectionnée.
      call method m_cl_variant->get_values
           importing es_variant     = struct_variant
             et_fieldcatalog        = itab_fieldcatalog
             et_sort                = itab_mt_sort
             et_filter              = itab_mt_filter
             es_layout              = v_es_layout
             et_grouplevels_filter  = mt_grouplevels_filter
             e_variant_save         = v_e_var_save
             e_variant_default      = v_e_var_def.
      call function 'LVC_SORT_APPLY'
        exporting
          it_sort         = itab_mt_sort
    *     I_AS_TEXT       = 'X'
    *     I_STABLE        = 'X'
        tables
          ct_data         = itab_zgre000_s2.
      call function 'LVC_TRANSFER_TO_KKBLO'
        exporting
          it_sort_lvc                     = itab_mt_sort
          it_grouplevels_lvc              = mt_grouplevels_filter
        importing
          et_sort_kkblo                   = itab_lt_sort
          et_grouplevels_kkblo            = itab_lt_grouplevels
        exceptions
          it_data_missing                 = 1
          it_fieldcat_lvc_missing         = 2
          others                          = 3.
      call function 'ALV_GROUPLEVELS_GET'
        exporting
          i_subtotals_only          = 'X'
          it_sort                   = itab_lt_sort
          i_subtract_counter        = 'X'
        importing
          et_groups                 = itab_lt_grouplevels
        tables
          t_outtab                  = itab_zgre000_s2.
      call function 'LVC_TRANSFER_FROM_KKBLO'
        exporting
          it_grouplevels_kkblo            = itab_lt_grouplevels
        importing
          et_grouplevels_lvc              = mt_grouplevels_filter
        exceptions
          it_data_missing                 = 1
          others                          = 2.
    * Recupération des totaux.
      call function 'LVC_TOTALS_GET'
        exporting
          it_sort                  = itab_mt_sort
          is_layout                = v_es_layout
          it_filter_index          = itab_mt_filter_i
        tables
          it_data                  = itab_zgre000_s2
          et_collect00             = <lt_ct00>
          et_collect01             = <lt_ct01>
          et_collect02             = <lt_ct02>
          et_collect03             = <lt_ct03>
          et_collect04             = <lt_ct04>
          et_collect05             = <lt_ct05>
          et_collect06             = <lt_ct06>
          et_collect07             = <lt_ct07>
          et_collect08             = <lt_ct08>
          et_collect09             = <lt_ct09>
        changing
          cs_total_options         = ms_total_options
    *      ct_fieldcat              = mt_fieldcatalog
          ct_fieldcat              = itab_fieldcatalog
          ct_grouplevels           = mt_grouplevels_filter
          c_calculate_totals       = m_calculate_totals
          c_sumlevel               = m_sumlevel .
    * Converti dans un language comprehensible par SAP.
      call function 'LVC_TABLE_FOR_DISPLAY'
        exporting
          it_fieldcat                    = itab_fieldcatalog
          it_sort                        = itab_mt_sort
          it_filter                      = itab_mt_filter
          is_total_options               = ms_total_options
          is_layout                      = v_es_layout
        importing
          et_lvc_data                    = itab_mt_data
          et_lvc_info                    = itab_mt_info
        tables
          it_data                        = itab_zgre000_s2
          it_collect00                   = <lt_ct00>
          it_collect01                   = <lt_ct01>
          it_collect02                   = <lt_ct02>
          it_collect03                   = <lt_ct03>
          it_collect04                   = <lt_ct04>
          it_collect05                   = <lt_ct05>
          it_collect06                   = <lt_ct06>
          it_collect07                   = <lt_ct07>
          it_collect08                   = <lt_ct08>
          it_collect09                   = <lt_ct09>
        changing
          ct_grouplevels                 = mt_grouplevels_filter
        exceptions
          fieldcat_not_complete          = 1
          others                         = 2.
      if sy-subrc ne space.
        write : /1 'Probleme de convertion.'.
        stop.
      endif.
    * Convertie en HTML.
      call function 'LVC_ALV_CONVERT_TO_HTML'
        exporting
          it_data                       = itab_mt_data
          it_info                       = itab_mt_info
          i_file_dialog                 = ' '
        importing
          et_html                       = itab_html.
    * Envois par email.
      move : 'HTM'  to object_hd_change-file_ext ,
             'Liste des commandes passées sur Immobilisation via PM'
                    to object_hd_change-objdes.
      append object_hd_change.
      call function 'WS_DOWNLOAD'
        EXPORTING
          FILENAME                      =
    '\RNEMS0025BU_girodf1$Desktopmt_data.txt'
          FILETYPE                      = 'DAT'
        tables
          data_tab                      = itab_mt_data.
      call function 'WS_DOWNLOAD'
        EXPORTING
          FILENAME                      =
    '\RNEMS0025BU_girodf1$Desktopmt_info.txt'
          FILETYPE                      = 'DAT'
        tables
          data_tab                      = itab_mt_info.
      data : it_var type table of disvariant with header line.
      move-corresponding struct_variant to it_var.
      append it_var.
      call function 'WS_DOWNLOAD'
        EXPORTING
          FILENAME                      =
    '\RNEMS0025BU_girodf1$Desktopit_var.txt'
          FILETYPE                      = 'DAT'
        tables
          data_tab                      = it_var.
    *stop.
    * Liste des personnes à qui on envoye le email.
      select bname
             into receivers-uname
             from usr02
             where bname in s_uname.
        append receivers.
      endselect.
    * Send mail.
      call function 'Z_BC_ENVOI_EMAIL'
           exporting
               object_hd_change           = object_hd_change
               object_type                = 'RAW'
               owner                      = sy-uname
           tables
               objcont                    = itab_html
               receivers                  = receivers
           exceptions
               others                     = 01.
    endform.                     " P_GEN_HTML.

  • ALV Variant chosen in grid

    Hi.
    I have to following issue.
    I have a program that through the use of additional buttons I added to my ALV grid can jump between different ALV grids.
    The problem I'm having is that when you change the variant for ALV grid1 while viewing it and than change to grid 2, when you go back to grid1 the selected variant isn't used anymore.
    So what I need is a way see check which variant is active when I get to the USER_COMMAND function of the ALV grid.
    If someone has the answer to this I'd be very happy.
    Regards,
    Arthur

    A. Parisius,
    Do the following step so that you cant loose variant u set when u come to primary alv from secondary ALV.
    1.
    When you export I_SAVE = 'X' or 'A'  through REUSE_ALV_GEID_DISPLAY, you can save variant on ALV output.you can save different variants for one output.
    2.
    Define one parameter to select variant on selection-screen itself instead of selecting on Output.
    parameters :p_layout like disvariant-variant.
    3.
    F4 help to get variants set for the report.
    at selection-screen on value-request for p_layout.
      perform get_variant.
    subroutine code and define w_variant structure type disvariant.
    *&      Form  get_variant
    form get_variant.
      data: lw_variant type disvariant,
              l_exit     type char1.
      lw_variant-report = sy-repid.
      call function 'REUSE_ALV_VARIANT_F4'
           exporting
                is_variant = lw_variant
                i_save     = 'A'
           importing
                e_exit     = l_exit
                es_variant = lw_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.
        if l_exit eq space.
          p_layout = lw_variant-variant.
          if not p_layout is initial.
            perform get_w_variant.
          endif.
        endif.
      endif.
    endform.                    " get_variant
    *&      Form  get_w_variant
    form get_w_variant.
      w_variant-report      = sy-repid.
      w_variant-handle      = space.
      w_variant-log_group   = space.
      w_variant-username    = space.
      w_variant-variant     = p_layout.
      w_variant-text        = space.
      w_variant-dependvars  = space.
    endform.                    " get_w_variant
    4.
    Pass w_variant structure through REUSE_ALV_GRID_DISPLAY FM .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM      = 'ZVENKAT_TEST1' "Program name
        I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
        IT_FIELDCAT             = i_field
        IT_SORT                 = i_sort
        I_SAVE                  = 'X'
        IS_VARIANT              = w_variant "If you pass variant selected on selection-screen
                                            "on F4 help,corresponding output is displayed
      TABLES
        T_OUTTAB                = <i_tab>
      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.
    5.
    If you select variant and pass through FM it will be remained when u come back from secondary ALV..
    I hope that it helps u .
    Regards,
    Venkat.O

  • I have a 120gb Classic that has no space left on it. i am going to buy a larger gb capacity ipod as soon as i get clearer instruction on how to get the old ipod content to the new ipod. How do you get content from one ipod to the other?

    how do you get content from one ipod to the new one? my content is on an external hard drive not on my pc and i have run out of space on my 120gb classic. can you get old ipod content to new? my itunes has only got short cuts, the real content is on an external drive? can this be done?? please help

    If the content is on an external drive, but your library knows where to find it, then it should all work. Connect your device, make some selections for what to put on it, and sync. If, on the other hand, your current iPod is the only place holding some of your media then see this user tip: Recover your iTunes library from your iPod or iOS device.
    tt2

  • How do I get content from my iPad to show up on the tv screen using Apple TV without going thru iTunes?

    How can I get content from my iPad and my air book to show up on the tv screen using Apple TV, without going thru iTunes?

    You will need to use AirPlay to see that.
    Assuming both devices are on the same network and that AirPlay is not turned off on the Apple TV, then simply tap on the screen when you are watching content you wish to stream to your Apple TV, then tap the airplay icon that appears in the control bar, choose the Apple TV from the menu that appears.
    When displaying the content you wish to mirror on the iPad 2 (or better), iPad Mini, iPhone 4S (or better), double tap the home button (quickly) and swipe the bottom row of apps to the right to reveal the playback controls, tap the AirPlay icon and select your Apple TV from the list of available devices.

Maybe you are looking for