ALV GRID Field Resizing

I am using REUSE_ALV_LIST_DISPLAY FM to display the Data in ALV Report here how can i use the Condnse or How to reduse the unwanted sapce in the data field.
my code is like this
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      i_callback_program      = v_repid
      i_callback_user_command = text-004               "'USER_COMMAND'
      is_layout               = t_layo
      i_default               = 'X'
      i_save                  = c_a
      it_fieldcat             = i_fcat[]
      it_events               = i_fevents[]
    TABLES
      t_outtab                = i_final[].

Hello Friend,
Its there in the layout paramater )
DATA: t_layo TYPE slis_layout_alv.
t_layo-colwidth_optimize = 'X'.
Hope this helps.
BR,
Suhas
Edited by: Suhas Saha on Mar 3, 2009 12:22 PM

Similar Messages

  • Make ALV GRID screen resizable

    Hi All,
    I have created an object V_MAPBOX using reference to class CL_GUI_DIALOGBOX_CONTAINER.
    CREATE OBJECT v_mapbox
          EXPORTING
            width = 300
            height = 130
            style = cl_gui_control=>ws_sysmenu
            repid = 'ZMAP'
            dynnr = '1000'
            top = v_top2
            left = v_left2
            caption = 'Mapping Information'
          EXCEPTIONS
            cntl_error = 1
            cntl_system_error = 2
            create_error = 3
            lifetime_error = 4
            lifetime_dynpro_dynpro_link = 5
            event_already_registered = 6
            error_regist_event = 7
            OTHERS = 8.
    Then created an object V_MAPALV with reference to class CL_GUI_ALV_GRID exporting V_MAPBOX.
    Finally I am calling the method SET_TABLE_FOR_FIRST_DISPLAY of CL_GUI_ALV_GRID to display the screen on my custom container of screen 1000.
        CALL METHOD v_mapalv->set_table_for_first_display
          EXPORTING
            i_save                        = 'A'
            is_layout                     = wa_layout
          CHANGING
            it_outtab                     = i_map
            it_fieldcatalog              = i_fieldcat_map
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
        IF sy-subrc <> 0.
        ENDIF.
    The screen is getting displayed as expected. But I require to make this ALV screen to be resizable while it is displayed.
    Have tried calling     CALL METHOD v_mapbox->resize, before calling the V_MAPALV methods but it does not work.
    Need to know how can I make this resizable.

    Hi,
    ABAP objects are used to implement the controls in programs.
    An SAP Container can contain other controls (for example, SAP ALV Grid Control, Tree Control, SAP Picture Control, SAP Splitter Control, and so on). It administers these controls logically in one collection and provides a physical area for the display.
    Every control exists in a container. Since containers are themselves controls, they can be nested within one another. The container becomes the parent of its control. SAP containers are divided into five groups:
    SAP custom container: Displays within an area defined in Screen Painter on screens or sub screens.
    Class: CL_GUI_CUSTOM_CONTAINER
    SAP dialog box container: Displays in a modeless dialog box or as a full screen. Class:
    CL_GUI_DIALOGBOX_CONTAINER
    SAP docking container: Displays as docked, resizable sub-window with the option of displaying it as a modeless dialog box. Class: CL_GUI_DOCKING_CONTAINER
    SAP splitter container: Displays and groups several controls in one area - that is, splits the area into cells Class: CL_GUI_SPLITTER_CONTAINER
    SAP easy splitter container: Displays controls in two cells, which the user can resize using a split bar. Class: CL_GUI_EASY_SPLITTER_CONTAINER.
    In the control, you can adjust the column width by dragging, or use the 'Optimum width' function to adjust the column width to the data currently displayed. You can also change the column sequence by selecting a column and dragging it to a new position.
    Thanks,
    Pradeep.

  • F4 help in ALV grid field

    Hello Experts,
    I am using cl_salv_table=>factory to display ALV grid.
    Now I also want to attach f4 help in one of the field of ALV grid.
    I am unable to locate any event or method.
    Please help.

    Hello,
    @Marcin: The aim to display values in search help is not to select values for editable field in alv grid but to display some additional information based on value in that field.
       If search help is not possible, then dropdown can also work for me or pls provide any other solution to this.
    I had tried implementing dropdown, for that I am using class "cl_salv_column_list" method "set_dropdown_entry".
    From this I am able to see dropdown icon for my field but not able to populate values in dropdown.
    Pls help in populating values in dropdown.
    My logic is:-
    Based on the values in the field in alv grid I have to calculate value dynamically to be displayed in search help or drop down list.

  • How to control edit checks on alv grid fields

    I have set up an alv grid that allows for user input. 
    The fields are defined from the data dictionary. 
    Edit checks are happening on all fields, but I would like to turn that off for some fields. 
    How is that controlled?
    Regards!

    u need to define ur own field catalog for this purpose, for the fields for which u want to set check box, add property like this
      X_FIELDCAT-FIELDNAME = 'LIFNR'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-SELTEXT_L  = 'VENDOR'.
      X_FIELDCAT-NO_ZERO    = 'X'.
      X_FIELDCAT-OUTPUTLEN  = 10.
      X_FIELDCAT-COL_POS    = 1.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
      X_FIELDCAT-FIELDNAME = 'BUKRS'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-CHECKBOX = 'X'.
      X_FIELDCAT-SELTEXT_L  = 'COMPANY'.
      X_FIELDCAT-NO_ZERO    = 'X'.
      X_FIELDCAT-OUTPUTLEN  = 4.
      X_FIELDCAT-COL_POS    = 2.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
        CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
          EXPORTING
            I_PROGRAM_NAME         = SY-REPID
            I_INTERNAL_TABNAME     = 'IT_FINAL'
            I_INCLNAME             = SY-REPID
          CHANGING
            CT_FIELDCAT            = IT_FIELDCAT
          EXCEPTIONS
            INCONSISTENT_INTERFACE = 1
            PROGRAM_ERROR          = 2
            OTHERS                 = 3.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            I_CALLBACK_PROGRAM = SY-REPID
            IS_LAYOUT          = L_LAYOUT
            IT_FIELDCAT        = IT_FIELDCAT
          TABLES
            T_OUTTAB           = IT_FINAL
          EXCEPTIONS
            PROGRAM_ERROR      = 1
            OTHERS             = 2.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    u can even check program BCALV_EDIT_05, award points if found helpful

  • ALV Grid Field catalog

    Hi,
         I am trying to display data from two different tables, say 3 fields from one table and 3 fields from other table. in alv grid format using classes and using method CALL METHOD go_grid->set_table_for_first_display
    how can we build the field catalog for the internal table which consists of 6 fields from two different tables
    thanks in advance

    Hello,
    Please check,it is similar case.
    FORM set_grid.
      IF g_r_grid IS INITIAL.
        CREATE OBJECT g_r_cont
                     EXPORTING container_name = 'CUST1'.
        CREATE OBJECT g_r_grid
                     EXPORTING i_parent = g_r_cont.
        g_r_variant = sy-repid.
      Build Field Catalog
        PERFORM build_field_catalog.
      Exclude process options from ALV
        PERFORM alv_excl.
      setting ALV Grid layout
        PERFORM alv_layo.
        CALL METHOD g_r_grid->set_table_for_first_display
           EXPORTING
             is_layout                     = g_r_layo
             is_variant                    = g_r_variant
             it_toolbar_excluding          = g_r_excl
             i_save                        = 'X'
           CHANGING
             it_outtab                     = g_t_alv[]
             it_fieldcatalog               = g_t_fieldcat.
      ENDIF.
    ENDFORM.                    " set_grid
    *Form Routine ID    : build_field_catalog
    *Form Routine Name  : TO Build Field Catalog
    *Outline            : Subroutine for building the field catalog
    *Argument           : None
    *Return Value       : None
    FORM build_field_catalog.
      DATA : l_f_n TYPE i.
      REFRESH g_t_fieldcat.
      l_f_n  = 0.
    Add properties values to ALV Catalog
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MATNR' 'CHAR' l_f_n
                                text-001 'X' space ' ' 18 ' '  .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'TXZ01' 'CHAR' l_f_n
                                text-002 'X' space 'X' 40 ' ' .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MFRPN' 'CHAR' l_f_n
                                text-003 ' ' space ' ' 40 ' ' .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EBELN' 'CHAR' l_f_n
                                 text-004 space space ' ' 10 ' ' .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EBELP' 'NUMC' l_f_n
                                 text-005 space space ' ' 5 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EINDT' 'DATS' l_f_n
                                 text-006 space space ' ' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MENGE' 'QUAN' l_f_n
                                 text-007 space space ' ' 13 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MEINS' 'UNIT' l_f_n
                                 text-008 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MENGE1' 'QUAN' l_f_n
                                 text-009 space space ' ' 13 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MEINS1' 'UNIT' l_f_n
                                 text-010 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'LIFNR' 'CHAR' l_f_n
                                 text-011 space space ' ' 10 'ALPHA'.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'NAME1' 'CHAR' l_f_n
                                 text-012 space space 'X' 35 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'BSART' 'CHAR' l_f_n
                                 text-013 space space ' ' 4 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'BEDAT' 'DATS' l_f_n
                                 text-014 space space ' ' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'AEDAT' 'DATS' l_f_n
                                 text-015 space space ' ' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'INSMK' 'CHAR' l_f_n
                                 text-016 space space ' ' 1 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'WERKS' 'CHAR' l_f_n
                                 text-017 space space ' ' 4 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'LGORT' 'CHAR' l_f_n
                                 text-018 space space ' ' 4 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EKGRP' 'CHAR' l_f_n
                                 text-019 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PSTYP' 'CHAR' l_f_n
                                 text-020 space space ' ' 1 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'LOEKZ' 'CHAR' l_f_n
                                 text-021 space space ' ' 1 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'DISPO' 'CHAR' l_f_n
                                 text-022 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PO_TEXT' 'CHAR' l_f_n
                                 text-023 space space 'X' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'BSGRU' 'CHAR' l_f_n
                                 text-024 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PRDHA1' 'CHAR' l_f_n
                                 text-025 space space ' ' 18 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'VTEXT1' 'CHAR' l_f_n
                                 text-026 space space 'X' 40 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PRDHA2' 'CHAR' l_f_n
                                 text-027 space space ' ' 18 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'VTEXT2' 'CHAR' l_f_n
                                 text-028 space space 'X' 40 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PRDHA3' 'CHAR' l_f_n
                                 text-029 space space ' ' 18 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'VTEXT3' 'CHAR' l_f_n
                                 text-030 space space 'X' 40 ' '.
    ENDFORM.                    " build_field_catalog
    *Form Routine ID    : add_catalog
    *Form Routine Name  : To Add the Catalog for the ALV
    *Outline            : Subroutine to add properties values to ALV Catalog
    *Argument           : p_fname        "Field Name
                        p_inttype      "Intenal Type
                        p_col_pos      "Column Position
                        p_coltext      "Column Text
                        p_key          "Key Field
                        p_hotspot      "Hotspot Enabled
                        p_outlen       "Internal Length
                        p_convexit     "conversion exit name
    *Return Value       : g_t_fieldcat   "Field Catalog Table
    FORM add_catalog USING   p_fname
                             p_inttype
                             p_col_pos
                             p_col_text
                             p_key
                             p_hotspot
                             p_lowercase
                             p_outlen
                             p_convexit.
      CLEAR g_r_fieldcat.
      g_r_fieldcat-fieldname = p_fname.
      g_r_fieldcat-inttype   = p_inttype.
      g_r_fieldcat-col_pos   = p_col_pos.
      g_r_fieldcat-coltext   = p_col_text.
      g_r_fieldcat-hotspot   = p_hotspot.
      g_r_fieldcat-lowercase = p_lowercase.
      g_r_fieldcat-outputlen = p_outlen.
      g_r_fieldcat-key       = p_key.
      g_r_fieldcat-convexit  = p_convexit.
      APPEND g_r_fieldcat TO g_t_fieldcat.
    ENDFORM.                    " add_catalog
    *Form Routine ID    : alv_excl
    *Form Routine Name  : ALV Exclude List
    *Outline            : Subroutine to exclude process options from ALV
    *Argument           : None
    *Return Value       : None
    FORM alv_excl.
      APPEND cl_gui_alv_grid=>mc_mb_sum          TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_mb_subtot       TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_fc_graph        TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_fc_info         TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_fc_print_back   TO g_r_excl.
    ENDFORM.                    " alv_excl
    *Form Routine ID    : alv_layo
    *Form Routine Name  : alv_layo
    *Outline            : Subroutine to set alv layout
    *Argument           : None
    *Return Value       : None
    FORM alv_layo.
      g_r_layo-grid_title = text-100.
      g_r_layo-cwidth_opt = g_c_mark.
      g_r_layo-zebra      = g_c_mark.
      g_r_layo-no_rowmark = space.
      g_r_layo-sel_mode   = g_c_selmode.
    ENDFORM.                 
    Regards

  • Help search in alv grid field

    Hello.
    How to assign a help search to a field of an alv grid control?
    I would like to use another help search different form the field reference.
    Thanks!!!
    Alberto

    Check the sample code:
        handle_on_f4             FOR EVENT onf4 OF cl_gui_alv_grid
                                 IMPORTING sender e_fieldname e_fieldvalue
                                           es_row_no er_event_data
                                           et_bad_cells e_display.
      METHOD handle_on_f4.
        IF e_fieldname = text-027. "Date
          PERFORM f4_date USING sender e_fieldname e_fieldvalue es_row_no
                                       er_event_data et_bad_cells e_display.
        ENDIF.
      ENDMETHOD.                    "handle_On_f4
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    *&      Form  F4_contact_id
          F4 for Contact ID
    FORM f4_date  USING    sender        TYPE REF TO cl_gui_alv_grid
                           e_fieldname   TYPE lvc_fname
                           e_fieldvalue  TYPE lvc_value
                           es_row_no     TYPE lvc_s_roid
                           er_event_data TYPE REF TO cl_alv_event_data
                           et_bad_cells  TYPE lvc_t_modi
                           e_display     TYPE c.
      DATA: lv_anlage TYPE anlage.
      FIELD-SYMBOLS: <itab> TYPE lvc_t_modi.
      DATA: ls_modi TYPE lvc_s_modi.
      DATA : wa_field_tab TYPE  dfies,
             lws_date TYPE scal-date.
      DATA: lws_row_id TYPE lvc_s_roid,
            lws_tabix TYPE sy-tabix.
      DATA: li_ret_tab LIKE  ddshretval OCCURS 0 WITH HEADER LINE.
      CLEAR: ls_modi, lv_anlage, li_ret_tab, wa_final, wa_field_tab,
             lws_date, lws_row_id, lws_tabix.
      REFRESH: li_ret_tab.
      IF NOT er_event_data->m_event_handled = c_x.
        ws_f4_handle = c_x.
        MOVE es_row_no-row_id TO lws_tabix.
        READ TABLE i_final INTO wa_final INDEX lws_tabix.
        CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
          EXPORTING
            tabname           = text-012              "I_FINAL
            fieldname         = text-027              "DATE
            searchhelp        = text-038              "BU_DATE_CHAR
          TABLES
            return_tab        = li_ret_tab
          EXCEPTIONS
            field_not_found   = 1
            no_help_for_field = 2
            inconsistent_help = 3
            no_values_found   = 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.
        ASSIGN er_event_data->m_data->* TO <itab>.
        CONCATENATE li_ret_tab-fieldval+6(4)
                    li_ret_tab-fieldval+3(2)
                    li_ret_tab-fieldval+0(2) INTO lws_date.
        IF lws_date NE ''.
          IF lws_date > sy-datum.
            IF wa_final-zzmod_eff_code EQ c_03 OR
               wa_final-zzmod_eff_code EQ c_04 OR
               wa_final-zzmod_eff_code EQ c_05.
              wa_final-date = lws_date.
              MODIFY i_final FROM wa_final INDEX lws_tabix.
              PERFORM no_edit_for_date TABLES i_final.
              PERFORM alv_refresh.
            ENDIF.
          ELSE.
            wa_final-date = ''.
            MODIFY i_final FROM wa_final INDEX lws_tabix.
            PERFORM no_edit_for_date TABLES i_final.
            PERFORM alv_refresh.
            MESSAGE s001(zesspa) WITH text-037.
            EXIT.
          ENDIF.
        ENDIF.
        er_event_data->m_event_handled = c_x.
      ENDIF.
    ENDFORM.                                                    " f4_date
    Check the standard program <b>BCALV_EDIT_08</b>
    Regards,
    Prakash.

  • ALV grid field editable/non editable at runtime

    Hi All,
    I am working on alv grid using containers. I have to make few cells in grid to editable and few othres to non editable which I did using styles by defining table type lvc_t_styl and updating my main internal table. Now once grid is displayed for first time (using set_table_for_first_display) it has required fields in editable and non editable as required. But now on triggering of data_changed event I have to change the editable cells to non editable and the non editable cells to editable. I tried doing this as same way as I have done before calling set_table_for_first_display method i.e. by  defining table of type lvc_t_styl in data_changed event and modifying my main internal table but this time the editable fields are changed to non editable and again becomes editable. Same problem with non editable cells also. They become editable and again becomes non ediatble of there own. Can anyone suggest any solution.
    <b>Note: Points awarded for helpful answers</b>
    null

    Hi,
    Check this link.I am explaining the steps for this.
    Kindly reward points by clicking the star on the left of reply,if it helps.<a href="https://wiki.sdn.sap.com/wiki/display/Snippets/ALV-Editingandsavingtheeditedvaluesin+Database(OOPS)">Editing OOPS ALV</a>

  • ALV Grid fields from editable to non-editable mode

    Hi,
    I am displaying my data through ALV Grid. In my grid the non-key fields are in editable mode.
    When I edit any of the editable fields and place the cursor on other field the field which I have edited should become disable(non-editable). Again if I want to edit the same field which is now in non-editable mode should again change to editable mode when the cursor is placed on it.
    Thanks & Regards,
    Adithya M.

    Hi Adithya,
    I am confused by your statement "place the cursor on other field the field which I have edited should become disable" -- are you stating that this is the requirement or what is currently happening with your program.  The way the edit fields should work by default is they are editable at all times unless you tell it otherwise. 
    If you are saying your requirement is to change the field to disabled once the field is edited (runtime change), first you want to handle the event on data changed then within your method of handling on data changed, you can disable the field from being edited by using cell styles and changing the value to disabled. 
    If you look at program BCALV_GRID_EDIT,
    You will find code where it disables the field for edit using Cell Style -- this will give you an idea how Cell Style controls editable fields and display fields:
            ls_cell-style  = cl_gui_alv_grid=>mc_style_enabled.
            ls_cell-maxlen = 4.
            ls_cell-fieldname = 'CARRNAME'.
            append ls_cell to gt_sflight-cell.
    This specific code will set the field disabled when the program is first exectued, in your case if you need to do this at run time, after someone edits the field, you need to implement handling the event on data changed, in the same program you will find:
    method handle_data_changed.                 
       perform data_changed using er_data_changed.
    endmethod.                     
    It is within this method that you can disable a field for editing.
    However, once it is disabled you will not get back into the handle_data_changed method.  I'm not sure I understand your statement "Again if I want to edit the same field which is now in non-editable mode should again change to editable mode when the cursor is placed on it."  Why would you want the user to be able to edit something, then show it disabled, then let them click on it and edit it again?  Why not just leave it in edit mode?  Maybe if I understand the requirement better, I can answer this portion of the question. 
    If this is based on security or changing from edit to display for the entire grid, you can run the same program mentioned above and click on the Change/Display button in the top left to see how it enables and disables the entire grid for editing.
    Cheers,
    Bonnie

  • F1 Documentation for ALV grid Field

    Hi All,
    I am working on ALV grid.I am able to dispaly the ALV grid.
    It is working perfectly.
    But client needs if i click on the 'F1' on field he needs the documentation of that field.
    I have field documentaion.But i am not able to display.
    Anybody please let me know how to make it.
    Thanks,
    Swapna.
    Edited by: tarangini katta on Mar 12, 2009 12:43 PM

    Hi,
    Refer:
    f1 help in alv grid
    Re: Display F1 help in ALV
    Hope this helps you.
    Regards,
    Tarun

  • New ALV Grid Field not Displaying?

    I revised a report to have a new column. So I added this new field to the code.
    I see the field and the value when I call
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    Bbut the field I added does not display.
    Thank-you.

    Hi,
    Please ensure that you added the related logic in the FIELD CATALOG of the ALV.
    Regards,
    Nirmal

  • Field filtering of FI-AA balance report by ALV grid

    Hi, Gurus,
    Here is very simple question for reporting program in FI-AA
    Symptoms likes below,
    Transaction : Impossible to filter " Asset class" field on several FI-AA standard reporting 
    Display option:  ALV GRID ,
    Field name : Asset class (ANLAV-ANLKL, Character)
    Length of field : 8
    Status : Asslet class criteria is already involved to their layout of report.
                 Indivisual asset list and each asset class is successfully displayed.
                 When set filter on asset class cuolumn, Possible entry list is displayed.
                But filnally after i determine value for filter asset class cretiera, result of execution is nothing to be displayed
    As you konw, several standard reporting program is services in Fi-AA
    For this reason , I guess this symptommay will be found on your coompany code
    If you have any good idea or solution for this , Just let me know
    I will appreciate your response in advance,
    Regard

    Try to write an * after the value of the class of the asset on the filter.
    Bye

  • Drop down list in ALV grid

    Dear Expert,
    I am new to OOPS ,
    I want to display drop down list for a particular field in my output, so I am using OOPS but in my below code
    I am facing problem in displaying the output as I am getting the error message
    Field catalog not found...
    Also advice me how to display drop down list in a particular field.
    Please advice
    MODULE pbo OUTPUT.
      SET PF-STATUS 'ZTEST'.
      IF g_custom_container IS INITIAL.
        DATA: lt_exclude TYPE ui_functions,
              lt_f4 TYPE lvc_t_f4 WITH HEADER LINE.
        CREATE OBJECT g_custom_container
          EXPORTING
            container_name = g_container.
        CREATE OBJECT g_grid
          EXPORTING
            i_parent = g_custom_container.
        PERFORM field_catalog TABLES it_lvc_t_fcat
           USING: 'S_FINAL' 'MATNR' ' ' 'Part Number' ' ' ' ',
                       'S_FINAL' 'MAKTX' ' ' 'Part Description' ' ' ' ',
                       'S_FINAL' 'MBLNR' ' ' 'Document No' ' ' ' ',
                       'S_FINAL' 'BLDAT' ' ' 'Document date' ' ' ' ',
                       'S_FINAL' 'LIFNR' ' ' 'Vendor Number' ' ' ' ',
                       'S_FINAL' 'STATUS' ' ' 'Acknowledgement' ' ' 'X',
                       'S_FINAL' 'REMARKS' ' ' 'Remarks' ' ' 'X'.
        CALL METHOD g_grid->set_table_for_first_display
           EXPORTING
    *    I_STRUCTURE_NAME              =
         is_layout                                =   it_lvc_s_layo
           CHANGING
             it_outtab                        =   i_final
         it_fieldcatalog                =   it_lvc_t_fcat
      ENDIF.
    ENDMODULE.                 " PBO  OUTPUT
    FORM field_catalog  TABLES t_field_catalog STRUCTURE wt_lvc_s_fcat
    USING fp_tabname TYPE any
    fp_fieldname TYPE any
    fp_key TYPE any
    fp_text TYPE any
    fp_do_sum TYPE any
    fp_edit TYPE any.
      t_field_catalog-tabname = fp_tabname.
      t_field_catalog-fieldname = fp_fieldname.
      t_field_catalog-key = fp_key.
      t_field_catalog-seltext = fp_text.
      t_field_catalog-do_sum = fp_do_sum .
      t_field_catalog-edit = fp_edit .
    ENDFORM.                    "field_catalog
    Edited by: Karthik R on Mar 15, 2010 6:11 PM

    Hi Karthik,
    Below mentioned  is a Simple code for creating dropdown lists for columns in ALV grid output
    REPORT z_alv_dropdown.
    *Type pools declarations for ALV
    TYPE-POOLS : slis.
    *data declarations for ALV container, ALV grid,  Field catalogues & layout
    DATA: g_grid  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          gt_fieldcat TYPE lvc_t_fcat,
          gs_layout TYPE lvc_s_layo.
    *INTERNAL TABLE AND WA DECLARATIONS FOR t517 A table
    DATA: gt_outtab TYPE STANDARD TABLE OF t517a INITIAL SIZE 0,
          wa_outtab TYPE t517a.
    *initialisation event
    INITIALIZATION.
    *Start of selection event
    START-OF-SELECTION.
    *Call to ALV
      CALL SCREEN 600.
    *On this statement double click  it takes you to the screen painter SE51.
    *Create a Custom container and name it CCONT and OK code as OK_CODE.
    *Save check and Activate the screen painter.
    *Now a normal screen with number 600 is created which holds the ALV grid.
    PBO of the actual screen , Here we can give a title and customized menus
    Here we also call the subroutine for ALV output.
          MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
    set pf-status 'xxx'.
    set titlebar 'MAIN100'.
    Subroutine to display the output in alv
      PERFORM alv_output.
    ENDMODULE.                    "pbo OUTPUT
    PAI module of the screen created. In case we use an interactive ALV or
    *for additional functionalities we can create OK codes and
    based on the user command we can do the coding.
          MODULE PAI INPUT                                              *
    MODULE pai INPUT.
    ENDMODULE.                    "pai INPUT
    *&      Form  BUILD_FIELDCAT
    FORM build_fieldcat.
      DATA ls_fcat TYPE lvc_s_fcat.
    *Build the field catalogue
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'T517A'
        CHANGING
          ct_fieldcat      = gt_fieldcat.
    To assign dropdown in the fieldcataogue
      LOOP AT gt_fieldcat INTO ls_fcat.
        CASE ls_fcat-fieldname.
          WHEN 'SLART'.
    *drdn-hndl = '1' is the first list box
            ls_fcat-drdn_hndl = '1'.
            ls_fcat-outputlen = 15.
            MODIFY gt_fieldcat FROM ls_fcat.
    *drdn-hndl = '2' is the second list box
          WHEN 'ABART'.
            ls_fcat-drdn_hndl = '2'.
            ls_fcat-outputlen = 15.
            MODIFY gt_fieldcat FROM ls_fcat.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    "build_fieldcat
    *&      Form  ALV_OUTPUT
    FORM alv_output .
    *Create object for container
      CREATE OBJECT g_custom_container
             EXPORTING container_name = 'CCONT'.
    *create object for grid
      CREATE OBJECT g_grid
             EXPORTING i_parent = g_custom_container.
    Build fieldcat and set column
    *Assign a handle for the dropdown listbox.
      PERFORM build_fieldcat.
    *Build layout
      PERFORM build_layout.
    Define a drop down table.
      PERFORM dropdown_table.
    *fetch values from the T517A table
      SELECT * FROM t517a INTO TABLE gt_outtab.
    *Display ALV output
      CALL METHOD g_grid->set_table_for_first_display
        EXPORTING
          is_layout       = gs_layout
        CHANGING
          it_fieldcatalog = gt_fieldcat
          it_outtab       = gt_outtab.
    ENDFORM.                               "ALV_OUTPUT
    *&      Form  dropdown_table
          text
    -->  p1        text
    <--  p2        text
    FORM dropdown_table.
    *Declarations for drop down lists in ALV.
      DATA: lt_dropdown TYPE lvc_t_drop,
            ls_dropdown TYPE lvc_s_drop.
    First SLART listbox (handle '1').
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '01 Pink'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '02 Yellow'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '03 Green'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '04 Black'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '05 White'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '06 Blue'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '09 Other Colors'.
      APPEND ls_dropdown TO lt_dropdown.
    *method to display the dropdown in ALV
      CALL METHOD g_grid->set_drop_down_table
        EXPORTING
          it_drop_down = lt_dropdown.
    ENDFORM.                               " dropdown_table
    *&      Form  build_layout
          text
    *layout for ALV output
    FORM build_layout .
      gs_layout-cwidth_opt = 'X'.
      gs_layout-grid_title = 'ALV DROPDOWN LISTS'.
      gs_layout-no_toolbar = 'X'.
    ENDFORM.                    " build_layout
    Hope it is helpful,
    Regards,
    Soundarya.

  • F4IF_INT_TABLE_VALUE_REQUEST + ALV Grid

    Hi All,
    I have a ALV grid with 2 fields.
    I implemented F4 for field1 using the FM below.
    I get a list of values as expected when i use 'F4', however the selected value is not written back to the ALV grid field!
    What am i missing here?
        call function 'F4IF_INT_TABLE_VALUE_REQUEST'
          exporting
            retfield        = lv_retfield_name
            value_org       = 'S'
          tables
            value_tab       = lt_f4tabletmodel
            field_tab       = lt_return_tab
          exceptions
            parameter_error = 1
            no_values_found = 2
            others          = 3.
    Note: the internal table lt_return_tab[], contains the value i selected, but i expect this to be written to the ALV grid field for which F4 was performed.
    Thanks in advance and Regards
    Dev

    *Method definition
          handle_on_f4
             for event onf4 of cl_gui_alv_grid
                 importing e_fieldname
                           E_FIELDVALUE "Importing  Type  LVC_VALUE
                           es_row_no
                           er_event_data
                           et_bad_cells
                           e_display.
    *Method implementation
      method handle_on_f4.
        type-pools sesi .
        data:   lt_f4tabletmodel  type table of str_classification_values,
                ls_f4tabletmodel  type str_classification_values,
                lt_return_tab     type table of ddshretval,
                ls_return_tab     type ddshretval,
                lv_retfield_name  type dfies-fieldname,
                lr_class_metadata type ref to cl_er_class_metadata,
                lt_class_systems  type stty_er_classification_system,
                wa_class_systems  type line of stty_er_classification_system,
                lv_class_system   type string.
        call method cl_er_class_metadata=>s_instance
          receiving
            r_instref = lr_class_metadata.
        if registry_name is initial.
          message i100(ws_tool). exit.
        endif.
    read from cache-DB
        try.
          call method lr_class_metadata->read_db_data
            exporting
              i_registry                   = registry_name
            importing
              e_tab_classification_systems = lt_class_systems.
        endtry.
        loop at lt_class_systems into wa_class_systems.
          clear ls_f4tabletmodel.clear lv_class_system.
          lv_class_system = wa_class_systems-tmodel_key.
          ls_f4tabletmodel-class_name = lv_class_system.
          append ls_f4tabletmodel to lt_f4tabletmodel.
        endloop.
        lv_retfield_name = 'CLASS_NAME'.
    f4-Popup
        call function 'F4IF_INT_TABLE_VALUE_REQUEST'
          exporting
            retfield        = lv_retfield_name
            value_org       = 'S'
          tables
            value_tab       = lt_f4tabletmodel
            return_tab      = lt_return_tab
          exceptions
            parameter_error = 1
            no_values_found = 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.
    get Value that has been chosen in F4-Help
        read table lt_return_tab into ls_return_tab index 1. "Always only one entry...
    If empty, nothing has been chosen on the F4-Help, so just return
        check ls_return_tab is not initial.
    change datatable, adding new F4 Data
        case e_fieldname.
          when 'CLASS_NAME'.
           <lf_f4_data>-class_VALUE = ls_return_tab-fieldval.
          when 'CLASS_VALUE'.
           <lf_f4_data>-class_VALUE = ls_return_tab-fieldval.
        endcase.
      endmethod.

  • Supressing Std. SAP functions in F1 hep documentation of ALV grid Control

    hello,
             Could anyone tel me how to suppress the std. sub-headings in F1 help documentation of ALV grid fields(OO)? Like, "Shorttext","Definition" appearing as
    sub-headings for short text & docu. declared in Data element of a field.
    Note : i ' ve declared Data element for fields thru ROLLNAME attribute of fieldcatalog.
    Thanks.
    -Swaminathan.

    hI
    I THINK IT MAY HELPFUL FOR YOU
    *& Report  ZAMIT_ALVOOPS
    REPORT  ZAMIT_ALVOOPS.
    tables: mara,spfli.
    types: begin of ty_tab,
            matnr type mara-matnr,
            ernam type mara-ernam,
            ersda type mara-ersda,
           end of ty_tab.
    DATA ITAB1 TYPE TABLE OF SPFLI.
    DATA WA1 LIKE LINE OF ITAB1.
    DATA IO1 TYPE SPFLI-CARRID VALUE 'AA'.
    data itab type table of ty_tab.
    data wa like line of itab.
    DATA OK_CODE TYPE SY-UCOMM.
    DATA: GRID TYPE REF TO CL_GUI_ALV_GRID,
          CONT TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    DATA: GRID1 TYPE REF TO CL_GUI_ALV_GRID,
          CONTA TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    CREATE OBJECT CONT EXPORTING CONTAINER_NAME = 'CONT1' .
    CREATE OBJECT GRID EXPORTING I_PARENT = CONT .
    CREATE OBJECT CONTA EXPORTING CONTAINER_NAME = 'CONT2' .
    CREATE OBJECT GRID1 EXPORTING I_PARENT = CONTA .
    selection-screen begin of block b1 with frame title text-100.
    select-options: s_matnr for mara-matnr.
    selection-screen end of block b1.
    select matnr ernam ersda from mara into corresponding fields of table itab up to 15 rows
    where matnr in s_matnr .
    call selection-screen 100.
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    if ok_code = 'PB1'.
    leave to screen 0.
    else.
    leave to screen 100.
    endif.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    SELECT * FROM SPFLI INTO
      CORRESPONDING FIELDS OF TABLE ITAB1 WHERE CARRID = IO1.
    CALL METHOD grid->SET_TABLE_FOR_FIRST_DISPLAY
      EXPORTING
       I_BUFFER_ACTIVE               =
       I_BYPASSING_BUFFER            =
       I_CONSISTENCY_CHECK           =
        I_STRUCTURE_NAME              = 'MARA'
       IS_VARIANT                    =
       I_SAVE                        =
       I_DEFAULT                     = 'X'
       IS_LAYOUT                     =
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
       IR_SALV_ADAPTER               =
      CHANGING
        IT_OUTTAB                     = itab.
       IT_FIELDCATALOG               =
       IT_SORT                       =
       IT_FILTER                     =
    EXCEPTIONS
       INVALID_PARAMETER_COMBINATION = 1
       PROGRAM_ERROR                 = 2
       TOO_MANY_LINES                = 3
       others                        = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
       CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          I_STRUCTURE_NAME = 'SPFLI'
        CHANGING
          IT_OUTTAB        = ITAB1.
    ENDMODULE.                 " STATUS_0100  OUTPUT

  • ALV Grid output

    Hi,
    I have one issue on ALV Grid output.
    Some times we will not have any values to display in ALV Grid output.
    In such cases we usually have to display 'No Data found' in report output message(Below report header).
    How to acheive this as all my ALV grid fields are of less length.
    Note: Message should be displayed below ALV Header (Where we usually get 1st record to be displayed).
    What is the solution for the same!
    Thanks,
    Deep.

    Hello Deep,
    You can try with,
    MESSATE 'Data not Found' TYPE 'I'.
    Bye
    Gabriel P.-

