Alv layout problem ?

Hi everyone,
I generating 2 alv reports within a program.In the selection screen there are 2 radio buttons for different alv reports. First i selected the 1st radio button and executed the prog to get a alv report.Then i went to change layout and selected the required columns from the columns set and then saved the layout as the default layout.
Then I came back to the selection screen again.In the selection screen, in the parameter p_var there is default variant,so i cleared the parameter with no layout variant selected.then i selected the 2nd radio button and executed the program.Here the program is again taking the default layout (even though i cleared it in the selection screen )and generating the alv report according to that.But i don't want to use the default layout when i select the 2nd radio button,unless i select it from the variant list.How can i do that?
Any suggestions please?

Hi Hymavathi,
Thanks for the reply.Below is my code for the layout.If u can see any problem in the code please tell me the changes.Thank you.
PARAMETERS: P_VAR LIKE DISVARIANT-VARIANT.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VAR.
  PERFORM GET_VARIANT CHANGING P_VAR.               " ALV Layout
FORM GET_VARIANT CHANGING X_VAR.
  PERFORM F4_ALV_LAYOUT(PPIO_ENTRY) USING I_GRID-PROGRAM
                                 CHANGING X_VAR.
ENDFORM.
perform alv_display.
FORM ALV_DISPLAY.
  DATA: I_GRID-LAYOUT TYPE SLIS_LAYOUT_ALV.
  SORT I_HEADER BY PLNBEZ AUFNR.
Define layout.
  CLEAR I_GRID-LAYOUT.
  I_GRID-LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
Set up Variant
  I_GRID-VARIANT-VARIANT = P_VAR.     " Variant
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM             = I_GRID-PROGRAM
    IS_LAYOUT                      = I_GRID-LAYOUT
    IT_FIELDCAT                    = I_GRID-FIELDCAT
    I_SAVE                         = 'A'
    IS_VARIANT                     = I_GRID-VARIANT
  TABLES
     T_OUTTAB                      = I_HEADER
   EXCEPTIONS
    PROGRAM_ERROR                  = 1
    OTHERS                         = 2.
ALV Failed.
  IF SY-SUBRC <> 0.
    WRITE: / 'Failed with',SY-SUBRC.
  ENDIF.
ENDFORM.
PERFORM ALV_DISPLAY_2.
FORM ALV_DISPLAY_2.
  DATA: I_GRID-LAYOUT TYPE SLIS_LAYOUT_ALV.
  SORT I_HEADER BY PLNBEZ AUFNR.
Define layout.
  CLEAR I_GRID-LAYOUT.
  I_GRID-LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
Set up Variant
I_GRID-VARIANT-VARIANT = P_VAR.     " Variant
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM             = I_GRID-PROGRAM
    I_CALLBACK_PF_STATUS_SET       = I_GRID-PF_STATUS_SET
    I_CALLBACK_USER_COMMAND        = I_GRID-USER_COMMAND
    IS_LAYOUT                      = i_grid-layout
    IT_FIELDCAT                    = I_GRID-FIELDCAT
   I_SAVE                         = 'A'
   IS_VARIANT                     = I_GRID-VARIANT
   TABLES
     T_OUTTAB                      = I_HEADER
   EXCEPTIONS
    PROGRAM_ERROR                  = 1
    OTHERS                         = 2.
ALV Failed.
  IF SY-SUBRC <> 0.
    WRITE: / 'Failed with',SY-SUBRC.
  ENDIF.
ENDFORM.                    " ALV_DISPLAY_2

