Reg: alv grid disp

Hi All,
        could you help me on this,  i want to put the DELETE AND RESTORE( if suppose i delete the one row by mistake ) buttons in my alv grid display. please give code for that it is usefull for me.
Thanks,
Naresh.

Hi mek,
you must activate the events to be caught, if your grid instance is mo_grid, then
mo_grid->register_edit_event( cl_gui_alv_grid=>mc_evt_enter ).
  mo_grid->register_edit_event( cl_gui_alv_grid=>mc_evt_modified ).
I always use a base class with handlers for most required events:
* register events
  SET HANDLER:
    grid_toolbar            FOR mo_grid,
    grid_f1                 FOR mo_grid,
    grid_f4                 FOR mo_grid,
    grid_data_changed       FOR mo_grid,
    grid_user_command       FOR mo_grid,
    grid_button_click       FOR mo_grid,
    grid_double_click       FOR mo_grid,
    grid_hotspot_click      FOR mo_grid,
    grid_menu_button        FOR mo_grid,
    grid_befor_user_command FOR mo_grid.
The edit functions all raise the data_changed event, here you can do what is necessary.
The rest is homework
Hapyy Coding!
Regards,
Clemens

Similar Messages

  • Reg : ALV Grid Refresh - Output not appearing

    Hi All ,
    Am calling a screen 100 at 3 different places.
    Though i use refresh_table_display , The value in the output table, say i_final changes, but while displaying the output , the whole screen is blank , even the container is not appearing in the output .
    Can you please help me with your inputs .
    Regards,
    Chitra

    yes it is good ...see the example...for your requirement..
    REPORT yztest .
    TYPE-POOLS: slis.
    Tables
    TABLES: mara.
    TYPES: BEGIN OF ty_name,
           name  TYPE char10,
           age   TYPE i,
           END OF ty_name.
    TYPES: BEGIN OF ty_marks,
           sub1   TYPE i,
           sub2   TYPE i,
           total  TYPE  i,
           END OF ty_marks.
    TYPES: BEGIN OF ty_phone,
           phnum TYPE char10,
           END  OF ty_phone.
    TYPES: BEGIN OF ty_addr,
           address TYPE char20,
           END  OF ty_addr .
    Output internal table
    DATA: itab TYPE TABLE OF ty_name,
          wa   TYPE ty_name,
          itab1 TYPE TABLE OF ty_marks,
          wa1  TYPE ty_marks,
          itab2 TYPE TABLE OF ty_phone,
          wa2  TYPE ty_phone,
          itab3 TYPE TABLE OF ty_addr,
          wa3  TYPE ty_addr.
    ALV Grid
    DATA: r_grid  TYPE REF TO cl_gui_alv_grid,
          r_grid1 TYPE REF TO cl_gui_alv_grid,
          r_grid2  TYPE REF TO cl_gui_alv_grid,
          r_grid3  TYPE REF TO cl_gui_alv_grid,
          g_dock TYPE REF TO cl_gui_docking_container,
          g_dock1 TYPE REF TO cl_gui_docking_container,
          g_dock2 TYPE REF TO cl_gui_docking_container,
          g_dock3 TYPE REF TO cl_gui_docking_container,
          g_dock4 TYPE REF TO cl_gui_docking_container,
          it_fieldcat  TYPE lvc_t_fcat,
          it_fieldcat1 TYPE lvc_t_fcat,
          it_fieldcat2 TYPE lvc_t_fcat,
          it_fieldcat3 TYPE lvc_t_fcat,
          wa_fieldcat TYPE lvc_s_fcat.
    DATA picture TYPE REF TO cl_gui_picture.
    DATA url(255).
    CLEAR url.
    DATA  init.
    START-OF-SELECTION.
      wa-name = 'test01'.
      wa-age = '1'.
      APPEND wa TO itab.
      wa-name = 'test02'.
      wa-age = '2'.
      APPEND wa TO itab.
      wa-name = 'test03'.
      wa-age = '3'.
      APPEND wa TO itab.
      wa1-sub1 = '11'.
      wa1-sub2 = '22'.
      wa1-total = wa1-sub1 + wa1-sub2.
      APPEND wa1 TO itab1.
      wa1-sub1 = '22'.
      wa1-sub2 = '33'.
      wa1-total = wa1-sub1 + wa1-sub2.
      APPEND wa1 TO itab1.
      wa2-phnum = '99999999999'.
      APPEND wa2 TO itab2.
      wa2-phnum = '888888888888'.
      APPEND wa2 TO itab2.
      wa2-phnum = '777777777777'.
      APPEND wa2 TO itab2.
      wa3-address = 'HItech City'.
      APPEND wa3 TO itab3.
      wa3-address = 'Secunderabad'.
      APPEND wa3 TO itab3.
      wa3-address = 'Hyderabad'.
      APPEND wa3 TO itab3.
      PERFORM display_image.
      CALL SCREEN 100.
    *& Module STATUS_0100 OUTPUT
    text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'LISTOUT1'.
      SET TITLEBAR 'LIST1'.
      wa_fieldcat-fieldname = 'NAME'.
      wa_fieldcat-seltext   = 'NAME OF THE STUDENT'.
      wa_fieldcat-coltext =   'NAME OF THE STUDENT'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = 'AGE'.
      wa_fieldcat-seltext   = 'AGE OF THE STUDENT'.
      wa_fieldcat-coltext =    'AGE OF THE STUDENT'.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-fieldname = 'SUB1'.
      wa_fieldcat-seltext   = 'SUBJECT1'.
      wa_fieldcat-coltext =    'SUBJECT1'.
      APPEND wa_fieldcat TO it_fieldcat1.
      wa_fieldcat-fieldname = 'SUB2'.
      wa_fieldcat-seltext   = 'SUBJECT2'.
      wa_fieldcat-coltext =    'SUBJECT2'.
      APPEND wa_fieldcat TO it_fieldcat1.
      wa_fieldcat-fieldname = 'TOTAL'.
      wa_fieldcat-seltext   = 'TOTAL'.
      wa_fieldcat-coltext =    'TOTAL'.
      APPEND wa_fieldcat TO it_fieldcat1.
      wa_fieldcat-fieldname = 'PHNUM'.
      wa_fieldcat-seltext   = 'PHONE NO'.
      wa_fieldcat-coltext =    'PHONE NO'.
      APPEND wa_fieldcat TO it_fieldcat2.
      wa_fieldcat-fieldname = 'ADDRESS'.
      wa_fieldcat-seltext   = 'ADDRESS'.
      wa_fieldcat-coltext =    'ADDRESS'.
      APPEND wa_fieldcat TO it_fieldcat3.
      IF g_dock IS INITIAL.
        CREATE OBJECT g_dock
                      EXPORTING
                      repid     = sy-repid
                      dynnr     = sy-dynnr
                      side      = g_dock->dock_at_left
                      extension = 300.
        CREATE OBJECT r_grid
                  EXPORTING
                  i_parent = g_dock.
      ENDIF.
      IF g_dock1 IS INITIAL.
        CREATE OBJECT g_dock1
                      EXPORTING
                      repid     = sy-repid
                      dynnr     = sy-dynnr
                      side      = g_dock1->dock_at_right
                      extension = 300.
        CREATE OBJECT r_grid1
                  EXPORTING
                  i_parent = g_dock1.
      ENDIF.
      IF g_dock2 IS INITIAL.
        CREATE OBJECT g_dock2
                      EXPORTING
                      repid     = sy-repid
                      dynnr     = sy-dynnr
                      side      = g_dock2->dock_at_top
                      extension = 100.
        CREATE OBJECT r_grid2
                  EXPORTING
                  i_parent = g_dock2.
        IF g_dock3 IS INITIAL.
          CREATE OBJECT g_dock3
                        EXPORTING
                        repid     = sy-repid
                        dynnr     = sy-dynnr
                        side      = g_dock3->dock_at_top
                        extension = 100.
          CREATE OBJECT r_grid3
                    EXPORTING
                    i_parent = g_dock3.
        ENDIF.
        IF NOT itab[] IS INITIAL.
          CALL METHOD r_grid->set_table_for_first_display
            CHANGING
              it_outtab       = itab
              it_fieldcatalog = it_fieldcat.
        ENDIF.
        IF NOT itab1[] IS INITIAL.
          CALL METHOD r_grid1->set_table_for_first_display
            CHANGING
              it_outtab       = itab1
              it_fieldcatalog = it_fieldcat1.
        ENDIF.
        IF NOT itab2[] IS INITIAL.
          CALL METHOD r_grid2->set_table_for_first_display
            CHANGING
              it_outtab       = itab2
              it_fieldcatalog = it_fieldcat2.
        ENDIF.
        IF NOT itab3[] IS INITIAL.
          CALL METHOD r_grid3->set_table_for_first_display
            CHANGING
              it_outtab       = itab3
              it_fieldcatalog = it_fieldcat3.
        ENDIF.
    if   g_dock4 is initial.
        CREATE OBJECT g_dock4
                      EXPORTING
                      repid     = sy-repid
                      dynnr     = sy-dynnr
                      side      = g_dock4->dock_at_bottom
                      extension = 100.
        CREATE OBJECT picture
                          EXPORTING parent = g_dock4.
        CALL METHOD picture->load_picture_from_url
          EXPORTING
            url = url.
        init = 'X'.
    endif.
      ENDIF.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *&      Form  display_image
    FORM display_image .
      DATA query_table LIKE w3query OCCURS 1 WITH HEADER LINE.
      DATA html_table LIKE w3html OCCURS 1.
      DATA return_code LIKE  w3param-ret_code.
      DATA content_type LIKE  w3param-cont_type.
      DATA content_length LIKE  w3param-cont_len.
      DATA pic_data LIKE w3mime OCCURS 0.
      DATA pic_size TYPE i.
      REFRESH query_table.
      query_table-name = '_OBJECT_ID'.
      query_table-value = 'ENJOYSAP_LOGO'.
      APPEND query_table.
      CALL FUNCTION 'WWW_GET_MIME_OBJECT'
        TABLES
          query_string        = query_table
          html                = html_table
          mime                = pic_data
        CHANGING
          return_code         = return_code
          content_type        = content_type
          content_length      = content_length
        EXCEPTIONS
          object_not_found    = 1
          parameter_not_found = 2
          OTHERS              = 3.
      IF sy-subrc = 0.
        pic_size = content_length.
      ENDIF.
      CALL FUNCTION 'DP_CREATE_URL'
        EXPORTING
          type     = 'image'
          subtype  = cndp_sap_tab_unknown
          size     = pic_size
          lifetime = cndp_lifetime_transaction
        TABLES
          data     = pic_data
        CHANGING
          url      = url
        EXCEPTIONS
          OTHERS   = 1.
    ENDFORM.                    " display_image
    *&      Module  EXIT  INPUT
          text
    MODULE exit INPUT.
      CALL METHOD g_dock->free.
      CALL METHOD g_dock1->free.
      CALL METHOD g_dock2->free.
      CALL METHOD g_dock3->free.
    ENDMODULE.                 " EXIT  INPUT

  • Reg ALV GRID

    Hi,
    i am getting data for MATNR,WERKS and few more fields in the ALV output.
    in that for MATNR i put the edit option,so when i edit this matnr field and click on SAVE button the values should be saved in the output.
    i wrote the function module popup_to_confirm but its going to dump.
    how to write it? could you please help me out?
          FORM it_out_user_command                                      *
    Description : Handling user commands
    FORM it_out_user_command
      USING
        ucmd          TYPE sy-ucomm          " SY-UCOMM value
        fieldinfo     TYPE slis_selfield     " Current ALV Cell & ALV Info
        alv_fcat_dtel TYPE typ_t_fcat_dtel.  " Table utilized by std ucmd
      fieldinfo-refresh = c_x.
    *--- User-commands
    CASE ucmd.
       WHEN 'SAVE'.
        perform save_data.
       WHEN 'EXIT'.
        LEAVE SCREEN.
    ENDCASE.
    ENDFORM.                                 "it_out_user_command
          FORM it_out_pfstatus                                          *
    Description : Form to set PF status
    FORM it_out_pfstatus USING rt_extab TYPE slis_t_extab.
      DATA : lt_extab TYPE slis_t_extab,
             lx_extab LIKE LINE OF lt_extab.
      REFRESH lt_extab.
        SET PF-STATUS 'ALV_MAIN' EXCLUDING lt_extab.
    ENDFORM.                    " it_out_pfstatus
    *& Form DATA_OUTPUT
    *Download data to final internal table
    FORM DATA_OUTPUT .
    loop at it_ekpo into x_ekpo.
    x_out_ekpo-ebeln = x_ekpo-ebeln.
    x_out_ekpo-ebelp = x_ekpo-ebelp.
    x_out_ekpo-matnr = x_ekpo-matnr.
    x_out_ekpo-werks = x_ekpo-werks.
    append x_out_ekpo to it_out.
    endloop.
    ENDFORM.                                         " DATA_OUTPUT
    *&      Form  SAVE_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM SAVE_DATA .
    data: lv_answer type c.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
      EXPORTING
      TITLEBAR                    = ' '
      DIAGNOSE_OBJECT             = ' '
        TEXT_QUESTION               = 'Do you want to save'
        TEXT_BUTTON_1               = 'Yes'(001)
      ICON_BUTTON_1               = ' '
       TEXT_BUTTON_2               = 'No'(008)
      ICON_BUTTON_2               = ' '
      DEFAULT_BUTTON              = '1'
      DISPLAY_CANCEL_BUTTON       = 'X'
      USERDEFINED_F1_HELP         = ' '
      START_COLUMN                = 25
      START_ROW                   = 6
      POPUP_TYPE                  =
      IV_QUICKINFO_BUTTON_1       = ' '
      IV_QUICKINFO_BUTTON_2       = ' '
    IMPORTING
        ANSWER                      = lv_answer
    TABLES
      PARAMETER                   =
    EXCEPTIONS
        TEXT_NOT_FOUND              = 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.
    if lv_answer = '1'.
    modify it_out.
    endif.
    ENDFORM.                    " SAVE_DATA
    Regards,
    Shalini

    Maybe he didn't get the answer yet;)
    Please see this link: [Editable ALV grid|https://www.sdn.sap.com/irj/sdn/wiki]
    Ups. it seems link was just to SDN Wiki. Type there Eidatble ALV. First article is what you need
    Edited by: Marcin Pciak on Oct 16, 2008 11:27 AM

  • Reg alv grid  using module pool programming

    Dear Friends,
    I have a situation where i am using alv grid in module programming where in when i click the total button in the tool bar for any numeric column, the screen goes for a run time error.
    I have giving all conditions such as made the column in the field structure of lvc_field_catalog as do_sum = 'X',
    still goes for a dump...can anyone throw some hints to do more or the reason behind this and also have not excluded the function code for this total pushbutton while passing to the method set_table_for_first_display
    thanks...

    hi,
    check this up
    internal tables
    DATA: i_tab TYPE TABLE OF zchangereq,
    w_tab TYPE zchangereq.
    display field details
    DATA: w_field_cat_wa TYPE lvc_s_fcat. " Field Catalog work area
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-020.
    PARAMETERS: p_outs RADIOBUTTON GROUP g1,
    p_comp RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK b1.
    *MACROS
    DEFINE add_field.
    &1 = FIELDNAME &2 = HEADING &3 = Key field flag
    clear w_field_cat_wa.
    w_field_cat_wa-fieldname = &1.
    lw_field_cat_wa-ref_table = p_ref_table.
    lw_field_cat_wa-inttype = p_inttype.
    lw_field_cat_wa-decimals = p_decimals.
    lw_field_cat_wa-coltext = p_coltext.
    lw_field_cat_wa-seltext = p_seltext.
    lw_field_cat_wa-do_sum = p_do_sum.
    lw_field_cat_wa-no_out = p_no_out.
    lw_field_cat_wa-col_pos = p_col_pos.
    lw_field_cat_wa-reptext = p_coltext.
    lw_field_cat_wa-colddictxt = p_colddictxt.
    w_field_cat_wa-scrtext_m = &2.
    w_field_cat_wa-key = &3.
    append w_field_cat_wa to i_field_cat.
    END-OF-DEFINITION.
    ALV specific Declarations...........................................
    ALV specific Internal table declarations.............................
    DATA: i_field_cat TYPE lvc_t_fcat, " Field catalogue
    i_alv_sort TYPE lvc_t_sort. " Sort table
    ALV variables........................................................
    DATA: w_alv_layout TYPE lvc_s_layo, " ALV Layout
    w_alv_save TYPE c, " ALV save
    w_alv_variant TYPE disvariant. " ALV Variant
    ALV Class definitions................................................
    CLASS lcl_event_handler DEFINITION.
    PUBLIC SECTION.
    METHODS: handle_double_click
    FOR EVENT double_click OF cl_gui_alv_grid
    IMPORTING e_row e_column.
    METHODS: handle_hotspot
    FOR EVENT hotspot_click OF cl_gui_alv_grid
    IMPORTING e_row_id e_column_id.
    ENDCLASS. " CLASS LCL_EVENT_HANDLER DEF..
    ALV Class implementation............................................
    In the Event of a Double Click drill down to the corresponding CHANGE REQUEST
    CLASS lcl_event_handler IMPLEMENTATION.
    METHOD handle_double_click.
    DATA: l_tab LIKE LINE OF i_tab.
    CHECK e_row-rowtype(1) EQ space.
    READ TABLE i_tab INDEX e_row-index INTO l_tab.
    SET PARAMETER ID 'ZTY' FIELD l_tab-ztype.
    SET PARAMETER ID 'ZCR' FIELD l_tab-zcref.
    CALL TRANSACTION 'ZCRT' AND SKIP FIRST SCREEN.
    ENDMETHOD. " HANDLE_DOUBLE_CLICK
    not working yet - hotspot seems to stay in the gui!!
    METHOD handle_hotspot.
    DATA: l_tab LIKE LINE OF i_tab.
    CHECK e_row_id-rowtype(1) EQ space.
    READ TABLE i_tab INDEX e_row_id-index INTO l_tab.
    SET PARAMETER ID 'ZTY' FIELD l_tab-ztype.
    SET PARAMETER ID 'ZCR' FIELD l_tab-zcref.
    CALL TRANSACTION 'ZCRT' AND SKIP FIRST SCREEN.
    ENDMETHOD. " HANDLE_DOUBLE_CLICK
    ENDCLASS. " CLASS LCL_EVENT_HANDLER IMPL...
    ALV Grid Control definitions........................................
    DATA:
    ALV Grid Control itself
    o_grid TYPE REF TO cl_gui_alv_grid,
    Container to hold the ALV Grid Control
    o_custom_container TYPE REF TO cl_gui_custom_container,
    Event handler (defined in the class above)
    o_event_handler TYPE REF TO lcl_event_handler.
    INITIALIZATION.
    PERFORM create_field_catalogue. " Create ALV Field Catalog
    START-OF-SELECTION.
    Outstanding requests
    IF p_outs = 'X'.
    SELECT * FROM zchangereq
    INTO TABLE i_tab
    WHERE zstatus < 99.
    ELSE.
    completed requests
    SELECT * FROM zchangereq
    INTO TABLE i_tab
    WHERE zstatus = 99.
    ENDIF.
    END-OF-SELECTION.
    PERFORM list_output_to_alv. " Perform ALV Output operations
    FORM LIST_OUTPUT_TO_ALV *
    This subroutine is used to call the screen for ALV Output. *
    There are no interface parameters to be passed to this subroutine. *
    FORM list_output_to_alv.
    CALL SCREEN 100.
    ENDFORM. " LIST_OUTPUT_TO_ALV
    Module STATUS_0100 OUTPUT *
    This is the PBO module which will be processed befor displaying the *
    ALV Output. *
    MODULE status_0100 OUTPUT.
    SET PF-STATUS '0100'. " PF Status for ALV Output Screen
    IF p_outs = 'X'.
    SET TITLEBAR 'STD'.
    ELSE.
    completed requests
    SET TITLEBAR 'COMP'.
    ENDIF.
    CREATE OBJECT: o_custom_container
    EXPORTING container_name = 'SC_GRID',
    o_grid
    EXPORTING i_parent = o_custom_container.
    PERFORM define_alv_layout. " ALV Layout options definitions
    PERFORM save_alv_layout_options. " save ALV layout options
    PERFORM call_alv_grid. " Call ALV Grid Control
    ENDMODULE. " STATUS_0100 OUTPUT
    Module USER_COMMAND_0100 INPUT *
    This is the PAI module which will be processed when the user performs*
    any operation from the ALV output. *
    MODULE user_command_0100 INPUT.
    CASE sy-ucomm.
    WHEN 'EXIT' OR 'BACK' OR 'CANC'.
    may need to do this so display is refreshed if other report selected
    CALL METHOD o_custom_container->free.
    SET SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    FORM DEFINE_ALV_LAYOUT *
    This subroutine is used to Define the ALV layout. *
    FORM define_alv_layout .
    w_alv_layout-numc_total = 'X'. " Numc total line
    w_alv_layout-cwidth_opt = 'X'. " Optimal column width
    w_alv_layout-detailinit = 'X'. " Show values that are initial in
    " detail list.
    w_alv_layout-sel_mode = 'A'. " Column selection mode
    w_alv_layout-no_merging = 'X'. " No merging while sorting columns
    w_alv_layout-keyhot = 'X'.
    ENDFORM. " DEFINE_ALV_LAYOUT
    FORM SAVE_ALV_LAYOUT_OPTIONS *
    This subroutine is used to Save the ALV layout options. *
    FORM save_alv_layout_options.
    See the ALV grid control documentation for full list of options
    w_alv_save = 'A'.
    w_alv_variant-report = sy-repid.
    ENDFORM. " SAVE_ALV_LAYOUT_OPTIONS
    FORM CALL_ALV_GRID *
    This subroutine is used to call ALV Grid control for processing. *
    FORM call_alv_grid.
    CALL METHOD o_grid->set_table_for_first_display
    EXPORTING
    is_layout = w_alv_layout
    i_save = w_alv_save
    is_variant = w_alv_variant
    CHANGING
    it_outtab = i_tab[]
    it_sort = i_alv_sort
    it_fieldcatalog = i_field_cat.
    Link used Events and Event Handler Methods
    CREATE OBJECT o_event_handler.
    Set handler o_event_handler->handle_top_of_page for o_grid.
    SET HANDLER o_event_handler->handle_double_click FOR o_grid.
    ENDFORM. " CALL_ALV_GRID
    *& Form create_field_catalogue
    set up field catalogue
    FORM create_field_catalogue .
    Fieldname Heading Key?
    *eg add_field 'ZTYPE' 'Type' 'X'.
    ENDFORM. " create_field_catalogue

  • Reg alv grid display exporting to excel sheet

    hi experts,
    I have done an ALV report using reuse_alv_grid _display , out put is fine , but when i click on excel view icon i could only see an excel sheet without any data ., but when i use export to local file and choose spread sheet its giving  the data in excel, but the user wants to click only the excel view icon., please help me out.
    Note : i have already tried changing the macro security in excel to Low .

    see it will give you the   Status message  as  ...
    <b>View cannot be switched: Product is not installed or integration is not active.</b>
    it means the Excel  Integration was not  done in you  sap system .  ask basis   there  will be a Patch for it  ... once  it was applied   automatically in  all the   ALV  the excel view  will work
    in  my system it was  working 
    Girish

  • Reg ALV grid display

    Hi Expert,
    I am facing simple problem regarding alv display.
    While retrieving data, records are shown in internal table (It_final), but it doesn't goes to alv display in output.
    The code is:
    FORM merge_data .
      SORT it_qasr BY probenr prueflos  vorglfnr.
      LOOP AT it_qasr INTO wa_qasr.
        w_mittelwert = wa_qasr-mittelwert.
        READ TABLE it_qapp INTO wa_qapp WITH KEY prueflos = wa_qasr-prueflos
                                                 vorglfnr = wa_qasr-vorglfnr
                                                 probenr  = wa_qasr-probenr.
        wa_final-userd1 = wa_qapp-userd1.
        wa_final-usert1 = wa_qapp-usert1.
        wa_final-userc1 = wa_qapp-userc1.
        SHIFT wa_final-userc1 LEFT DELETING LEADING '0'.
        wa_final-userc2 = wa_qapp-userc2.
        READ TABLE it_plmk INTO wa_plmk WITH KEY merknr  = wa_qasr-merknr
                                                 plnnr   = wa_mapl-plnnr.
                                                plnkn = wa_qasr-vorglfnr  " changed by DEVK909452
        READ TABLE it_qpmt INTO wa_qpmt WITH KEY mkmnr = wa_plmk-verwmerkm.
        READ TABLE it_qpct INTO wa_qpct WITH KEY codegruppe = wa_qasr-gruppe1
                                                 code = wa_qasr-code1.
        TRANSLATE wa_qpmt-mkmnr TO UPPER CASE.
        IF wa_qpmt-mkmnr CS 'RQZMOI'.
          wa_qpmt-mkmnr = 'MOIS_Q'.
        ENDIF.
        IF wa_qpmt-mkmnr CS 'RIOSI+AL'.
          wa_qpmt-mkmnr = 'SIAL_IR'.
        ENDIF.
    CASE wa_qpmt-mkmnr.
          WHEN 'MOIS_Q'.
            wa_final-MOIS_Q = w_mittelwert.
          WHEN 'SIAL_IR'.
            wa_final-SiAl_IR = w_mittelwert.
    WHEN 'SHIFT'.
            wa_final-shift = wa_qpct-kurztext.
          WHEN 'MATERIAL'.
            wa_final-material = wa_qpct-kurztext.
        ENDCASE.
          APPEND wa_final TO it_final.
          CLEAR wa_final.
    FORM alv_display .
    *fieldcatalog template with 105 fields
    PERFORM sub_make_field_cat1 USING :
            '1'      'USERD1'          'DATE',
            '2'      'MATERIAL'          'MATERIAL',
            '3'      'USERC2'          'SOURCE',
            '4'      'USERC1'          'LOCATION',
            '5'      'USERT1'          'TIME',
            '6'      'SHIFT'          'SHIFT',
            '7'      'MATERIAL'          'MATERIAL',
            '8'      'SHIFT'          'SHIFT',
            '9'      'MOIS_Q'          'MOISTURE-Q',
            '10'      'SI_Q'          'SILICA-Q',
            '11'      'AL_Q'          'ALUMINA-Q',
            '12'      'FO_Q'          'FERRIC OXIDE-Q',
            '13'      'SIZE_Q'          'SIZE-Q',
            '14'      'MOIS_IR'          'MOISTURE-IR',
            '15'      'TIRON_IR'          'TOTAL IRON-IR',
            '16'      'SI_IR'          'SILICA-IR',
            '17'      'AL_IR'          'ALUMINA-IR',
            '18'      'SIAL_IR'          'SILICA + ALUMINA-IR',
            '19'      'P_IR'          'PHOSPHOROUS-IR',
            '20'      'L_O_I_IR'          'LOSS ON IGNITION-IR',
            '21'      'MN_IR'          'MANGANESS-IR',
            '22'      'TITOX_IR'          'TITANIUM OXIDE-IR',
            '23'      'ALK_IR'          'ALKALIES-IR',
            '24'      'SUL_IR'          'SULPHUR-IR',
            '25'      'TIND_IR'          'TUMBLER INDEX-IR',
            '26'      'ABBIND_IR'          'ABBRATION INDEX-IR',
            '27'      'BDEN_IR'          'BULK DENSITY-IR',
            '28'      'SIZE_IR'          'SIZE-IR',
            '29'      'MOIS_IRF'          'MOISTURE-IRF',
            '30'      'TIRON_IRF'          'TOTAL IRON-IRF',
            '31'      'SI_IRF'          'SILICA-IRF',
            '32'      'AL_IRF'          'ALUMINA-IRF',
            '33'      'P_IRF'          'PHOSPHOROUS-IRF',
            '34'      'L_O_I_IRF'          'LOSS ON IGNITION-IRF',
            '35'      'MOIS_COKE'          'MOISTURE-COKE',
            '36'      'VOL_MAT_COKE'          'VOLATILE MATTER-COKE',
            '37'      'ASH_COKE'          'ASH-COKE',
            '38'      'FIX_CA_COKE'          'FIXED CARBON-COKE',
            '39'      'SUL_COKE'          'SULPHUR-COKE',
            '40'      'P_COKE'          'PHOSPHOROUS-COKE',
            '41'      'ALK_COKE'          'ALKALIES-COKE',
            '42'      'SI_COKE'          'SILICA-COKE',
            '43'      'AL_COKE'          'ALUMINA-COKE',
            '44'      'FEO_COKE'          'FERRIC OXIDE-COKE',
            '45'      'CAO_COKE'          'CALCIUM OXIDE-COKE',
            '46'      'MGO_COKE'          'MAGNESIUM OXIDE-COKE',
            '47'      'PPOX_COKE'          'PHOSPHOROUS PENTAOXIDE-COKE',
            '48'      'SIZE_COKE'          'SIZE-COKE',
            '49'      'MOIS_LS'          'MOISTURE-LS',
            '50'      'SI_LS'          'SILICA-LS',
            '51'      'AL_LS'          'ALUMINA-LS',
            '52'      'FEO_LS'          'FERRIC OXIDE-LS',
            '53'      'CAO_LS'          'CALCIUM OXIDE-LS',
            '54'      'MGO_LS'          'MAGNESIUM OXIDE-LS',
            '55'      'ALK_LS'          'ALKALIES-LS',
            '56'      'SIZE_LS'          'SIZE-LS',
            '57'      'MOIS_LSF'          'MOISTURE-LSF',
            '58'      'SI_LSF'          'SILICA-LSF',
            '59'      'AL_LSF'          'ALUMINA-LSF',
            '60'      'FEO_LSF'          'FERRIC OXIDE-LSF',
            '61'      'CAO_LSF'          'CALCIUM OXIDE-LSF',
            '62'      'MGO_LSF'          'MAGNESIUM OXIDE-LSF',
            '63'      'SIZE_LSF'          'SIZE-LSF',
            '64'      'MOIS_D'          'MOISTURE-D',
            '65'      'SI_D'          'SILICA-D',
            '66'      'AL_D'          'ALUMINA-D',
            '67'      'FEO_D'          'FERRIC OXIDE-D',
            '68'      'CAO_D'          'CALCIUM OXIDE-D',
            '69'      'MGO_D'          'MAGNESIUM OXIDE-D',
            '70'      'ALK_D'          'ALKALIES-D',
            '71'      'SIZE_D'          'SIZE-D',
            '72'      'MOIS_DF'          'MOISTURE-DF',
            '73'      'SI_DF'          'SILICA-DF',
            '74'      'AL_DF'          'ALUMINA-DF',
            '75'      'FEO_DF'          'FERRIC OXIDE-DF',
            '76'      'CAO_DF'          'CALCIUM OXIDE-DF',
            '77'      'MGO_DF'          'MAGNESIUM OXIDE-DF',
            '78'      'SIZE_DF'          'SIZE-DF',
            '79'      'MOIS_MO'          'MOISTURE-MO',
            '80'      'SI_MO'          'SILICA-MO',
            '81'      'AL_MO'          'ALUMINA-MO',
            '82'      'TIRON_MO'          'TOTAL IRON-MO',
            '83'      'MN_MO'          'MANGENESE-MO',
            '84'      'P_MO'          'PHOSPHAROUS-MO',
            '85'      'ALK_MO'          'ALKALIES-MO',
            '86'      'SIZE_MO'          'SIZE-MO',
            '87'      'MOIS_STR'          'MOISTURE-STR',
            '88'      'SI_STR'          'SILICA-STR',
            '89'      'AL_STR'          'ALUMINA-STR',
            '90'      'TIRON_STR'          'TOTAL IRON-STR',
            '91'      'FO_STR'          'FERROUS OXOIDE-STR',
            '92'      'P_STR'          'PHOSPHAROUS-STR',
            '93'      'CAO_STR'          'CALCIUM OXIDE-STR',
            '94'      'MGO_STR'          'MAGNESIUM OXIDE-STR',
            '95'      'TIND_STR'          'TUMBLER INDEX-STR',
            '96'      'ABBIND_STR'          'ABBRATION INDEX-STR',
            '97'      'CAOSIO2_STR'          'CAO / SIO2-STR',
            '98'      'SI_SLG'          'SILICA-SLG',
            '99'      'AL_SLG'          'ALUMINA-SLG',
            '100'      'FEO_SLG'          'FERRIC OXIDE-SLG',
            '101'      'CAO_SLG'          'CALCIUM OXIDE-SLG',
            '102'      'MGO_SLG'          'MAGNESIUM OXIDE-SLG',
            '103'      'MNO_SLG'          'MANGANESE OXIDE-SLG',
            '104'      'FO_SLG'          'FERROUS OXIDE-SLG',
            '105'      'BAS_SLG'          'BASICITY-SLG'.
      is_layout-zebra = 'X'.
      is_layout-colwidth_optimize = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_callback_pf_status_set = 'SET_PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
          is_layout                = is_layout
          it_fieldcat              = it_fieldcat
          i_save                   = 'X'
          is_variant               = gs_variant
        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.
    ENDFORM.                    " ALV_DISPLAY
    form SUB_MAKE_FIELD_CAT1  using    p_col TYPE char3
                                       p_fnam TYPE char30
                                       p_text TYPE char30.
      is_fieldcat-col_pos = p_col.
      is_fieldcat-fieldname = p_fnam.
      is_fieldcat-seltext_m = p_text.
      APPEND is_fieldcat TO it_fieldcat.
    endform.                    " SUB_MAKE_FIELD_CAT1
    This is the code i have.
    In debugging, i found data in internal table (it_final). But, it doesn't display in output.
    Please help me in this regard?
    Thanks in advance....
    Sai..
    Edited by: Sai Babu on Sep 16, 2008 3:07 PM

    Sai Babu wrote:
    > Any experts.........
    no,No,NO....
    There is no expert(active since last 3months or so) beyond him 
    Specially in ALV moreover in OOPS ALV
    Edited by: Ámit Güjärgoüd on Sep 16, 2008 3:19 PM

  • Reg: CheckBox in ALV Grid Display

    Hi all,
    My requirement is to display checkbox field in ALV Grid which is editable.
    And i also need to get all the records that i have selected in ALV grid.
    How can i do it. Kindly Help me with sample codes.
    Its Urgent.
    <REMOVED BY MODERATOR>
    Regards
    Naveen
    Edited by: Alvaro Tejada Galindo on Feb 18, 2008 5:41 PM

    Hi,
    First declare ur itab with the first field of length 1 char,
    Dont mention dat in the field cat.
    Give that field name and itab name in the layout.
    as
      is_layout-box_fieldname = 'CHECK'.
      is_layout-box_tabname   = 'IT_FINAL'.
    u can dispaly ur checkbox in the output dispaly.
    now to read the selected checkboxes u need to read the display with the syntax..
    first describe the table + headre length = w_count.
    FORM sub_read_checkbox.
      DATA: w_cbox TYPE char1.
      REFRESH : it_mail,it_text,it_selected.                   
      REFRESH : it_selected.
      DO w_count TIMES.
        READ LINE sy-index FIELD VALUE  : is_final-cbox  INTO w_cbox.
        IF w_cbox = c_x.
          READ TABLE it_header INTO is_header WITH KEY lifnr = is_header-lifnr
                                                       u_r   = is_header-u_r.
          IF sy-subrc = 0.
            APPEND is_header TO it_selected .
            CLEAR: is_header,w_cbox.
          ENDIF.
        ENDIF.
      ENDDO.
    endform.
    This serves ur purpose.
    Regards............

  • Reg. can we display alv grid using field groups (extracts)

    Hi,
    can we display alv grid using field groups (extracts). is this possible. i have to develop a blocked alv.
    tnks
    Yerukala Setty

    No, you will need the data in an internal table to use ALV.
    Cheers
    Allan

  • Reg: Top_Of_List Events in ALV GRID Display

    Hi ,
    How can i use the the the Top_of_list Event Alv grid Disply.
    I have passed Events table with event name and form name to GRID FM it_events.
    Form details:-
    T_LISTHEADER header deatils table with data. . 
    FORM TOP_OF_LIST.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY = T_LISTHEADER.
    ENDFORM.
    But still its not calling the form and also end_of list is working with same coding but top_of_list is not  working can u give solution for this.
    Regards,
    raj

    Hi Rajviji,
    Please change the coding to below :-
    *& Report  ZR2K9_ALV008
    REPORT  alv_top_of_list
    TABLES : t001.
    TYPE-POOLS: slis.
    DATA : w_repid LIKE sy-repid.
    TYPES : BEGIN OF ty_comp.
            INCLUDE STRUCTURE t001.
    TYPES : END OF ty_comp.
    DATA: T_EVENTS  TYPE slis_t_event.
    DATA: WA_EVENTS   TYPE slis_alv_event .
    DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
          wa_fieldcat TYPE slis_fieldcat_alv.
    DATA : it_comp TYPE TABLE OF ty_comp.
    INITIALIZATION.
      w_repid = sy-repid.
    *Need to change here
    wa_events-name = 'TOP_OF_PAGE'.       "Instead of TOP_OF_LIST
    wa_events-form = 'TOP_OF_PAGE'.
    APPEND wa_events TO t_events.
    START-OF-SELECTION.
      SELECT * FROM t001 INTO TABLE it_comp up to 20 rows.
    END-OF-SELECTION.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = w_repid
          i_internal_tabname     = 'IT_COMP'
          I_STRUCTURE_NAME       = 't001'
          i_inclname             = w_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          = w_repid
          it_fieldcat                 = it_fieldcat[]
          IT_EVENTS                    = T_EVENTS
        TABLES
          t_outtab                    = it_comp
        EXCEPTIONS
          program_error               = 1
          OTHERS                      = 2.
    FORM TOP_OF_PAGE.             "Form Name Changed
    DATA: T_LISTHEADER   TYPE SLIS_T_LISTHEADER.
    DATA: LS_LISTHEADER TYPE SLIS_LISTHEADER.
    CLEAR LS_LISTHEADER.
    LS_LISTHEADER-TYP  = 'S'.
    LS_LISTHEADER-KEY  = 'Po Heder Details :-'.
    APPEND LS_LISTHEADER  TO T_LISTHEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY = T_LISTHEADER.
    ENDFORM.
    Regards
    Sandipan

  • Reg: Download alv grid data with top of page into excel sheet

    Hi All,
    I have a selection screen with radio button for download .
    If that radio button was selected then the data will download into excel sheet (like if we execute normal ALV grid display from there we can download top-of-page and body as it is).
    AOO : 2009P               
    Fiscal year : 2009               
    Posting period : 00               
    Local Currency : USD               
    CO Area Currency :               
    Accounting standard:               
    Sector : 23               
    BB code     Period Value LC     Periodic Quantity
    AHDKGKAJ   200                         0

    Did not get your question

  • Reg: Export To Excel From an ALV Grid

    Hi All,
    I am exporting data from an ALV Grid (FM: REUSE_ALV_GRID_DISPLAY).
    By Clicking the Standard 'Local File' button --> Spreadsheet
    Output Internal table is having data of around 300 Chars in a particular field but in exported Excel sheet it is displaying upto some what less then 240 chars only.
    Is there any maximum limit (for a particular field in ALV grid) till what data can be exported to an Excel sheet ?
    Regards,
    Pankaj.

    Hello ,
    this is possible, Add import button your gui status and you can use "GUI_DOWNLOAD" FM module.
    Regards
    İrfan.

  • Reg: GOING TO SELECTION SCREEN FROM ALV GRID.

    Hi all,
    Iam using an ALV grid display.
    I have called the grid display every times when i select a check box in the grid display.
    Then when i click on the back button the screen navigates to the previous ALV grid. My requirement is to go to the first selection screen.
    For this I have coded in the Back button as Call selection--screen <screen no>.
    When i do this, and after navigation to the selection-screen when i click on the back button on the selection screen its navigating back to the ALV grid.
    But i need to exit to the program in this case.
    Can anyone Help me on this issue?
    Regards
    Naveen

    You have to use LEAVE TO SCREEN 0.
    Regards
    Eswar
    Addition: Also see that you are releasing the grid with statement like CALL METHOD g_grid->free.
    So the code should be something like:
      CASE ok_code.
        WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          CALL METHOD g_grid->free.
          LEAVE TO SCREEN 0.
      ENDCASE.
    Edited by: Eswar Rao  Boddeti on Feb 19, 2008 1:48 PM

  • Reg. lengh of header of alv grid.....have ur points.

    Hi all,
    -I want to show text on the right side of the header of ALV grid.
    -Secondly i have limit of around 60 characters in a line...i want to add more words in the same line.....
    <b>see the code...here..</b>
      wa_listheader-typ = 'S'.
      wa_listheader-info = 'THE FUNCTIONAL LOCATION WISE PERCENTAGE   IMPLEMENTAION'.
      APPEND wa_listheader TO it_listheader.
      CLEAR wa_listheader.
    <b>Thanx in advance..</b>
    Have ur points.
    Regards,
    pradeep phogat

    Try this
    WA_LINE-TYP = 'S'..----
    ><b>'H' to print in header</b>
    CONCATENATE 'THE FUNCTIONAL LOCATION WISE PERCENTAGE IMPLEMENTAION'.
    V_RYEAR INTO WA_LINE-INFO
       SEPARATED BY SPACE.
    APPEND WA_LINE TO IT_LIST_TOP_OF_PAGE.
    Thanks

  • Reg multiple ALV grid in a window

    Hi friends,
    I have an interesting requirement where i need to have multiple alv grid in my screen, how do i accomplish this, i cannot use containers in my screen as the number of grids in my screen vary.

    Have a look at standard transaction DWDM.
    Regards,
    Aparna

  • Question reg. converting code from ALV list to ALV grid

    I created a report based on a code posted by an SDN user in ABAP forums. The code is below. Now I want to create the same functionality using ALV grid and not simple ALV list. Can you please tell me what modifications to be done to the below coding?
    Appreciate your help and input.
    Thanks a lot,
    Krishen
    ******************Code start*******************
    **Change required before executing the report..
    1)
    Create a GUI status for the program in SE41 by copying
    from the program SAPLKKBL and Status 'STANDARD'..
    and store the resulting in status 'TEST2'.
    2)
    I have used table name as ZTABLE..Change accordingly
    to your ztable name..
    **Endchange
    declarations.
    TABLES: ztable.
    TYPE-POOLS: slis.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    DATA: s_layout TYPE slis_layout_alv.
    DATA: BEGIN OF t_ztable OCCURS 0.
    INCLUDE STRUCTURE ztable.
    DATA: BOX TYPE c,
    END OF t_ztable.
    DATA: v_repid TYPE syrepid.
    selection screen
    SELECT-OPTIONS so_id for ztable-id.
    SELECT-OPTIONS so_date for ztable-date.
    start-of-selection.
    Get the data.
    SELECT * FROM ztable
    INTO TABLE t_ztable.
    where id in so_id
    and date in so_date.
    IF sy-subrc <> 0.
    MESSAGE s208(00) WITH 'No data found'.
    LEAVE LIST-PROCESSING.
    ENDIF.
    v_repid = sy-repid.
    Get the field catalog.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = v_repid
    i_structure_name = 'ZTABLE'
    CHANGING
    ct_fieldcat = t_fieldcatalog.
    Set the layout.
    s_layout-box_fieldname = 'BOX'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    i_callback_program = v_repid
    is_layout = s_layout
    i_callback_pf_status_set = 'SET_PF_STATUS'
    i_callback_user_command = 'USER_COMMAND'
    it_fieldcat = t_fieldcatalog[]
    TABLES
    t_outtab = t_ztable.
    FORM SET_PF_STATUS *
    --> EXTAB *
    FORM set_pf_status USING extab TYPE slis_t_extab.
    SET PF-STATUS 'TEST2'.
    ENDFORM.
    FORM user_command *
    --> UCOMM *
    --> SELFIELD *
    FORM user_command USING ucomm LIKE sy-ucomm
    selfield TYPE slis_selfield.
    Check the ucomm.
    IF ucomm = 'DELETE'.
    LOOP AT t_ztable WHERE box = 'X'.
    DELETE FROM ztable WHERE matnr = t_ztable-matnr.
    COMMIT WORK.
    DELETE t_ztable.
    ENDLOOP.
    ENDIF.
    selfield-refresh = 'X'.
    ENDFORM.
    **********Code ending**********************

    I believe that the only change would be to replace the work LIST with GRID in the function call.
    CALL FUNCTION 'REUSE_ALV_<b>GRID</b>_DISPLAY'
         EXPORTING
            i_callback_program = v_repid
            is_layout = s_layout
            i_callback_pf_status_set = 'SET_PF_STATUS'
            i_callback_user_command = 'USER_COMMAND'
            it_fieldcat = t_fieldcatalog[]
         TABLES
            t_outtab = t_ztable.
    The function module interface should be exactly the same.
    Regards,
    Rich Heilman

