REUSE_ALV_GRID_LAYOUT_INFO_SET

Hello!
I use the FM 'REUSE_ALV_GRID_LAYOUT_INFO_SET' before i start the FM 'REUSE_ALV_GRID_DISPLAY'.
  CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
    EXPORTING
      is_layout      = gs_layout
      it_fieldcat    = int_fcat[]
      is_grid_scroll = gs_grid_scroll.
That brings me to error Nr. 1607
I want just set the column number for start to scroll.

You can only call the FM REUSE_ALV_GRID_LAYOUT_INFO_SET after you start the ALV processing.
So, if you want to use this FM, you can use the subroutine attached to the TOP-OF-PAGE event of the ALV.
Regards,
Naimesh Patel

Similar Messages

  • ' REUSE_ALV_GRID_LAYOUT_INFO_SET' problem (+)

    Hello,
    I'm using REUSE_ALV_GRID_LAYOUT_INFO_SET to change filter values in ALV grid, which is displayed using REUSE_ALV_GRID_DISPLAY. In spite of specifying all the values in table IT_FILTER, filter values do not change. If I try to change values manually, I've got error message 'Filter error ::: 15'. Does anyone have an example of using REUSE_ALV_GRID_LAYOUT_INFO_SET in this way?
          CLEAR filter_string.
          REFRESH it_filter.
          filter_string-fieldname = 'MATNR'.
          filter_string-tabname =  1 .
          filter_string-valuf = '*.*'.
          filter_string-valuf_int = '*.*'.
          filter_string-sign0 = 'I'.
          filter_string-optio = 'CP'.
          filter_string-decimals = 0.
          filter_string-intlen = 18.
          filter_string-inttype = 'C'.
          filter_string-order = 1.
          filter_string-ref_fieldname = 'MATNR'.
          APPEND filter_string TO it_filter.
          CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
            EXPORTING
              it_filter            = it_filter

      CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
          EXPORTING
    *          IS_LAYOUT      =
                IT_FIELDCAT    =  IT_FIELDCAT[].
    *          IT_SORT        =
               IT_FILTER      =   IT_FILTER[]
    *          IS_GRID_SCROLL =
    pass the fieldcat info also,
    Regards
    vijay

  • How to set ALV properties?

    Hi,
    I have some difficulties with an ALV grid report.
    The program is too difficult for using the alv refresh method then we use the submit method to the program.
    Using the submmit method users will lost their layout (filters,...). I found a FM REUSE_ALV_GRID_LAYOUT_INFO_GET which return all the properties of an ALV.
    All this informations are sent in memory using export to memory. The informations are well returned.
    I create the event END_OF_LIST in which I call the FM REUSE_ALV_GRID_LAYOUT_INFO_SET after importing the ALV properties. But no change on the ALV have been done... (no filter...)
    Must i use an other event or an other FM?
    Help!
    Thanks.
    END_OF_LIST:
       CLEAR    :  ws_layout,
                   wt_fieldcat,
                   wt_sort,
                   wt_filter,
                   ws_grid_scroll,
                   ws_variant,
                   wt_marked_columns,
                   wt_filtered_entries,
                   wt_fieldcat_backend,
                   ws_print.
       REFRESH  :  wt_fieldcat,
                   wt_sort,
                   wt_filter,
                   wt_marked_columns,
                   wt_filtered_entries,
                   wt_fieldcat_backend.
       IMPORT ws_layout = ws_layout FROM MEMORY ID 'ZLAYOUT'.
       CHECK sy-subrc EQ 0.
       IMPORT wt_fieldcat = wt_fieldcat FROM MEMORY ID 'ZFIELDCAT'.
         FROM MEMORY ID 'ZFILTERED_ENTRIES'.
       IMPORT wt_fieldcat_backend = wt_fieldcat_backend
         FROM MEMORY ID 'ZFIELDCAT_BACKEND'.
       CLEAR  gs_layout.
       gs_layout  =  ws_layout.
       CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
         EXPORTING
           is_layout      = gs_layout
           it_fieldcat    = wt_fieldcat
           it_sort        = wt_sort
           it_filter      = wt_filter
           is_grid_scroll = ws_grid_scroll
           is_print       = ws_print.

    Hi,
    the post you indicates to me is the good way to refresh an ALV but this not my case. We can not use the good way that is the problem.
    The way you put me in is not so wrong!
    I try to use an event with a sy-ucomm and refresh the ALV with the rs_selfield-refresh = 'X' and its worksssssssss.
    The the question now how to refresh an ALV by this way:
    EVENT sy-ucomm.
    form f_command_alv using fip_ucomm
                               fip_selfield type kkblo_selfield.
       case fip_ucomm.
         when 'ZREFRESH'.
           perform f_refresh.
         when 'TEST'.
           perform f_set_alv using rs_selfield.
       endcase.
    EVENT ENDOF_LIST:_
    form end_of_list.
        PERFORM f_set_alv.
    endform.                    "end_of_list
    The difficulty is how to set rs_selfield-refresh to X in the second case or another way to refresh!
    David31
    Edited by: David31 on Apr 3, 2009 11:33 AM

  • Going back to selection screen from Change mode in ALV.

    Hello Gurus,
    I am working on a issue related to ALV where ALV becomes editable when user clicks on change button.  The Change button is a custom button defined in application toolbar of ALV display.
    case ucomm.
    WHEN 'TBACK'.
         leave to screen 0.
    when 'CHNG'.
            loop at it_apst01.
                  WA_FIELD_LST-EDIT = 'X'.
    *             Then some field symbol stuff is there
                  MODIFY FIELD_LST from wa_field_lst transporting edit
                         where FIELDNAME = <FS5>.
                ENDIF.
              endif.
            endloop.
          ENDIF.
          describe table gt_alv lines c_hits.
          c_alv_hits = c_hits.
          concatenate text-010 c_alv_hits 'hits' into c_alv_title separated
          by space.
          perform display_report tables gt_alv USING c_alv_title.
    form display_report tables p_outtab using p_title.
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = lv_progname
                i_callback_pf_status_set = 'ALV_STATUS'
                i_callback_user_command  = 'ALV_UCOMM'
    *            i_callback_top_of_page   = 'TOP_OF_PAGE'
                is_layout                = is_layout
                it_fieldcat              = field_lst
    *            is_variant               = g_variant
                it_event_exit            = gt_event_exit
                i_save                   = 'A'
                it_sort                  = it_sort
                i_screen_start_column    = i_start_col
                i_screen_start_line      = i_start_ln
                i_screen_end_column      = i_end_col
                i_screen_end_line        = i_end_ln
           tables
                t_outtab                 = p_outtab
           exceptions
                program_error            = 1
                others                   = 2.
    endform.
    Everything is working ok. But when I click on Back button,the screen goes first to the ALV display mode from edit mode, then user has to click one time more the back button to go to selection screen because the FM 'REUSE_ALV_GRID_DISPLAY' is called once again when user clicks
    on change button because I am making the EDIT flag = 'X' and then calling FM again.
    Is there a way that when user clicks on Back button, he will directly go to Change Screen -> Selection screen instead of going to Change screen -> Display screen -> Selection screen
    Regards,
    Rajesh.

    You must not call the FM 'REUSE_ALV_GRID_DISPLAY' again to make it editable. Instead you can call the FM REUSE_ALV_GRID_LAYOUT_INFO_GET and REUSE_ALV_GRID_LAYOUT_INFO_SET to make your grid editable / non-editable.
    Like this:
    REPORT grid_edit.
    TYPE-POOLS: slis.
    * Data to be displayed
    DATA: gt_sflight TYPE TABLE OF sflight.
    DATA: gs_layout TYPE slis_layout_alv.
    parameters: p_test type flag.
    start-of-selection.
    * Selection
    SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_sflight.
    * Eingabebereit
    gs_layout-edit = 'X'.
    * Call ABAP List Viewer (ALV)
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program      = sy-cprog
        i_callback_user_command = 'USER_COMMAND'
        i_structure_name        = 'SFLIGHT'
        is_layout               = gs_layout
      TABLES
        t_outtab                = gt_sflight.
    *&      Form  user_command
    FORM user_command USING r_ucomm TYPE sy-ucomm
                            rs_selfield TYPE slis_selfield.
      DATA: ls_layout TYPE slis_layout_alv.
      IF r_ucomm = '&DATA_SAVE'.
        MESSAGE i000(0k) WITH text-001.
        CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
          IMPORTING
            es_layout = ls_layout.
        IF sy-subrc <> 0.
        ENDIF.
        ls_layout-edit = ' '.
        CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
          EXPORTING
            is_layout = ls_layout.
      ENDIF.
    ENDFORM.                    "user_command
    In this example, when you SAVE, it will give you one Information message and than make the Layout to non-editable mode. When you press back button, it will get you back to selection screen.
    Regards,
    Naimesh Patel

  • Layout changes removes the data

    HI,
    We copied a standard program RIAUFK20, the program shows the ALV output . We changed only the fieldcatalog. The problem is when the program shows the output first time it shows the correct data what we added to the standard one. When user changes the layout and the screen refreshes it wipes out the data that we added to the report. How can it be prevented from being removed?
    Thanks in advance

    Sanjane:
    You will also need to modify the layout sets saved for that report; the existing layouts will not take into account your changes to the field catalog & data.
    If using ALV grid (function group SLVC_FULLSCREEN) have a look at function modules REUSE_ALV_GRID_LAYOUT_INFO_GET & REUSE_ALV_GRID_LAYOUT_INFO_SET. If using ALV list (function group SALV) have a look at function modules REUSE_ALV_LIST_LAYOUT_INFO_GET & REUSE_ALV_LIST_LAYOUT_INFO_SET. For all of these function modules, click on "Function Module Documentation" button to see the on-line documentation. You can also find documentation on help.sap.com.
    Regards,
    D.

  • REUSE_ALV_GRID_DISPLAY IT_FIELDCAT change after I_CALLBACK_USER_COMMAND

    Hi. I changed the FIELDCAT after I_CALLBACK_USER_COMMAND, but the same fieldcat is displayed. The internal table can be changed, but not the FIELDCAT? I'm adding comments column after update... Can this be done?

    Use the FM REUSE_ALV_GRID_LAYOUT_INFO_SET to set your new Field Catalog. Use the FM REUSE_ALV_GRID_LAYOUT_INFO_GET to get the current Field Catalog information, change it as per the requirement and than use the FM REUSE_ALV_GRID_LAYOUT_INFO_SET to set the new field catalog back.
    Regards,
    Naimesh Patel

  • Reuse_alv_grid_display TITLE problem after refresh

    All,
    I have a alv report using fm reuse_alv_grid_display. While calling initially this fm i am passing the grid tile in I_GRID_TITLE parameter. its displaying in grid, then after user click on the app toolbar button , i am doing some filteration , then coming back to grid the TITLE is missing in display
    Any Info .  below is the code snipet
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program             = sy-repid
         i_callback_pf_status_set       = 'F_PF_STATUS_SET'
         i_callback_user_command        = gc_user_com
         i_grid_title                   = gv_gtitle "<< passing initially
    then in User_command i am filering some values on the basis of button clicked (Button placed in app toolbar)
    FORM f_user_command USING p_ucomm    LIKE sy-ucomm
                              p_selfield TYPE slis_selfield .
        WHEN '&EXP'.
          perform f_expand.
          p_selfield-refresh = 'X'.  "<<<----- refresh the grid
      code for f_expand
    form f_expand.
        CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'  " Getting current layout
          IMPORTING
            es_layout      = ls_layout
            et_filter      = lt_filter
            es_grid_scroll = ls_grid_scroll
            es_print       = ls_print
          EXCEPTIONS
            OTHERS         = 1.
    " Here doing some filteration. ie append some values to IT_FILTER table for enabling then filter
        perform f_set_fltr_val_exp using lt_filter[].
        ls_layout-colwidth_optimize = gc_x.
        read table gt_sfieldcat into gv_fieldcat
                          with key fieldname = 'REGIO'.
        if sy-subrc eq 0.
          gv_fieldcat-no_out = ' '.
          modify gt_sfieldcat from gv_fieldcat index sy-tabix.
        endif.
    * Set the grid title to include the parameters and the report type
      CONCATENATE text-027 p_bukrs text-028 p_perio
                  text-029 p_gjahr
             INTO gv_gtitle SEPARATED BY space.
        CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
          EXPORTING
            is_layout      = ls_layout
            it_fieldcat    = gt_sfieldcat
            it_sort        = gt_sort
            it_filter      = lt_filter
            is_grid_scroll = ls_grid_scroll
            is_print       = ls_print
          EXCEPTIONS
            OTHERS         = 0.
    endform.                    " F_expand

    Hi All,
    Thanks for your replies.  I have done all that has been said.  My problem is that when the user double clicks on the ALV without pressing the sort button in the ALV display, the index provided in the user-command subroutine is the same as the index of the record in the internal table.  But, when the user sorts dynamically when the ALV is displayed and then double clicks, the index of the record provided by ALV is different from the index of that record in the internal table.
    For example, when the ALV grid is shown a record is in the 1st row, and when the user double clicks now, the index of this record provided is 1 which is same as the index in the internal table.
    But, after the user sorts in the display, if this record moves to the 5th row, the index provided by ALV will become 5, but, actually the index in the internal table is still 1.
    Hope I have clarified my problem.
    Thanks,
    Sridhar

  • Reg: ALV Field catalog refresh

    Hello All,
    Initially I have to display an ALV grid. Upon a buttons click(User Command)  , an additional col should be displayed for which the field catalog of the ALV needs to be changed. Iam using FM ''REUSE_ALV_GRID_DISPLAY'.My question is , how cld v refresh filedcatalog ? To refresh the grid data , we use selfield-refresh = 'X'. Is there any thing some thing like that to refresh fieldcat or v have to build the fieldcat again?
    I have pasted part of code below:
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name   = sy-repid
          i_structure_name = 'TRIGS_IGT_WRKLIST'
        CHANGING
          ct_fieldcat      = c_tab_fieldcat_main.
      LOOP AT c_tab_fieldcat_main ASSIGNING <l_wa_fieldcat_main>.
        IF <l_wa_fieldcat_main>-fieldname = 'BUSTRANSCAT_TEXT' OR
        <l_wa_fieldcat_main>-fieldname = 'VALUATION_AREA' OR
        <l_wa_fieldcat_main>-fieldname = 'VALUATION_CLASS' OR
        <l_wa_fieldcat_main>-fieldname = 'COMPANY_CODE' OR
        <l_wa_fieldcat_main>-fieldname = 'PRODUCT_TYPE' OR
        <l_wa_fieldcat_main>-fieldname = 'SECURITY_ACCOUNT' OR
        <l_wa_fieldcat_main>-fieldname = 'SECURITY_ID' OR
        <l_wa_fieldcat_main>-fieldname = 'IGT_STATUS_TEXT' OR
        <l_wa_fieldcat_main>-fieldname = 'POSDATE' OR
        <l_wa_fieldcat_main>-fieldname = 'TRLDATE' OR
        <l_wa_fieldcat_main>-fieldname = 'COMPANY_ID' OR
        <l_wa_fieldcat_main>-fieldname = 'COUNTERPARTY' OR
        <l_wa_fieldcat_main>-fieldname = 'UNITS' OR
        <l_wa_fieldcat_main>-fieldname = 'POSITION_CURR' OR
        <l_wa_fieldcat_main>-fieldname = 'DEAL_NUMBER' OR
        <l_wa_fieldcat_main>-fieldname = 'POSITION_AMT' .
        ELSE.
          <l_wa_fieldcat_main>-no_out = 'X'.
        ENDIF.
    Assign postion
        IF <l_wa_fieldcat_main>-fieldname = 'BUSTRANSCAT_TEXT'.
          <l_wa_fieldcat_main>-col_pos   = 2.
          <l_wa_fieldcat_main>-ddictxt   = 'M'.
          <l_wa_fieldcat_main>-outputlen = '5'.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'COMPANY_CODE'.
          <l_wa_fieldcat_main>-col_pos  = 3.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'VALUATION_AREA'.
          <l_wa_fieldcat_main>-col_pos  = 4.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'PRODUCT_TYPE'.
          <l_wa_fieldcat_main>-col_pos  = 5.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'SECURITY_ID'.
          <l_wa_fieldcat_main>-col_pos  = 6.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'SECURITY_ACCOUNT'.
          <l_wa_fieldcat_main>-col_pos  = 7.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'DEAL_NUMBER'.
          <l_wa_fieldcat_main>-col_pos  = 8.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'IGT_STATUS_TEXT'.
          <l_wa_fieldcat_main>-col_pos  = 9.
          <l_wa_fieldcat_main>-ddictxt  = 'M'.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'POSDATE'.
          <l_wa_fieldcat_main>-col_pos  = 10.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'TRLDATE'.
          <l_wa_fieldcat_main>-col_pos  = 11.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'COMPANY_ID'.
          <l_wa_fieldcat_main>-col_pos  = 12.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'UNITS'.
          <l_wa_fieldcat_main>-col_pos  = 13.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'POSITION_AMT'.
          <l_wa_fieldcat_main>-col_pos  = 14.
        ENDIF.
      ENDLOOP.
      CASE sy-ucomm.
        WHEN 'MATCH'.
          READ TABLE c_tab_fieldcat_main ASSIGNING <l_wa_fieldcat_main>
            WITH KEY fieldname = 'MATCHED'.
          CHECK sy-subrc EQ 0.
          <l_wa_fieldcat_main>-col_pos  = 1.
          <l_wa_fieldcat_main>-seltext_s = 'Matched Pairs'.
          <l_wa_fieldcat_main>-seltext_m = 'Matched Pairs'.
          <l_wa_fieldcat_main>-seltext_l = 'Matched Pairs'.
          <l_wa_fieldcat_main>-no_out = ' '.
        WHEN 'REVERSAL'.
          READ TABLE c_tab_fieldcat_main ASSIGNING <l_wa_fieldcat_main>
            WITH KEY fieldname = 'ICON_REVERSAL'.
          CHECK sy-subrc EQ 0.
          <l_wa_fieldcat_main>-col_pos  = 1.
          <l_wa_fieldcat_main>-icon = 'X'.
          <l_wa_fieldcat_main>-outputlen = 3.
          <l_wa_fieldcat_main>-no_out  = ' '.
      ENDCASE.
    Thanks,
    Sri

    Hi
    U need to use the fm REUSE_ALV_GRID_LAYOUT_INFO_SET, here you can change the catalog table.
    Max

  • How to update/modify the ALV internal table once it is displayed

    Hi All,
    I have a alv grid report using fm reuse_alv_grid_dispaly. My requirement is to create sales order using bapi (up to here it is working fine) and once the SO is created update the function module tables field with the created sales order.
    Example:
    My alv grid display before creating SO:
    Customer Material    SalesOrder
    1000001  material1 
    My alv grid display after creating SO:
    Customer Material    SalesOrder
    1000001  material1  3025642
    How can I achieve this functionality. Because the field catalog is already displayed, how can I modify/update it by adding the sales order number to it. Experts, suggest me.
    Thanks.

    FORM callback_ucomm USING ucomm LIKE sy-ucomm
                                   selfield TYPE slis_selfield.
    CASE ucomm.
        WHEN 'CRE'.
    * Logic to create sales order here...
    * Show the Sales order column
        CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
          IMPORTING
            et_fieldcat   = gt_fieldcat
          EXCEPTIONS
            no_infos      = 1
            program_error = 2
            OTHERS        = 3.
        if sy-subrc eq 0.
          read table gt_fieldcat into gs_fieldcat with key fieldname = 'VBELN'.
          if sy-subrc eq 0.
            gs_fieldcat-no_out = space.
            gs_fieldcat-tech   = space.
            modify gt_fieldcat from gs_fieldcat index sy-tabix transporting no_out tech.
          endif.
          CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
            EXPORTING
              it_fieldcat          = gt_fieldcat[].
        endif.
    ENDFORM.

  • Save changes to field in ALV, 'GET_GLOBALS_FROM_SLVC_FULLSCR' not working

    Hi,
    I'm supposed to save the changes to an editable field in an ALV of an existing program.
    In the program they are displaying the ALV using
    CALL METHOD pcl_alvgrid_principal->set_table_for_first_display
    I searched the forum for a way to capture the changes to the field, and found a lot of people mentioning the function
    'GET_GLOBALS_FROM_SLVC_FULLSCR'.
    Now, I don't know if this function is supposed to work only with a list display or something, but when I try to implement this function in this program, the returning value of ref_grid is always initial...
    Does anyone know another solution?
    ThX!

    I haven't noticed that behaviour while using the FM GET_GLOBALS_FROM_SLVC_FULLSCR with the FM REUSE_ALV_GRID_DISPLAY.
    Instead of getting the ALV object and using it's method, you may try using the FM:
    REUSE_ALV_GRID_LAYOUT_INFO_GET - To get the required info from ALV
    REUSE_ALV_GRID_LAYOUT_INFO_SET - To set the necessary info to ALV.
    Regards,
    Naimesh Patel

Maybe you are looking for

  • Report- material document for allocation- adding transfers

    Hi! Can anyone help me in cretainmg this small report to use for adding transfers to allocation table please? Its a small report but somehow I am not reaching the target --new block Selection Screen: Material Document of Original Transfer Posting (10

  • RMAN tablespace point -in-time recovery

    Hi Experts, while recovering TSPITR, I have received this error... sql statement: alter database mount clone database RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ====

  • Console not seeing Media Centre when wired through...

    I have an issue that is causing no end of problems. My current wired network and wifi SSIDs BT Home Hub 2----- DHCP - Wifi 802.11g only {SSID}OLD   |             |   |           Sky HD Box (Wired)   |           XBOX360_1 (Wired)   | TP-Link WR1043N r

  • How to use keys(f1,f2 etc)

    hi experts , i have a senario . i want to do some logic,  based on keyboard keys ( like f1 , f2 etc )in our basic list . can u help me with some example ?. advance wishes , sumanth

  • Using applescript to open a folder with a keyboard shortcut

    hello - i have a rather simple question (probably). is there a way using applescript to create a keyboard command to open a folder? i.e. command shift a opens the applications folder and command shift u opens utilities. can i use applescript to desig