Similar Messages

  • WEBGUI:Alv Layout Problem

    Hi All,
    I am making changes to the ALV GRID and doing a save of the layout and then,I load the layout which I just saved.
    I am able to see the fields in the order of my choice as I have saved.
    This works perfectly in normal SAP GUI.
    Load the GRID.
    Click 'change layout' ->Save to a new layout ->Press 'Select Layout' ->Choose the newly Saved Layout ->Check if the GRID columns are as per the order in the LAYOUT.
    When I try doin the same in SAP WEBGUI,on the load of the newly changed layout it is the same old layout that I get to see loaded on the screen i.e. the columns do not appear in the order I want it to be.I wonder waht on earth is wrong with WEBGUI ALV GRID(if at all there is any)
    All the help in this world is welcome.
    Useful answers will be awarded for sure!
    Cheers,
    Jayant
    Edited by: Jayant on Jul 17, 2008 2:26 PM
    Edited by: Jayant on Jul 17, 2008 3:10 PM

    Hi Vinay,
    You see that it works perfectly fine in SAP GUI...normal GUI that you launch from SAP LOGON pad.
    But the problem arises only when we try to change the layout in  WEBGUI(ITS).i.e launches the same session on a WEB BROWSER.
    I may have to check if its a SAP error.....
    Its a ALV GRID in standard transaction SAP claims management screen..
    Thanks for the reply.
    Cheers,
    Jayant
    Edited by: Jayant on Jul 18, 2008 2:59 PM

  • Problem in exporting ALV Layout to excelsheet!!!

    Hi,
    I am facing a problem while trying to export an ALV layout to Excel sheet. While the values appear correctly, the order of the columns gets distorted. So the table in Excel appears with correct values but with columns in disarray. I have checked the settings of Excel (SECURITY LEVEL is Medium and TRUSTED SOURCES "Trust All Installed Add-Ins and Templates" and "Trust Access to Visual Basic Project" is checked.) and its doesn’t seem to be change anything.
    Any suggestions?

    Hi,
    Follow the below procedures to export data to excel.
    Normal ALV :
    Click on the local file option and select spreadsheet option from the radio button list and click on ok , file save window will open , select the correct directory path and give the file name , then ALV contents will be downloaded into Excel sheet.
    In OO ALV :
    click on the Export button in the ALV toolbar ->click on the spreadsheet , then information message window will open , select ok button , then you will get three options , click on the table option and press ok , data will be exported to Excel sheet , then save the excel data in specified directory.
    Regards
    Appana

  • Problem in ALV layout ...urgent

    Hi,
    I am using transction VL06C which displays the ALV list. The strucute used by standard program for ALV is LIPOV. There is one include available for customer fields LIPOVZ.
    I have inculded my Z structure to it and new field i added is shipmet number. Now i can see the shipment number in the layout of ALV list as hidden field. So I automatically got this field in my ALV list.
    Now today I added one more filed quantity to my Z structure. But I cant see that field in my Layout of ALV.
    When I debugg I can see the field is getting populated correctly in user exit. Also in Field catalog.
    But can not see in Layout when I am trying to change the ALV layout. I can see only Ship. Number
    Please suggest.

    Hi Vinit,
    I think you may have copied the fieldcatalog structure from your previous fields.
    Check whether this line has been added for the field.
    clear wa_fieldcat.
          wa_fieldcat-fieldname     = 'MTART'(060).
          wa_fieldcat-seltext_l     = 'Mat. Type '(024).
          wa_fieldcat-ddictxt       = c_long.     
    *     Hide the column
            *wa_fieldcat-no_out      =  c_x.*    
    append wa_fieldcat to i_fieldcat.
    . Sorry if iam wrong.

  • ALV layout variant missing in background job.

    hi guys,
    Having problem on getting the default ALV layout variant when run the job in backgorund. Please advise any correction needed in the following code.
    Thanks.
    *&  Include           Z_MM_KBR_AGSUBCONINV_MOD2                        *
    MODULE status_0100 OUTPUT.
      SET PF-STATUS '100'.
      SET TITLEBAR '100'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  display_data  OUTPUT
          text
    MODULE display_data OUTPUT.
    IF sy-batch IS INITIAL. "Foreground
      IF w_container IS INITIAL.
        IF cl_gui_alv_grid=>offline( ) IS INITIAL.
    *Creating the container
          CREATE OBJECT w_container
            EXPORTING
              container_name              = c_container
            EXCEPTIONS
              cntl_error                  = 1
              cntl_system_error           = 2
              create_error                = 3
              lifetime_error              = 4
              lifetime_dynpro_dynpro_link = 5
              OTHERS                      = 6.
          IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
        ENDIF.
    *Creating the ALV GRID
        CREATE OBJECT w_grid
          EXPORTING
            i_parent          = w_container
            i_appl_events     = c_check
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5.
        IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        else.
         exit.
        ENDIF.
      ELSE.
    *Creating the ALV GRID
        CREATE OBJECT w_grid
          EXPORTING
            i_parent          = go_dock_container
            i_appl_events     = c_check
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5.
        IF sy-subrc <> 0.
          WRITE:/ 'Error in grid'.
        ENDIF.
         CREATE OBJECT w_grid
          EXPORTING  i_parent = go_dock_container.
      ENDIF.
    *getting the variant option
        wa_variant-report     = sy-repid.
        wa_variant-username   = sy-uname.
        wa_layout-grid_title  = sy-title.
        wa_layout-cwidth_opt  = c_check.
        wa_layout-zebra       = c_check.
        wa_layout-no_f4       = c_check.
        wa_layout-sel_mode    = 'D'.
    *Excluding the unwanted buttons
         PERFORM exclude_toolbar_buttons.
    build field catalog.
        CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
          EXPORTING
            i_buffer_active        = c_check
            i_structure_name       = c_fcat_str
            i_bypassing_buffer     = c_check
          CHANGING
            ct_fieldcat            = t_fieldcat
          EXCEPTIONS
            inconsistent_interface = 1
            program_error          = 2
            OTHERS                 = 3.
        IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        loop at t_fieldcat into w_fieldcat.
         if w_fieldcat-FIELDNAME = 'AGING1'.
          W_FIELDCAT-NO_ZERO = 'X'.
          MODIFY t_fieldcat FROM W_FIELDCAT INDEX SY-TABIX.
         ENDIF.
        endloop.
    Generate sort critria
        PERFORM generate_sort.
    Create object of class lcl_event_receiver.
        CREATE OBJECT w_event.
    Handler for events.
       SET HANDLER w_event->handle_top_of_page       FOR w_grid.
       SET HANDLER w_event->handle_print_top_of_page FOR w_grid.
       SET HANDLER w_event->handle_print_end_of_list FOR w_grid.
        SET HANDLER w_event->handle_hotspot_click     FOR w_grid.
    *Displaying the alv
       IF NOT sy-batch IS INITIAL.
         PERFORM create_snp.
       ENDIF.
    t_data = i_final.
        CALL METHOD w_grid->set_table_for_first_display
          EXPORTING
            i_save                        = 'A'
            is_layout                     = wa_layout
            is_variant                    = wa_variant
          CHANGING
            it_outtab                     = t_data
            it_fieldcatalog               = t_fieldcat
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
        IF sy-subrc <> 0.
        ENDIF.
    ENDIF.
    ENDIF.
    ENDMODULE.                 " display_data  OUTPUT
    *&      Module  user_command_0100  INPUT
          text
    MODULE user_command_0100 INPUT.
      DATA: lt_rows TYPE lvc_t_row,
             w_rows TYPE lvc_s_row.
      CASE sy-ucomm.
        WHEN c_back.
          LEAVE TO SCREEN 0.
        WHEN c_exit.
          LEAVE TO SCREEN 0.
        WHEN c_cancel.
          LEAVE TO SCREEN 0.
       WHEN 'BILDET'.
         CALL METHOD w_grid->get_selected_rows
           IMPORTING
             et_index_rows = lt_rows.
         CALL METHOD cl_gui_cfw=>flush.
         IF sy-subrc EQ 0.
           READ TABLE lt_rows INTO w_rows INDEX 1.
           READ TABLE i_vbfa INTO w_vbfa INDEX w_rows-index.
           IF sy-subrc EQ 0.
             CLEAR i_zbw_br_nf4.
             LOOP AT i_zbw_br_nf3 INTO w_zbw_br_nf3 WHERE
                         refkey = w_vbfa-v_vbeln.
               APPEND w_zbw_br_nf3 TO i_zbw_br_nf4.
             ENDLOOP.
    call dialog screen and display new alv control
             CALL SCREEN 101 STARTING AT 10 5.
           ENDIF.
         ENDIF.
         WHEN 'NOTAF'.
         CALL METHOD w_grid->get_selected_rows
           IMPORTING
             et_index_rows = lt_rows.
         CALL METHOD cl_gui_cfw=>flush.
         IF sy-subrc EQ 0.
           READ TABLE lt_rows INTO w_rows INDEX 1.
           READ TABLE i_zbw_br_nf3 INTO w_zbw_br_nf3 INDEX w_rows-index.
           DATA docnum LIKE j_1bdydoc-docnum.
           docnum = w_zbw_br_nf3-docnum.
           SET PARAMETER ID 'JEF' FIELD docnum.
           CALL TRANSACTION 'J1B3N' AND SKIP FIRST SCREEN.
         ENDIF.
      ENDCASE.
      ENDMODULE.                 " user_command_0100  INPUT
    *&      Form  modify_col_name
          text
         -->P_<FCAT>  text
         -->P_TEXT_H01  text
    FORM modify_col_name  USING  pwa_fcat TYPE lvc_s_fcat
                                 value(pw_text) TYPE any.
      pwa_fcat-coltext   = pw_text.
      pwa_fcat-scrtext_l = pw_text.
      pwa_fcat-scrtext_m = pw_text.
      pwa_fcat-scrtext_s = pw_text.
    ENDFORM.                    " modify_col_name
          FORM display_hotspot                                          *
    FORM display_hotspot USING pw_row_id    TYPE lvc_s_row
                               pw_column_id TYPE lvc_s_col.
      FIELD-SYMBOLS <l_data> TYPE zbrforecast.
    READ TABLE t_br_nf_acum ASSIGNING <l_data> INDEX pw_row_id-index.
    CHECK sy-subrc = 0.
    IF pw_column_id = ' '.
    ENDIF.
    ENDFORM.                    "display_hotspot
    *&      Form  generate_sort
          Genereate Sort criteria
    FORM generate_sort.
    Local variables
    DATA: wal_sort TYPE lvc_s_sort,
           wl_pos   TYPE numc2.
    wl_pos = 01.
    sort ORDER
    wal_sort-spos      = wl_pos.
    wal_sort-fieldname = c_aufnr.
    wal_sort-up        = c_check.
    APPEND wal_sort TO t_sort.
    ENDFORM.                    "generate_sort
    *&      Form  f4_variant
          text
         <--PW_VARI  text
    FORM f4_variant CHANGING pw_vari TYPE disvariant-variant.
    wa_variant-report = sy-cprog.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant    = wa_variant
          i_save        = c_u
        IMPORTING
          es_variant    = wa_variant
        EXCEPTIONS
          not_found     = 1
          program_error = 2
          OTHERS        = 3.
      IF sy-subrc IS INITIAL.
        pw_vari = wa_variant-variant.
      ELSE.
        MESSAGE s208(00) WITH text-t04.
      ENDIF.
    ENDFORM.                    " f4_variant
    *&      Form  validate_layout
    *This subroutine is to validate the layout
    No parameters are passed to this subroutine
    FORM validate_layout.
    IF NOT p_layout IS INITIAL.
      Check Layout
       wa_variant-report   = sy-repid.
       wa_variant-username = sy-uname.
       wa_variant-variant  = p_layout.
       CALL FUNCTION 'LVC_VARIANT_EXISTENCE_CHECK'
         EXPORTING
           i_save     = c_u
         CHANGING
           cs_variant = wa_variant
         EXCEPTIONS
           OTHERS     = 01.
       IF NOT sy-subrc IS INITIAL.
         SET CURSOR FIELD 'P_LAYOUT'.
         MESSAGE s001(00) WITH text-t06 p_layout.
         STOP.
       ENDIF.
    ELSE.
      clear wa_variant.
    ENDIF.
    ENDFORM.                    " validate_layout
    *&      Form  validate_data
          text
    FORM validate_data .
    PERFORM validate_layout.
    ENDFORM.                    " validate_data

    Hi,
    Before the call to method set_table_for_first_display, populate
    wa_variant-report = sy-repid.
    Best regards,
    Prashant

  • How to send pdf or excel attachment as saved alv layout in email

    Hi Guru,
    I am developing a report in which, i am sending report as excel attachment after clicking a button on top of alv grid, and pdf attachment after clicking another button on top of alv grid. I am sending mail by two ways they are:
    1) I am populating my internal table value in separate internal table and converting that to string and sending email as excel attachment.
    2) And am converting report as spooljob, and using abapspool 2 pdf function module i am converting spool to pdf, after that am send that pdf as mail attachment.
    Now my requirement is i need to send email attachment as layout which is displayed in the alv screen, even i hide a column and  change the  layout  it is going with all the columns. What should i do for this problem.
    Regards,
    Rithika

    Hi,
    Check if the below steps will solve the problem.
    * Get the run time ALV layout (field catalog) using the below method.
         data: r_grid TYPE REF TO cl_gui_alv_grid.
         CALL METHOD r_grid->get_frontend_fieldcatalog
              IMPORTING
                   et_fieldcatalog = t_fcat.
    * Adjust the download table according to t_fcat.

  • Layout problem in PDF conversion

    Hi all,
    i am downloading spool data using the function module CONVERT_ABAPSPOOLJOB_2_PDF. But i am facing layout problem. e.g. RFBILA00(financial statement generation program) has written balancesheet data to the spool. This spool data has some 6 columns. but CONVERT_ABAPSPOOLJOB_2_PDF is writing only first 3 columns to the generated PDF file. i used 'GET_PRINT_PARAMETERS' function module also with values like layout as 'X_65_132' and 'X_90_120'. but no success. if anybody knows the answer, please let me know.
    Thanks in advance,
    Naveen

    Hi All,
    i am following the below approach to download the information from spool.
    program/spool output is an ALV List output data having 8 columns. but below approach is converting only first 5 columns in to PDF format. other 3 columns are getting truncated.
    FUNCTION /ngl/download_spoolinfo_as_pdf.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(I_SPOOL_REQUEST) LIKE  TSP01-RQIDENT
    *"     REFERENCE(I_FILENAME) LIKE  RLGRAP-FILENAME
    *"  EXCEPTIONS
    *"      DOWNLOAD_ERROR
      TABLES tsp01.
      DATA: mtab_pdf LIKE tline OCCURS 0 WITH HEADER LINE,
            mc_filename LIKE rlgrap-filename.
      DATA: mstr_print_parms LIKE pri_params,
            mc_valid(1) TYPE c,
            mi_bytecount TYPE i.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          copies                 = '1'
          cover_page             = space
          destination            = 'locl'
          expiration             = '1'
          immediately            = space
          mode                   = space
          new_list_id            = 'X'
          no_dialog              = 'X'
          user                   = sy-uname
          line_size              = 200
          line_count             = 65
         layout                 = 'X_65_200'
          layout                 = 'X_90_120'
          sap_cover_page         = 'X'
        IMPORTING
          out_parameters         = mstr_print_parms
          valid                  = mc_valid
        EXCEPTIONS
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          OTHERS                 = 4.
      IF sy-subrc EQ 0.
        CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
          EXPORTING
            src_spoolid              = i_spool_request
            no_dialog                = 'X'
            dst_device               = mstr_print_parms-pdest
          IMPORTING
            pdf_bytecount            = mi_bytecount
          TABLES
            pdf                      = mtab_pdf
          EXCEPTIONS
            err_no_abap_spooljob     = 1
            err_no_spooljob          = 2
            err_no_permission        = 3
            err_conv_not_possible    = 4
            err_bad_destdevice       = 5
            user_cancelled           = 6
            err_spoolerror           = 7
            err_temseerror           = 8
            err_btcjob_open_failed   = 9
            err_btcjob_submit_failed = 10
            err_btcjob_close_failed  = 11
            OTHERS                   = 12.
        IF sy-subrc EQ 0.
          mc_filename = i_filename.
          DATA: lv_filename TYPE string.
          lv_filename = i_filename.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              bin_filesize = mi_bytecount
              filename     = lv_filename
              filetype     = 'BIN'
            TABLES
              data_tab     = mtab_pdf
            EXCEPTIONS
              OTHERS       = 22.
          IF sy-subrc EQ 0.
            WRITE:/ mc_filename, 'CONVERTED TO PDF AND DOWNLOADED'.
          ELSE.
            WRITE:/ 'PROBLEM WITH DOWNLOAD'.
            RAISE download_error.
          ENDIF.
        ELSE.
          WRITE:/ 'PROBLEM WITH PDF CONVERSION'.
          RAISE download_error.
        ENDIF.
      ELSE.
        WRITE:/ 'PROBLEM GETTING PRINT PARAMETERS'.
        RAISE download_error.
      ENDIF.
    ENDFUNCTION.

  • Doubt in alv layout variant.

    hi experts,
    I have a requirement that my selection screen should have 'ALV LAYOUT' as one of my parameter. I am using PNPCE LDB , now my issue is I can get the layout option when f4 is press on the alv layout parameter but the respective layout is not displaying in my output.
    ex: I have  layout A and  B .
    A have only pernr and name
    b have only pernr and address
    my normal alv layout is  pernr name and address. if i choose A in my ALV LAYOUT parameter also its displaying in default layout alv same is happening for while am choosing B. I  not getting the alv output for respective layout I chosen.
    {code}
    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
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM GET_W_VARIANT .
       DATA: lw_variant TYPE disvariant.
       lw_variant-report      = sy-repid.
       lw_variant-handle      = space.
       lw_variant-log_group   = space.
       lw_variant-username    = space.
       lw_variant-variant     = p_layout.
       lw_variant-text        = space.
       lw_variant-dependvars  = space.
    ENDFORM.                    " GET_W_VARIANT
    *&      Form  ALV_DISPLAY
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM ALV_DISPLAY .
    *  DATA: l_table      TYPE REF TO cl_salv_table.
    *  TRY.
    *  CALL METHOD CL_SALV_TABLE=>FACTORY
    **    EXPORTING
    **      LIST_DISPLAY   = IF_SALV_C_BOOL_SAP=>FALSE
    **      R_CONTAINER    =
    **      CONTAINER_NAME =
    *    IMPORTING
    *      R_SALV_TABLE   =  L_TABLE
    *    CHANGING
    *      T_TABLE        = GT_ALV
    *   CATCH CX_SALV_MSG .
    *  ENDTRY.
    *   l_table->display( ).
       DATA: lw_variant TYPE disvariant.
    DATA:I_FIELD TYPE SLIS_T_FIELDCAT_ALV,
          iWA  TYPE SLIS_FIELDCAT_ALV.
       IWA-FIELDNAME = 'PERNR'.
       IWA-SELTEXT_L = 'EMPLOYEE ID'.
       APPEND IWA TO i_FIELD.
       IWA-FIELDNAME = 'NAME'.
       IWA-SELTEXT_L = 'NAME'.
       APPEND IWA TO I_FIELD.
       IWA-FIELDNAME = 'DEPT'.
       IWA-SELTEXT_L = 'DEPT'.
       APPEND IWA TO I_FIELD.
       IWA-FIELDNAME = 'UNION'.
       IWA-SELTEXT_L = 'UNION'.
       APPEND IWA TO I_FIELD.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
         i_callback_program      = 'ZTESTPRGFOR20' "Program name
         i_callback_user_command = 'USER_COMMAND'
         it_fieldcat             = i_field
    *    it_sort                 = i_sort
         i_save                  = 'X'
         is_variant              = Lw_variant
       TABLES
         t_outtab                 = GT_ALV                       
       EXCEPTIONS
         program_error           = 1
         OTHERS                  = 2.
    *IF sy-subrc  0.
    *  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    *ENDIF.
    ENDFORM.                    " ALV_DISPLAY
    {code}

    hi Mohammed Quddus,
    thanks for your reply . but if you look at my code the concept are same as same as that link code.
    am getting all the things right.
    i Can able to change the layout by the button on alv and
    able to save that new layout
    the saved layout are displaying in the my parameter if I press f4. the problem is if I choose the saved layout that layout is not coming in my alv output always its showing default layout.
    if anything you find wrong in my code please let me know.

  • ME57 transaction with possibility to show in ALV layout

    Hi experts,
    I need change the alv grid in  the transaction ME57. To this, I copied the program RM06BZ00 (scree, includes... )
    When I try execute the program with ALV layout the message ''Scope of list ALV not defined (please correct)" shows.
    To resolve this problem I change the parameter im_service in the ME_REP_GET_TABLE_MANAGER function (Way to function: program ZSAPFM06B / include ZFM06BF04 / Include ZFM06BF04_PRUEFEN_LSTUB)
    When I change this parameter on Debug (manual change) the ALV shows correctly, but when I change in program code the message remains.
    How the way to copy the Me57 transaction with possibility to show in ALV layout?
    Follows the code change:
        CALL FUNCTION 'ME_REP_GET_TABLE_MANAGER'
          EXPORTING
            im_service = 'RM06BZ00'
            im_scope   = l_scope
          IMPORTING
            ex_manager = gf_factory.
    Thank you!
    Edited by: Andréa Molina on Aug 4, 2011 5:12 PM
    Edited by: Rob Burbank on Aug 5, 2011 9:22 AM

    I solved my own problem...
    The change in im_service was right.
    The problem is that:
    The gf_factory back empty in some places and in standrad transaction back with values. The memory clean the gf_factory result.
    So... the only way to show ALV is fill the gf_factory in anywhere the gf_factory is check.
    The places are:
    1. sapfm06b - fm06bf04 - fm06bf04_pruefen_lstub
         Call in RM06BZ00 - perform pruefen_lstub(sapfm06b) using p_lstub.
    2. sapfm06b - fm06bfsl - fm06bfsl_ban_aufbauen
        Call in RM06BZ00 - ban_aufbauen(sapfm06b).
    3. sapfm06b - fm06bf01- fm06bf01_submit
       Call in RM06BZ00 - perform   perform submit(zgb_sapfm06b) using sucomm.
    If the gf_factory is filled in this places... The ALV will show!

  • Max_linesize - ALV LAYOUT

    What is the limit for the field max_linesize for the ALV layout?
    I need to print 300 fields, but its doing a short dump for memory on the Quality ambient.. in the development Ambient, it is showing normally.
    Someone knows what is this problem?

    That depends on printer. If you execute your report in background this will give you only 256 char.
    Well, if you want to print the 300 lines, you need to run the report in foreground and you have to choose the printer format X_65_512/2 or X_65_256/2. This will print in 2 pages.
    Press properties on printer to choose the format.

  • How to display long text in SAP Query ALV layout? It only show 129 char now

    I have a SAP Query which show a remark field(Max length more than 500 char), but it only show max length 129 char now. In fact, the lenght of remark field text is more than 300, and i had debug the source code, the field text value do is correct, its length do is 376.
    Do anybody can help me solve the issue, let the query ALV layout can show the long text field value?
    thanks very much in addvance.

    Hi,
    ALV can show only a restrict value length around 128 characters, many experts said that we can not extend. many suggestions is split text into some column.
    Regards,

  • Need to add Excel as option on SAP report view (currently only ALV layout)

    Some users currently have the option to view a report in either the standard ALV layout view or as Excel (example output - transaction VA05).  They also have the Excel icon on their toolbar.  Our issue is that not all users have this option in their GUI.  What do we need to do to add the Excel icon/view option to either their account or their GUI?

    Hello Ryan,
    The export option is coded into the application.
    Can you advise if all users are using the same application VA*?
    Do all users have the same Gui patch and version?

  • CSS Layout Problem?

    Can someone please help me with a layout problem.
    As far as I can tell the page looks as it should in Netscape,
    Firefox, etc., but IE6 and 7 refuse to work correctly.
    The page I am working on is:
    http://www.vmtampademo.com/localangler/testpage.html
    Most of the picture caption and headline of the middle column
    is behind the picture. I attempted to force the info with a
    seperating div which seems to work sometimes. I doubt that this is
    the correct solution. What am I doing wrong?
    Thank you for the help!

    It looks fine in Firefox 2.0.0.1, Opera 9.10, and IE 7.

  • Webdynpro ABAP -- ALV  Layout setting

    Dear all,
    In my development with ALV in Webdynpro ABAP, I want to save the ALV layout via Setting. but it seems that the layout only can be saved as user-specific, is it any possible to use it as the gobal one?
    Please kindly provide me some hints. Thanks in Advance.
    Best Regards,

    Hi,
    Yes you can make it global in administrative level.
    1.In SE80 ,Double click on the name of  your Web Dynpro Application .
    2.Select Web Dynpro Application  Menu .
    3.Select Test->-> Execute in Administrative Mode from the menu.
    Your application opens in administrative mode .
    Go to the ALV settings make the changes and save it as some variant.
    This layout will be default and global to all the users.
    Regards
    John Paul

  • Allowing a User to choose the ALV layout format on selection-screen

    Hi all,
    I would like to know how i can add a parameter to my selection-screen which would allow the User to choose a saved ALV layout format before pressing F8 rather than after. As used in CO15 or MB51.
    Thanks  femi.

    yes , You can check the program BCALV_TEST_FULLSCREEN_LAYOUT  to check how F4 help is to be used .
    to check existene of variant is pretty simple.
    Pass the variant name in the ALV display FM .

Maybe you are looking for

  • HT4527 How can I move my iTunes library to my new laptop?

    My old computer crashed, and all that's left of it is the hardrive. I didn't get to deactivate the iTunes account on the old pc, and I don't have a backup of the library.  All I have is my nano which has some songs from library, but not all.  Please

  • Ssl_error_no_cypher_overlap what does this mean?

    Cannot communicate with peer no common encryption algerithimth(s) Spelling maybe incorrect! error code ssl_error_no_cypher_overlap authenticity of received data could not be found I don't do technical and this is all foreign to me , no idea. Just try

  • Using two computers for development under one account

    Is it possible to add a 2nd machine to my account so i can get provisioning certificates for the 2nd machine? (iPhone 2.0 development)

  • How to use dbms_random in TimesTen

    Hi, All, dbms_random is the supplied procedure in TimesTen 11.2.1, but I failed with the following select statement: select dbms_random.value from dual; or select sys.dbms_random.value from dual the error I got is "1024: Referenced table DBMS_RANDOM

  • Issue with Creating Database

    When I right Click and make a new connection then on the new connection screen I write my Connection Name - Username - Password - save password and just change the SID to "orcl" , but when I click test I get this error: "Status: Failure - Test failed