Maybe you are looking for

  • How do I import ( copy) iPhotos from External Drive that contains the iPhoto library photos.

    My old hard drive was failing and with the help of an Apple Consultant, I made a new library ( on external hard drive)  and copied all the photo files off the iMac's internal drive to the external drive. Then the iphoto library was deleted from the h

  • Why can't I get a new tab to open when I click on new tab?

    I have tried to click on a new tab and it won't open. I have tried to press ctrl-T and a new tab won't open. I have gone to File New Tab and it still will not open. And nothing seems to be turned off anywhere that I can see on the surface. A new tab

  • Photoshop cs6-Only online help?

    Is the online help the only way to see the help files? No help application as in photoshop cs5? Will there be a pdf for viewing when no internet connection is available? Added: Also there does not appear to be a list of keyboard shortcuts in the phot

  • Are there any professional tax preparation programs available for Mac?

    After seeing how much I love my Intel iMac, my dad really wants one. He does book keeping and tax preparation for his clients from home, so he would need some type of tax software that would work with a mac. Keep in mind, he would need professional l

  • Custom taglib support in Java Studio Creator (JSP-mode)?

    I want to use jstl-1.1 taglib in my project. - to do that I need to write: <jsp:root version="1.2" xmlns:c="http://java.sun.com/jsp/jstl/core" ...>but when I have done so I didn't found any support for jstl in jsp-mode of Java Studio Creator. I have