Maybe you are looking for

  • MPEG-2 Video Linear PCM Timecode no longer working in FCP7

    I edit daily with Final Cut Pro 7.0.3 on my MacBook Pro. I have several projects in which I imported files from an MR HD-100 hard drive. Not only did I successfully edit several projects, but I could open the individual files in QuickTime. They are 1

  • Itunes encounters a problem and needs to close

    This is the error I suddenly started getting today when I try to open itunes. Also, when I try to open quicktime or watch something in quicktime nothing happens (no error and it doesn't open). I feel this is a problem with quicktime since itunes need

  • Itunes not syncing apps to my ipod touch

    ok today is 11.11.11 and i updated my ipod touch to ios 5 my apps are gone so its ok i decided to redownload my apps to itunes which after that i wanted to sync my apps to my ipod touch but its not syncing at all i alrdy check the sync apps checkbox

  • 16:9 CCD

    I have a Panasonic PV-GS500 and it shoots in true 16:9 SD on miniDV, not anamorphic because it has a 16:9 CCD. Is there a setting or can I create one that will allow me to edit/export in true widescreen, not 4:3 with letterboxing? So far I can't find

  • Where Can i Buy a Mac Starter Disc???

    Someone said I need to Buy a starter Disc inorder to fix my computer. Where about whould I beable to buy one??