Cl_gui_alv_grid

Dear Expert,
I am developing a report with cl_gui_alv_grid.
After show the total data of material , use can double click on the plant to get the detail data of the material number.
I set it with call screen 100 and in screen 100 I create a container and call method set table for firest display for show the data.
But After first double click , I always get the first times detail data. It has not been refreshed.
Do you have any suggestion and give me some simple code?

Hello
Check the below code:
CLASS eventhandler DEFINITION.
  PUBLIC SECTION.
    METHODS:
      handle_double_click FOR EVENT double_click
        OF cl_gui_alv_grid
        IMPORTING e_row
                  e_column
      ENDCLASS.                    "EVENTHANDLER DEFINITION
CLASS eventhandler IMPLEMENTATION.
   METHOD handle_double_click.
    PERFORM handle_double_click USING e_row.
  ENDMETHOD.                    "HANDLE_DOUBLE_CLICK
ENDCLASS.                    "EVENTHANDLER IMPLEMENTATION
declare object of type eventhandler
DATA:  eventhandler_object  TYPE REF TO eventhandler.
  READ TABLE <g_t_alv> INTO g_r_itab INDEX e_row-index .
  IF sy-subrc EQ 0.
          CALL SCREEN 9001.
    ENDIF.
  ENDIF.
Within Screen 9001 u can write u r code to display the data in ALV grid container and use REFRESH_TABLE_FOR_DISPLAY  method also to have the updated data int he grid on double click.
regards

Similar Messages

  • Check_changed_data method on editable ALV Grid ( class cl_gui_alv_grid)

    Hi guys,
    I use the following method (register_edit_event) in the PBO soon after first display of an editable ALV grid to register enter as an event to do validations on fields like qty. If user enters some character like 'abc' for qty and hits enter on keyboard, ALV grid pop's up a standard message ( I haven't coded for this.Since I use DDIC structure in field catalog, the Std. ALV program takes care of it. ). THis takes care of the validation before I click on save.
    call method alv_grid->register_edit_event
                            exporting
                               i_event_id = cl_gui_alv_grid=>mc_evt_enter.
    This works fine. But I want this validation to run when I also click the SAVE button of the screen. Is it possible to run this standard validation in my PAI event eg. SAVE ? I thought I will be, by calling the method check_changed_data in my PAI event. But this is doing nothing. Does this method conflict with register_edit_event or something ? So , basically what I am looking for is to trigger the event or call the method which does the same work as the "check" button on ALV grid.
    Any advice or tips or sample code is greatly appreciated.
    Thanks,
    Shareen

    Hi Shareen,
    Handle the data_changed event in the grid.
    Whenever you make changes in the data in ALV Grid this event would be triggered. Here you can perform additional validations that you may need to perform.
        METHODS handle_data_changed
          FOR EVENT data_changed OF cl_gui_alv_grid
          IMPORTING er_data_changed.
    Implementation:
      METHOD handle_data_changed.
        PERFORM validations USING er_data_changed.
      ENDMETHOD.
    FORM validations USING er_data_changed TYPE REF TO cl_alv_changed_data_protocol.
      DATA: ls_good TYPE lvc_s_modi.
      DATA  wa LIKE LINE OF lt_good_cells.
      CALL METHOD g_grid->register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv_grid=>mc_evt_modified.
      LOOP AT er_data_changed->mt_good_cells INTO ls_good.
        CASE ls_good-fieldname.
        WHEN 'FIELDNAME'. "Your fieldname
            CALL METHOD er_data_changed->get_cell_value "Get the changed value
              EXPORTING
                i_row_id    = ls_good-row_id
                i_fieldname = ls_good-fieldname
              IMPORTING
                e_value     = temp. "Your temp variable
            "Make your validations here.
        ENDCASE.
    Ps: Reward points if helpful.
    Regards,
    Wenceslaus.

  • How to insert line with values in ALV (CL_GUI_ALV_GRID)?

    Hi,
    Does anyone know how to get control of new line inserted in ALV (I am using class CL_GUI_ALV_GRID) before the new line is shown to the user. What I want the user to see is not a completely blank line, but a new line with certain fields filled with data.
    I have tried with ALL events in CL_GUI_ALV_GRID but without any luck. If I create my own user command and insert it in the alv menu I get control, but not with the standards. Why?
    Please help
    Kind regards - Keld Gregersen

    Hi,
    I created a nice work around...
    CLASS lcl_event_handler DEFINITION.
    handle_toolbar
    FOR EVENT toolbar OF cl_gui_alv_grid
    IMPORTING e_object e_interactive,
    handle_user_command
    FOR EVENT user_command OF cl_gui_alv_grid
    IMPORTING e_ucomm.
    ENDCLASS. "lcl_event_handler DEFINITION
    CLASS lcl_event_handler IMPLEMENTATION.
    METHOD handle_toolbar.
    DATA:
    l_toolbar TYPE stb_button.
    Here I replace SAP standard functions with own functions
    READ TABLE e_object->mt_toolbar INTO l_toolbar
    WITH KEY function = '&LOCAL&APPEND'.
    IF sy-subrc = 0.
    l_toolbar-function = 'OWN_APPEND'.
    MODIFY e_object->mt_toolbar FROM l_toolbar INDEX sy-tabix.
    ENDIF.
    READ TABLE e_object->mt_toolbar INTO l_toolbar
    WITH KEY function = '&LOCAL&COPY_ROW'.
    IF sy-subrc = 0.
    l_toolbar-function = 'OWN_COPY_ROW'.
    MODIFY e_object->mt_toolbar FROM l_toolbar INDEX sy-tabix.
    ENDIF.
    ENDMETHOD. "handle_toolbar
    METHOD handle_user_command.
    CASE e_ucomm.
    WHEN 'OWN_APPEND'.
    CALL METHOD ref_alv->check_changed_data
    IMPORTING
    e_valid =
    CHANGING
    c_refresh = 'X'
    CREATE YOUR OWN CODE HERE
    CALL METHOD ref_alv->refresh_table_display
    EXPORTING
    is_stable = 'X'
    i_soft_refresh =
    EXCEPTIONS
    finished = 1
    others = 2
    ENDMETHOD. "handle_user_command
    ENDCLASS. "lcl_event_handler IMPLEMENTATION
    Kind regards
    Keld Gregersen

  • How to retreive data from alv when using CL_GUI_ALV_GRID

    Hi All,
      I am using two subscreens to display 2 ALV grids in a screen using the OOPs concept and the class CL_GUI_ALV_GRID. I would like to download data from these two alv grids into an excel after any changes, i.e sort, filter or summation. I was able to capture data for sort and filter. The logic to capture summation and subtotals is becoming very complex. I need to simplify for better. I need help to see if there is any method which captures the changed data on the screen so that i can just call the method and retrieve the data to push into an internal table before downlaoding to excel.
    Your help is greatly appreciated.
    Thanks in advance.
    Roopa

    Step 1, define the method in class grid_hdr:
    METHODS:handle_data_changed CHANGING e_valid TYPE c.
    Step 2, process the method:
      METHOD  handle_data_changed.
        CALL METHOD zgrid->check_changed_data
          IMPORTING
            e_valid = e_valid.
      ENDMETHOD.                    "handle_data_changed
    Step 3, use the method in PAI:
      DATA l_valid TYPE c.
      CALL METHOD grid_hdr->handle_data_changed
        CHANGING
          e_valid = l_valid.
      IF l_valid = 'X'.
      ENDIF.
    Also you can search  BCALV_EDIT_* in your system.
    Edited by: SAM XIAO on Nov 17, 2009 8:03 AM

  • CL_GUI_ALV_GRID check date and POP-up appears (that is not required)

    Hi all,
    we use class CL_GUI_ALV_GRID in a report. The list contains a date field.
    If i put into this field a wrong format (example dddd instead of DD.MM.YYYY) i'll get a pop-up as an error message.
    But i would like that this error message will display in the message line (lowest line of dynpro).
    Another field is defined as an CHAR field and if i put a wrong value into this field the error message displayed in the lowest line of dynpro.
    How can i adjust this functionality if i use the date format?
    Thanks in advance.
    Regards
    Lutz

    Hi.,
    This is the Standard behavior or CL_GUI_ALV_GRID. To suppress the popup log you have  to deactivate the protocol display.
    pass space to the method ACTIVATE_DISPLAY_PROTOCOL( ) of class CL_GUI_ALV_GRID to suppress popup log.
    DATA: o_grid  TYPE REF TO cl_gui_alv_grid.
    o_grid->activate_display_protocol( space ). " To deactivate Protocol display
    do this in PBO.
    hope this helps u.,
    Thanks & Regards,
    Kiran

  • How can i do drag from cl_column_tree_mode drop to cl_gui_alv_grid ???

    Hi,
    I have building a program that will have one split screen and one of them has cl_column_tree_mode at top, and the other has cl_gui_alv_grid at bottom.
    I can Drag And Drop Lines From ALV GRID to TREE and i can use ONDRAG event of ALVGRID, DROP event of TREE Control and ONDROPCOMPLETE event of ALVGRID.
    But when i try to reverse it as like that Drag From TREE to ALVGRID, just DRAG event of TREE is triggering.
    I have implemented end registered ONDROP event for ALVGRID but it is no triggering.
    Have i something which missed ? Some of code at the above.
    *****************CODE****************************************
    *I created Application Ocject, Custom Container and Spliiter in here
    **       Definition of drag drop behaviour
        create object behaviour_top.
        call method behaviour_top->add
            exporting
                  flavor = 'LINEFROM' "I dont know where i can use this
                  dragsrc = 'X'
                  droptarget = 'X'
                  effect = cl_dragdrop=>move.
        call method behaviour_top->add
             exporting
                   flavor = 'LINETO'   "I dont know where i can use this
                   dragsrc = 'X'
                   droptarget = 'X'
                   effect = cl_dragdrop=>move.
        call method behaviour_top->get_handle
             importing handle = handle_top. "I am not sure that i can use this handle for both TREE Nodes and ALV Rows, But i am using it for both.
    ******************************   TREE   ********************************
    *   CREATE TREE
        ls_treemhhdr-heading = 'Nakliye ve Makaralar'.
        ls_treemhhdr-width   =  35.
        create object gref_column_tree
         exporting
         node_selection_mode   = cl_column_tree_model=>node_sel_mode_single
         item_selection        = space
         hierarchy_column_name = 'NUMBER'
         hierarchy_header      = ls_treemhhdr.
        call method gref_column_tree->create_tree_control
          exporting
            parent                       = container_1    .
    *   Events for tree control
        set handler g_application->handle_tree_drag for gref_column_tree.
        set handler g_application->handle_tree_drop for gref_column_tree.
    *   Build TREE
        perform build_tree using gref_column_tree. "I use HANDLE_TOP in this when creating nodes.
    ******************************   TREE   ********************************
    ****************************  ALV GRID  ********************************
    *   create ALV Grid
        create object alv_grid
                      exporting i_parent = container_2.
    *   Events alv control
        set handler g_application->handle_alv_drag for alv_grid.
        set handler g_application->handle_alv_drop for alv_grid.
        set handler g_application->handle_alv_drop_complete for alv_grid.
        gs_layout-grid_title = '&#304;s Listesi'.
        gs_layout-s_dragdrop-row_ddid = handle_top. "I think this is a important thing
        call method alv_grid->set_table_for_first_display
             exporting is_layout        = gs_layout
             changing  it_fieldcatalog  = gt_fieldcat
                       it_outtab        = i_tabout[].
    ****************************  ALV GRID  ********************************
    *I have implemented all methods for this class, it hink its not important to see *which code its has, important is why its not triggering.
    class lcl_application definition.
      public section.
        data: next_node_key type i.
        methods:
    *   ALV EVENTS
        handle_alv_drag for event ondrag of cl_gui_alv_grid
            importing e_row e_column e_dragdropobj,
        handle_alv_drop for event  ondrop of cl_gui_alv_grid
            importing e_row e_column es_row_no e_dragdropobj,
        handle_alv_drop_complete for event ondropcomplete of cl_gui_alv_grid
            importing e_row e_column e_dragdropobj,
    *   TREE EVENTS
        handle_tree_drag for event drag  of cl_column_tree_model
            importing node_key item_name drag_drop_object,
        handle_tree_drop for event drop  of cl_column_tree_model
            importing node_key drag_drop_object,
        handle_tree_drop_complete for event drop_complete of cl_column_tree_model
            importing node_key ITEM_NAME drag_drop_object.
    endclass.

    Thanks kaipha,
    in examples in SE83 i have noticed that i have to create an inctance for drag drop object when drag starts.
      method handle_tree_drag.
        data: "local_node_table type node_table_type,
              new_node type mtreesnode,
              dataobj type ref to lcl_dragdropobj_from_tree,
              l_keytxt(30) type c.
        catch system-exceptions move_cast_error = 1.
    *           create and fill dataobject for events ONDROP and ONDROPCOMPLETE
                create object dataobj. "When i create dataobj in here
                move node_key to dataobj->node_key.
                drag_drop_object->object = dataobj. "And when i call this method, ALV Drop event has begin triggered
        endcatch.
        if sy-subrc <> 0.
          call method drag_drop_object->abort.
        endif.
      endmethod.

  • Drag From cl_column_tree_model To cl_gui_alv_grid Is not Working ???

    Hi,
    I have building a program that will have one split screen and one of them has cl_column_tree_mode at top, and the other has cl_gui_alv_grid at bottom.
    I can Drag And Drop Lines From ALV GRID to TREE and i can use ONDRAG event of ALVGRID, DROP event of TREE Control and ONDROPCOMPLETE event of ALVGRID.
    But when i try to reverse it as like that Drag From TREE to ALVGRID, just DRAG event of TREE is triggering.
    I have implemented end registered ONDROP event for ALVGRID but it is no triggering.
    Have i something which missed ? Some of code at the above.
    *****************CODE****************************************
    *I created Application Ocject, Custom Container and Spliiter in here
    **       Definition of drag drop behaviour
        create object behaviour_top.
        call method behaviour_top->add
            exporting
                  flavor = 'LINEFROM' "I dont know where i can use this
                  dragsrc = 'X'
                  droptarget = 'X'
                  effect = cl_dragdrop=>move.
        call method behaviour_top->add
             exporting
                   flavor = 'LINETO'   "I dont know where i can use this
                   dragsrc = 'X'
                   droptarget = 'X'
                   effect = cl_dragdrop=>move.
        call method behaviour_top->get_handle
             importing handle = handle_top. "I am not sure that i can use this handle for both TREE Nodes and ALV Rows, But i am using it for both.
    ******************************   TREE   ********************************
    *   CREATE TREE
        ls_treemhhdr-heading = 'Nakliye ve Makaralar'.
        ls_treemhhdr-width   =  35.
        create object gref_column_tree
         exporting
         node_selection_mode   = cl_column_tree_model=>node_sel_mode_single
         item_selection        = space
         hierarchy_column_name = 'NUMBER'
         hierarchy_header      = ls_treemhhdr.
        call method gref_column_tree->create_tree_control
          exporting
            parent                       = container_1    .
    *   Events for tree control
        set handler g_application->handle_tree_drag for gref_column_tree.
        set handler g_application->handle_tree_drop for gref_column_tree.
    *   Build TREE
        perform build_tree using gref_column_tree. "I use HANDLE_TOP in this when creating nodes.
    ******************************   TREE   ********************************
    ****************************  ALV GRID  ********************************
    *   create ALV Grid
        create object alv_grid
                      exporting i_parent = container_2.
    *   Events alv control
        set handler g_application->handle_alv_drag for alv_grid.
        set handler g_application->handle_alv_drop for alv_grid.
        set handler g_application->handle_alv_drop_complete for alv_grid.
        gs_layout-grid_title = '&#304;s Listesi'.
        gs_layout-s_dragdrop-row_ddid = handle_top. "I think this is a important thing
        call method alv_grid->set_table_for_first_display
             exporting is_layout        = gs_layout
             changing  it_fieldcatalog  = gt_fieldcat
                       it_outtab        = i_tabout[].
    ****************************  ALV GRID  ********************************
    *I have implemented all methods for this class, it hink its not important to see *which code its has, important is why its not triggering.
    class lcl_application definition.
      public section.
        data: next_node_key type i.
        methods:
    *   ALV EVENTS
        handle_alv_drag for event ondrag of cl_gui_alv_grid
            importing e_row e_column e_dragdropobj,
        handle_alv_drop for event  ondrop of cl_gui_alv_grid
            importing e_row e_column es_row_no e_dragdropobj,
        handle_alv_drop_complete for event ondropcomplete of cl_gui_alv_grid
            importing e_row e_column e_dragdropobj,
    *   TREE EVENTS
        handle_tree_drag for event drag  of cl_column_tree_model
            importing node_key item_name drag_drop_object,
        handle_tree_drop for event drop  of cl_column_tree_model
            importing node_key drag_drop_object,
        handle_tree_drop_complete for event drop_complete of cl_column_tree_model
            importing node_key ITEM_NAME drag_drop_object.
    endclass.

    Thanks kaipha,
    in examples in SE83 i have noticed that i have to create an inctance for drag drop object when drag starts.
      method handle_tree_drag.
        data: "local_node_table type node_table_type,
              new_node type mtreesnode,
              dataobj type ref to lcl_dragdropobj_from_tree,
              l_keytxt(30) type c.
        catch system-exceptions move_cast_error = 1.
    *           create and fill dataobject for events ONDROP and ONDROPCOMPLETE
                create object dataobj. "When i create dataobj in here
                move node_key to dataobj->node_key.
                drag_drop_object->object = dataobj. "And when i call this method, ALV Drop event has begin triggered
        endcatch.
        if sy-subrc <> 0.
          call method drag_drop_object->abort.
        endif.
      endmethod.

  • Problem with Custom container - cl_gui_custom_container/cl_gui_alv_grid

    Hi,
    I want to reuse the same custom container screen for a different data.
    First screen there will be button 1 and button 2
    if I click button 1 then calculate and display data  in custom container, if button 2 is clicked then calculate and display data with  in the same custom container.
    For this
    1. Created Custom container - CONTAINER
    2. In program defined and created custom container and custom alv grid
    g_custom_container TYPE REF TO cl_gui_custom_container,
            alv_grid                     TYPE REF TO cl_gui_alv_grid.
           IF g_custom_container IS INITIAL.
                CREATE OBJECT g_custom_container
                    EXPORTING
                  container_name = 'CONTAINER'.
                CREATE OBJECT alv_grid
                   EXPORTING
                    i_parent = g_custom_container.
          ENDIF.
    3. Display data using CALL METHOD alv_grid->set_table_for_first_display
       every thing works great for button 1
    4. when button 2 is clicked then calculate and display different set of data in same custom container which is used earlier.
    5. here I used
    call method alv_grid->free.
        call method g_custom_container->free.
    6. create above objects once again and tried to use
    call method alv_grid->set_table_for_first_display
    , to reuse the same custom container 'CONTAINER' again for a different set of data and getting ABAP dump.
    In debug mode, when I used the above method FREE for both ALV_GRID and G_CUSTOM_CONTAINER objects are not clearing.
    Please let me know how can I reuse the same container for a different set of data when button2 is pressed.
    Thanks in advance,
    Krishna
    Please use code tags to format your code and post in the correct forum
    Edited by: Rob Burbank on Oct 1, 2010 2:37 PM

    Hello Krishna
    I would recommend to use a different approach instead of trying to initialize your container instances:
    DATA:
      go_container_1 TYPE REF TO cl_gui_custom_container,
      go_container_2 TYPE REF TO cl_gui_custom_container,
      go_grid_1          TYPE REF TO cl_gui_alv_grid,
      go_grid_2          TYPE REF TO cl_gui_alv_grid.
    " NOTE: Do this coding BEFORE calling the screen
    * (1) Create 2 containers
    CREATE OBJECT g_container_1
                    EXPORTING
                  container_name = 'CONTAINER'.
    CREATE OBJECT g_container_2
                    EXPORTING
                  container_name = 'CONTAINER'.
    " NOTE: If it is not possible to use the same container name then either create an additional
    "            dummy screen having a second CUSTOM_CONTROL element or replace
    " the customer containers with docking containers -> here you do not need to give a container name
    * (2) Create 2 grid instances using a different container
    * (3) Link the first container to the screen using its LINK method:
      CALL METHOD go_container_1
        EXPORTING
           repid = <...>
          dynnr = <...>.
    * (4) Perhaps you need to define a second dummy screen to which you link the second container
    * (5) Display first grid instance (as default)
    Now when the user pushes button 2 (to display the second grid) link container_1 to the dummy screen
    and link container_2 to your main screen.
    Regards
      Uwe

  • Dialog  problem using tabstrip & cl_gui_alv_grid

    Hi All,
         I have created a dialog program which has 2 tab strips. On first I am displaying data n a table control & on other tabstrip display same data using grid. Here to display data in grid I have used set_table_for_first_display of class cl_gui_alv_grid.
    The data is displayed successfully. But when I select second tab and return to first tab it still shows the grid on first tab in front.
    Kindly tell me what I am missing.
    Regards,
    Dilip
    Following is my code:
    REPORT  ZTEMP02.
    controls: tab type tabstrip,
              tab_c type tableview using screen 101 .
    data  :    cont1 type ref to cl_gui_custom_container,
              grid type ref to cl_gui_alv_grid.
    data : imara like mara occurs 1 with header line.
    data zmara type LVC_T_FCAT.
    data wa_mara like line of zmara.
    data flag .
           select * from mara into table imara up to 100 rows.
    call screen 100.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    case sy-ucomm.
      when 'T1'.
        tab-activetab = 'T1'.
          FLAG = SPACE.
      when 'T2'.
        tab-activetab = 'T2'.
      WHEN 'EXT'.
        LEAVE PROGRAM.
    endcase.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0102  OUTPUT
          text
    MODULE STATUS_0102 OUTPUT.
    if FLAG is initial.
      create object :
      cont1
        exporting
           container_name = 'CONT',
      grid
        exporting
           I_PARENT = cont1.
      FLAG = 'X'.
    endif.
    call method grid->SET_TABLE_FOR_FIRST_DISPLAY
         EXPORTING
           i_structure_name = 'MARA'
         changing
           it_outtab = imara[].
    ENDMODULE.                 " STATUS_0102  OUTPUT

    Have you attached a subscreen to tab T1 .
    You will also have to use Call subscreen .

  • Alignment problem using TOP_OF_PAGE w/cl_gui_alv_grid

    Hi,
    I copied ZRNBCALV_EDIT_03 and made the following changes:
    1. In class lcl_event_receiver, added a public method:
    public section.
        methods:
          handle_data_changed
             for event data_changed of cl_gui_alv_grid
                 importing er_data_changed,
          top_of_page
             for event top_of_page of cl_gui_alv_grid
               importing e_dyndoc_id.
    Implementation of top_of_page method as follows:
      method top_of_page.
        perform print_top_of_page.  " using E_DYNDOC_ID.
      endmethod.                    "top_of_page
    FORM PRINT_TOP_OF_PAGE .
      types:
        begin of ty_itab,
          werks type vbap-werks,
          lgort type vbap-lgort,
          bwtar type vbap-bwtar,
          inv  type i, " vbap-menge,
          ord  type i, " vbap-menge,
          delv type i, " vbap-menge,
        end   of ty_itab.
      DATA:
            LV_QTY_O(13)   TYPE C,       "Inventory
            LV_QTY_C(13)   TYPE C,       "Confirmed Orders
            LV_QTY_D(13)   TYPE C,     "confirmed Delivery
            LS_ITAB TYPE TY_itab,
            lt_itab type standard table of ty_itab.
      data:
            lv_space type i,
            lv_text(255) type c.
      CONSTANTS C_UNIT LIKE MARA-MEINS VALUE 'EA'.
      field-symbols:
                     <ls_itab> type ty_itab.
      ls_itab-werks = 'ML01'.
      ls_itab-lgort = '1000'.
      ls_itab-bwtar = SPACE.
      LS_ITAB-inv = 0.
      ls_itab-ord = 0.
      ls_itab-delv = 0.
      append ls_itab to lt_itab.
      clear lS_itab.
      ls_itab-werks = 'ABCD'.
      ls_itab-lgort = '1000'.
      ls_itab-bwtar = SPACE.
      LS_ITAB-inv = 1.
      ls_itab-ord = 0.
      ls_itab-delv = 0.
      append ls_itab to lt_itab.
      clear lS_itab.
      ls_itab-werks = 'ABCD'.
      ls_itab-lgort = '1000'.
      ls_itab-bwtar = 'VALUATED'.
      LS_ITAB-inv = 1.
      ls_itab-ord = 0.
      ls_itab-delv = 0.
      append ls_itab to lt_itab.
      clear ls_itab.
      ls_itab-werks = 'IJ01'.
      ls_itab-lgort = '1000'.
      ls_itab-bwtar = SPACE.
      LS_ITAB-inv = 0.
      ls_itab-ord = 0.
      ls_itab-delv = 0.
      append ls_itab to lt_itab.
      clear ls_itab.
          CALL METHOD GO_HTML->ADD_GAP.
          perform add_text_label using 'Material'.
          MOVE:  'ABCD456' TO LV_TEXT.
          perform add_gap using 1.
          perform add_text using lv_text.
          CALL METHOD GO_HTML->NEW_LINE.
          CALL METHOD GO_HTML->ADD_GAP.
          perform add_text_label using 'Plant'.
          perform add_gap using 5.
          perform add_text_label using 'Location'.
          perform add_gap using 5.
          perform add_text_label using 'Valuation'.
          perform add_gap using 4.
          perform add_text_label using 'Inventory'.
          perform add_gap using 2.
          perform add_text_label using 'Orders'.
          perform add_gap using 2.
          perform add_text_label using 'Delivery'.
       LOOP AT lt_ITAB ASSIGNING <ls_itab>.
        WRITE <ls_itab>-ord TO LV_QTY_O UNIT C_UNIT RIGHT-JUSTIFIED.
        WRITE <ls_itab>-inv TO LV_QTY_C UNIT C_UNIT RIGHT-JUSTIFIED.
        WRITE <ls_itab>-delv TO LV_QTY_D   UNIT C_UNIT RIGHT-JUSTIFIED.
        CALL METHOD GO_HTML->NEW_LINE.
          lv_text = <ls_itab>-WERKS.
          perform add_text_label using lv_text.
          lv_text = <ls_itab>-lgort.
          condense lv_text no-gaps.
          perform add_gap using 5.
          perform add_text_label using lv_text.
          lv_text = <ls_itab>-bwtar.
          condense lv_text no-gaps.
          perform add_gap using 7.
          perform add_text_label using lv_text.
          if <ls_itab>-bwtar is initial.
            lv_space = 7 + 8.  " 8 for VALUATED
          endif.
          lv_text = LV_QTY_O.
          condense lv_text no-gaps.
          lv_space = lv_space + 12.
          perform add_gap using lv_space.
          perform add_text using lv_text.
          lv_text = LV_QTY_c.
          condense lv_text no-gaps.
          lv_space = 17.  " lv_space.  " + 5.
          perform add_gap using lv_space.
          perform add_text using lv_text.
          lv_text = LV_QTY_d.
          condense lv_text no-gaps.
          perform add_gap using lv_space.
          perform add_text using lv_text.
      ENDLOOP.
      CREATE OBJECT GO_VIEW
        EXPORTING
         SHELLSTYLE         =
          PARENT             = go_contnr_top.
      go_html->html_control = go_view.
      CALL FUNCTION 'REUSE_ALV_GRID_COMMENTARY_SET'
        EXPORTING
          DOCUMENT       = go_html
          BOTTOM         = space
      IMPORTING
        LENGTH         =
      CALL METHOD GO_HTML->MERGE_DOCUMENT.
      CALL METHOD GO_HTML->DISPLAY_DOCUMENT
        EXPORTING
          REUSE_CONTROL      = 'X'
         REUSE_REGISTRATION =
         CONTAINER          =
          PARENT             = go_contnr_top
       EXCEPTIONS
         HTML_DISPLAY_ERROR = 1
         others             = 2
    ENDFORM.                    " PRINT_TOP_OF_PAGE
    In pbo, replaced cl_gui_custom_container with docking_container and cl_gui_easy_split container, cl_dd_document
    call method g_grid->list_processing_events
         exporting
                I_EVENT_NAME = 'TOP_OF_PAGE'.
    perform print_top_of_page.
    rest of the code from bcalv_edit_03 as it is
    and cl_gui_easy_split container, cl_dd_document
    call method g_grid->list_processing_events
         exporting
                I_EVENT_NAME = 'TOP_OF_PAGE'.
    perform print_top_of_page.
    rest of the code from bcalv_edit_03 as it is
    if u run the output that comes is not aligned.
    Appreciate any help
    Thanks
    Rajeev

    Hi,
    I copied ZRNBCALV_EDIT_03 and made the following changes:
    1. In class lcl_event_receiver, added a public method:
    public section.
    methods:
    handle_data_changed for event data_changed of cl_gui_alv_grid importing er_data_changed,
    top_of_page for event top_of_page of cl_gui_alv_grid importing e_dyndoc_id.
    Implementation of top_of_page method as follows:
    method top_of_page.
      perform print_top_of_page.
    endmethod. "top_of_page
    FORM PRINT_TOP_OF_PAGE .
    types:
    begin of ty_itab,
    werks type vbap-werks,
    lgort type vbap-lgort,
    bwtar type vbap-bwtar,
    inv type i,
    ord type i,
    delv type i,
    end of ty_itab.
    DATA: LV_QTY_O(13) TYPE C, "Inventory
    LV_QTY_C(13) TYPE C, "Confirmed Orders
    LV_QTY_D(13) TYPE C, "confirmed Delivery
    LS_ITAB TYPE TY_itab,
    lt_itab type standard table of ty_itab.
    data:
    lv_space type i, lv_text(255) type c.
    CONSTANTS C_UNIT LIKE MARA-MEINS VALUE 'EA'.
    field-symbols: type ty_itab.
    ls_itab-werks = 'ML01'.
    ls_itab-lgort = '1000'.
    ls_itab-bwtar = SPACE.
    LS_ITAB-inv = 0.
    ls_itab-ord = 0.
    ls_itab-delv = 0.
    append ls_itab to lt_itab.
    clear lS_itab.
    ls_itab-werks = 'ABCD'.
    ls_itab-lgort = '1000'.
    ls_itab-bwtar = SPACE.
    LS_ITAB-inv = 1.
    ls_itab-ord = 0.
    ls_itab-delv = 0.
    append ls_itab to lt_itab.
    clear lS_itab.
    ls_itab-werks = 'ABCD'.
    ls_itab-lgort = '1000'.
    ls_itab-bwtar = 'VALUATED'.
    LS_ITAB-inv = 1.
    ls_itab-ord = 0.
    ls_itab-delv = 0.
    append ls_itab to lt_itab.
    clear ls_itab.
    ls_itab-werks = 'IJ01'.
    ls_itab-lgort = '1000'.
    ls_itab-bwtar = SPACE.
    LS_ITAB-inv = 0.
    ls_itab-ord = 0.
    ls_itab-delv = 0.
    append ls_itab to lt_itab.
    clear ls_itab.
    CALL METHOD GO_HTML->ADD_GAP.
    perform add_text_label using 'Material'.
    MOVE: 'ABCD456' TO LV_TEXT.
    perform add_gap using 1.
    perform add_text using lv_text.
    CALL METHOD GO_HTML->NEW_LINE.
    CALL METHOD GO_HTML->ADD_GAP.
    perform add_text_label using 'Plant'.
    perform add_gap using 5.
    perform add_text_label using 'Location'.
    perform add_gap using 5.
    perform add_text_label using 'Valuation'.
    perform add_gap using 4.
    perform add_text_label using 'Inventory'.
    perform add_gap using 2.
    perform add_text_label using 'Orders'.
    perform add_gap using 2.
    perform add_text_label using 'Delivery'.
       LOOP AT lt_ITAB ASSIGNING <ls_itab>.
        WRITE <ls_itab>-ord TO LV_QTY_O UNIT C_UNIT RIGHT-JUSTIFIED.
        WRITE <ls_itab>-inv TO LV_QTY_C UNIT C_UNIT RIGHT-JUSTIFIED.
        WRITE <ls_itab>-delv TO LV_QTY_D   UNIT C_UNIT RIGHT-JUSTIFIED.
        CALL METHOD GO_HTML->NEW_LINE.
          lv_text = <ls_itab>-WERKS.
          perform add_text_label using lv_text.
          lv_text = <ls_itab>-lgort.
          condense lv_text no-gaps.
          perform add_gap using 5.
          perform add_text_label using lv_text.
          lv_text = <ls_itab>-bwtar.
          condense lv_text no-gaps.
          perform add_gap using 7.
          perform add_text_label using lv_text.
          if <ls_itab>-bwtar is initial.
            lv_space = 7 + 8.  " 8 for VALUATED
          endif.
          lv_text = LV_QTY_O.
          condense lv_text no-gaps.
          lv_space = lv_space + 12.
          perform add_gap using lv_space.
          perform add_text using lv_text.
          lv_text = LV_QTY_c.
          condense lv_text no-gaps.
          lv_space = 17.  " lv_space.  " + 5.
          perform add_gap using lv_space.
          perform add_text using lv_text.
          lv_text = LV_QTY_d.
          condense lv_text no-gaps.
          perform add_gap using lv_space.
          perform add_text using lv_text.
      ENDLOOP.
      CALL METHOD GO_HTML->DISPLAY_DOCUMENT
        EXPORTING
          REUSE_CONTROL      = 'X'
    *      REUSE_REGISTRATION =
    *      CONTAINER          =
          PARENT             = go_contnr_top
    *    EXCEPTIONS
    *      HTML_DISPLAY_ERROR = 1
    *      others             = 2
    ENDFORM.                    " PRINT_TOP_OF_PAGE
    In pbo, replaced cl_gui_custom_container with docking_container and
    cl_gui_easy_split container, cl_dd_document
    call method g_grid->list_processing_events
    exporting
    I_EVENT_NAME = 'TOP_OF_PAGE'.
    perform print_top_of_page.
    rest of the code from bcalv_edit_03 as it is.
    if u run the output that comes is not aligned.
    Appreciate any help
    Thanks
    Rajeev

  • SAVE_NOT_ALLOWED shortdump in class cl_gui_alv_grid

    Hello there,
    I am having problem when using ALV grid via ABAP OO.
    When using onf4 on an ALV-field, I call another screen as dialog.
    PBO screen 0400.
    create calls constructor, which initializes, create...
      CREATE OBJECT gv_container_mat
         EXPORTING
           container_name = 'ALV_MATERIAL'
        EXCEPTIONS
          others          = 1.
      IF sy-subrc NE 0.
        PERFORM display_message USING 'W' text-908 '' sy-subrc.
      ENDIF.
    create alv control
      CREATE OBJECT gv_grid_mat
         EXPORTING
           i_parent = gv_container_mat.
      IF sy-subrc NE 0.
        PERFORM display_message USING 'W' text-908 '' sy-subrc.
      ENDIF.
    setup alv events
      CREATE OBJECT gv_event_receiver.
      SET HANDLER gv_event_receiver->handle_data_changed_mat
                                     FOR gv_grid_mat.
      SET HANDLER gv_event_receiver->handle_f4_matnr
                                     FOR gv_grid_mat.
    setup alv when cursor left tab position
      CALL METHOD gv_grid_mat->register_edit_event
           EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified.
    setup alv when enter is pressed
      CALL METHOD gv_grid_mat->register_edit_event
           EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_enter.
    setup alv when F4 is pressed
      CALL METHOD gv_grid_mat->register_f4_for_fields
           EXPORTING it_f4 = gt_f4_mat[] .
    setup catt alv control
      CALL METHOD gv_grid_mat->set_table_for_first_display
           EXPORTING i_structure_name     = 'gs_parts'
                     is_layout            = gs_layout_mat
           CHANGING  it_outtab            = gt_mat_disp
                     it_fieldcatalog      = gt_fieldcat_mat
                     it_sort              = gt_sort_mat.
      CREATE OBJECT gv_event_receiver.
      SET HANDLER gv_event_receiver->handle_data_changed FOR gv_grid_mat.
    When I press F4 on field matnr, screen 0600 will be displayed with additional search fields.
    CLASSES
        METHOD handle_f4_matnr.
          PERFORM material_f4 USING e_fieldname
                                    es_row_no
                                    er_event_data
                                    et_bad_cells.
          CALL METHOD cl_gui_cfw=>set_new_ok_code
             EXPORTING
                new_code = 'ENTR'.
        ENDMETHOD.                           "handle_f4_matnr
    *&      Form  material_f4
          text
    -->  p1        text
    <--  p2        text
    FORM material_f4 USING r_fieldname   TYPE lvc_fname
                           rs_row_no     TYPE lvc_s_roid
                           rr_event_data TYPE REF TO cl_alv_event_data
                           rt_bad_cells  TYPE lvc_t_modi.       "#EC *
      FIELD-SYMBOLS: <lt_f4> TYPE lvc_t_modi.
      DATA: ls_f4         TYPE lvc_s_modi,
            lv_pernr      TYPE pernr_d,
            lv_matnr      TYPE matnr,
            lv_equnr      LIKE equi-equnr,
            lv_lgort      TYPE lgort_d,
            lv_value      LIKE ddshretval-fieldval,
            lv_repid      LIKE sy-repid,
            ls_fieldcat   TYPE lvc_s_fcat,
            lv_ename      TYPE emnam.
      DATA: lt_spareparts        TYPE ycsms_bapi_list_spareparts OCCURS 0,
            ls_spareparts        TYPE ycsms_bapi_list_spareparts,
            lt_spareparts_return TYPE ycsms_bapi_return_sparepart OCCURS 0,
            ls_spareparts_return TYPE ycsms_bapi_return_sparepart.
      CLEAR: lv_equnr,
             lt_spareparts_return,
             lt_spareparts_return[],
             ls_spareparts_return,
             lt_spareparts,
             lt_spareparts[],
             ls_spareparts,
             lv_repid.
    remember row
      gv_rowid = rs_row_no-row_id.
    define variable to return to table
      CASE r_fieldname.
      Material Number
        WHEN 'MATNR'.
          CALL SCREEN 0600 STARTING AT 20 5.
          IF sy-subrc = 0 .
            ASSIGN rr_event_data->m_data->* TO <lt_f4>.
            rr_event_data->m_event_handled = 'X'.
            CALL METHOD gv_grid_mat->refresh_table_display( ).
          ENDIF.
      ENDCASE.
    ENDFORM.                                                  " material_f4
    The result of the query after searching is displayed in an ALV grid on screen 0600.
    When I click on a result entry, everything worked perfect, but when I click on cancel in the screen an error occured after I update the ALV in screen 0600.
    PAI screen 0600 
      MODULE user_command_0600 INPUT.
        gv_ucomm = okcode.
        CASE gv_ucomm.
          WHEN 'CANCL' OR 'BACK' OR 'EXIT'.
            CLEAR: gv_ucomm,
                   okcode,
                   sy-ucomm.
            CALL SCREEN 0400.
        ENDCASE.
      ENDMODULE.                 " USER_COMMAND_0600  INPUT
    I think it has something to do the event_data. So when leaving screen 0600 when clicking on entry continues form material_f4, but when click on CANCL, it goes back to screen 0400, so it doesn't continue form material_f4, but somehow the ALV grid on screen 0400 is still in some kind of mode of changement.
    I already tried set screen 0. leave screen in PAI of screen 0600, but than I go back one step, instead of leaving whole dialog screen...
    Anyone any idea??
    Thanks

    Hello there,
    I am having problem when using ALV grid via ABAP OO.
    When using onf4 on an ALV-field, I call another screen as dialog.
    PBO screen 0400.
    create calls constructor, which initializes, create...
      CREATE OBJECT gv_container_mat
         EXPORTING
           container_name = 'ALV_MATERIAL'
        EXCEPTIONS
          others          = 1.
      IF sy-subrc NE 0.
        PERFORM display_message USING 'W' text-908 '' sy-subrc.
      ENDIF.
    create alv control
      CREATE OBJECT gv_grid_mat
         EXPORTING
           i_parent = gv_container_mat.
      IF sy-subrc NE 0.
        PERFORM display_message USING 'W' text-908 '' sy-subrc.
      ENDIF.
    setup alv events
      CREATE OBJECT gv_event_receiver.
      SET HANDLER gv_event_receiver->handle_data_changed_mat
                                     FOR gv_grid_mat.
      SET HANDLER gv_event_receiver->handle_f4_matnr
                                     FOR gv_grid_mat.
    setup alv when cursor left tab position
      CALL METHOD gv_grid_mat->register_edit_event
           EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified.
    setup alv when enter is pressed
      CALL METHOD gv_grid_mat->register_edit_event
           EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_enter.
    setup alv when F4 is pressed
      CALL METHOD gv_grid_mat->register_f4_for_fields
           EXPORTING it_f4 = gt_f4_mat[] .
    setup catt alv control
      CALL METHOD gv_grid_mat->set_table_for_first_display
           EXPORTING i_structure_name     = 'gs_parts'
                     is_layout            = gs_layout_mat
           CHANGING  it_outtab            = gt_mat_disp
                     it_fieldcatalog      = gt_fieldcat_mat
                     it_sort              = gt_sort_mat.
      CREATE OBJECT gv_event_receiver.
      SET HANDLER gv_event_receiver->handle_data_changed FOR gv_grid_mat.
    When I press F4 on field matnr, screen 0600 will be displayed with additional search fields.
    CLASSES
        METHOD handle_f4_matnr.
          PERFORM material_f4 USING e_fieldname
                                    es_row_no
                                    er_event_data
                                    et_bad_cells.
          CALL METHOD cl_gui_cfw=>set_new_ok_code
             EXPORTING
                new_code = 'ENTR'.
        ENDMETHOD.                           "handle_f4_matnr
    *&      Form  material_f4
          text
    -->  p1        text
    <--  p2        text
    FORM material_f4 USING r_fieldname   TYPE lvc_fname
                           rs_row_no     TYPE lvc_s_roid
                           rr_event_data TYPE REF TO cl_alv_event_data
                           rt_bad_cells  TYPE lvc_t_modi.       "#EC *
      FIELD-SYMBOLS: <lt_f4> TYPE lvc_t_modi.
      DATA: ls_f4         TYPE lvc_s_modi,
            lv_pernr      TYPE pernr_d,
            lv_matnr      TYPE matnr,
            lv_equnr      LIKE equi-equnr,
            lv_lgort      TYPE lgort_d,
            lv_value      LIKE ddshretval-fieldval,
            lv_repid      LIKE sy-repid,
            ls_fieldcat   TYPE lvc_s_fcat,
            lv_ename      TYPE emnam.
      DATA: lt_spareparts        TYPE ycsms_bapi_list_spareparts OCCURS 0,
            ls_spareparts        TYPE ycsms_bapi_list_spareparts,
            lt_spareparts_return TYPE ycsms_bapi_return_sparepart OCCURS 0,
            ls_spareparts_return TYPE ycsms_bapi_return_sparepart.
      CLEAR: lv_equnr,
             lt_spareparts_return,
             lt_spareparts_return[],
             ls_spareparts_return,
             lt_spareparts,
             lt_spareparts[],
             ls_spareparts,
             lv_repid.
    remember row
      gv_rowid = rs_row_no-row_id.
    define variable to return to table
      CASE r_fieldname.
      Material Number
        WHEN 'MATNR'.
          CALL SCREEN 0600 STARTING AT 20 5.
          IF sy-subrc = 0 .
            ASSIGN rr_event_data->m_data->* TO <lt_f4>.
            rr_event_data->m_event_handled = 'X'.
            CALL METHOD gv_grid_mat->refresh_table_display( ).
          ENDIF.
      ENDCASE.
    ENDFORM.                                                  " material_f4
    The result of the query after searching is displayed in an ALV grid on screen 0600.
    When I click on a result entry, everything worked perfect, but when I click on cancel in the screen an error occured after I update the ALV in screen 0600.
    PAI screen 0600 
      MODULE user_command_0600 INPUT.
        gv_ucomm = okcode.
        CASE gv_ucomm.
          WHEN 'CANCL' OR 'BACK' OR 'EXIT'.
            CLEAR: gv_ucomm,
                   okcode,
                   sy-ucomm.
            CALL SCREEN 0400.
        ENDCASE.
      ENDMODULE.                 " USER_COMMAND_0600  INPUT
    I think it has something to do the event_data. So when leaving screen 0600 when clicking on entry continues form material_f4, but when click on CANCL, it goes back to screen 0400, so it doesn't continue form material_f4, but somehow the ALV grid on screen 0400 is still in some kind of mode of changement.
    I already tried set screen 0. leave screen in PAI of screen 0600, but than I go back one step, instead of leaving whole dialog screen...
    Anyone any idea??
    Thanks

  • Changing fields color in CL_GUI_ALV_GRID using class

    Hi,
    I've written a lot of posts but still I have problem with changing color for CL_GUI_ALV_GRID.
    I have class ZKSL_CL_4_17_ALV_GRID_OO with 3 methods : SELECT, HANDLE_DBL_CLICK AND DISPLAY_ALV
    I want to change fields color every time I double click on IT.
    METHOD SELECT.
       DATA:
             lt_sflight                TYPE TABLE OF           zkslt_sflight,
             ls_layout                 TYPE                    lvc_s_layo,
             lr_custom_container       TYPE REF TO             cl_gui_custom_container,
             lr_my_class               TYPE REF TO             zksl_cl_4_17_alv_grid_oo.
       SELECT *  FROM zkslt_sflight  INTO TABLE mt_sflight
          WHERE carrid    = iv_carrid AND
              ( fldate    IN it_date  OR
                price     IN it_price OR
                planetype IN it_type )
    CALL FUNCTION 'Z_KSL_SCREEN'.
    ENDMETHOD.
    from FM z_ksl_screen i call screen 400 and from status_400 output  I call method DISPLAY_ALV
    METHOD display_alv.
       DATA:
              lr_custom_container       TYPE REF TO             cl_gui_custom_container,
              lt_sflight                TYPE TABLE OF           zkslt_sflight,
              lt_catalog                TYPE STANDARD TABLE OF  lvc_s_fcat,
              ls_catalog                LIKE LINE OF            lt_catalog,
              ls_layout                 type                    slis_layout_alv,
              lr_my_class               TYPE REF TO             zksl_cl_4_17_alv_grid_oo.
       CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
         EXPORTING
           i_structure_name = 'ZKSLT_SFLIGHT'
         CHANGING
           ct_fieldcat      = lt_catalog[].
    ************BULID LAYOUT
       ls_layout-no_input = 'X'.
       ls_layout-colwidth_optimize = 'X'.
       ls_layout-totals_text       = 'Totals(201)'.
       ls_layout-info_fieldname    = 'LINE_COLOR'.
       IF mr_gui_alv_grid IS INITIAL.  "-----------------------------------if----------------------&
         CREATE OBJECT: lr_custom_container
           EXPORTING
             container_name = 'DISPLAY',
             lr_my_class.
         CREATE OBJECT mr_gui_alv_grid
           EXPORTING
             i_parent = lr_custom_container.
         SET HANDLER lr_my_class->handle_dbl_click FOR mr_gui_alv_grid.
         CALL METHOD mr_gui_alv_grid->set_table_for_first_display
           EXPORTING
             i_structure_name = 'ZKSLT_SFLIGHT'
            is_layout        =   ls_layout
             i_save           = 'A'
           CHANGING
             it_outtab        = Mt_sflight
             it_fieldcatalog  = lt_catalog.
       ELSE.     "-------------------------------------------------ELSE---------------------&
         mr_gui_alv_grid->refresh_table_display( ) .
       ENDIF.
    ENDMETHOD.
    In handler i am trying to change fields color and call method display sending new out_table
    CALL METHOD me->display_alv
         CHANGING
           ct_fieldcat = lt_fieldcat.
    Please give me some easy advice how to do that.
    thank you in advice.

    Thank you Klaus for your reply,
    The problem is that I need to make this using classes.
    I tried to make my structure data with LVC_T_SCOL as you wrote,
    a field of table type LVC_T_SCOL in the structure of your output table
    DATA BEGIN OF lt_data. 
           INCLUDE STRUCTURE sflight.
           DATA cellcolors  TYPE lvc_t_scol .
       DATA END OF lt_data.
    TYPES: BEGIN OF mtt_tab.
    *         INCLUDE STRUCTURE ZKLST_sflight.  " I get error that I cannot use ref to abap dic
               INCLUDE TYPE ZKSLT_SFLIGHT.
               TYPES: cellcolors  TYPE lvc_t_scol ,
                 END OF mtt_tab.
    After making type mtt_tab
    i declare data   lt_tab                    TYPE STANDARD TABLE OF  mtt_tab.
    and when I try to copy table mt_sflight (it is atribut of calss) like below
    LOOP AT mt_sflight INTO ls_mt .
    *   READ TABLE lt_tab INDEX sy-tabix ASSIGNING <ls_tab>.
    *   MOVE-CORRESPONDING <ls_mt> TO <ls_tab>.
    *    UPDATE lt_tab FROM TABLE mt_sflight.
         MOVE-CORRESPONDING ls_mt to lt_tab.
       ENDLOOP.
    I am getting error "lt_tab is not internal str or table with header"
    Can you help me with this? 

  • Events in CL_GUI_ALV_GRID - PAI

    Hi All,
    I designed the screen like below
    I am using doc container with split one is for small ALV grid and next is for text editor. - Upper Portion of screen (Upper portion is splited vertically for alv grid and text editor)
    in the bottom of screen i have tabstrip in each tab it display the detailed ALV grid. - Bottom of screen
    When you click on upper portion of alv grid, the data is displayed in below tabs of ALV and long text in text editor.
    Tabstrip data is based on the upper portion of alv, it is like itemdata and header data.
    i used hotspot event in upper portion of alv to select the row and based on the row selected, bottom portion of data should display in the alv grids.
    But when i select the row it is not triggering the PAI event and it is triggering the PERFORM handle_hotspot_click USING e_row_id e_column_id es_row_no .
    how to trigger the PAI event when we click the double click or hot spot in alv grid.
    in alv tree we have set_registered_events but not alv grid.
    Please help me.
    Thanks,
    Srinivas Manai.

    Hi ,
    I guess the follwing code will be useful to you.
    Define a class. In that define a method for event hotspot_click of cl_gui_alv_grid like below.
    CLASS-METHODS:
          handle_hotspot_click
            FOR EVENT hotspot_click OF cl_gui_alv_grid
                IMPORTING e_row_id e_column_id es_row_no.
    In the method implementation write the desired code.
    Reward if useful
    Regards,
    Sravanthi.

  • How to print/save CL_GUI_ALV_GRID data using button in custom tool bar?

    Hi,
    I have a screen 9002 where I have used a CUSTOM CONTAINER and the screen 9002 is called from 9001.
    I am showing an ALV GRID in the CUSTOM CONTAINER by using CL_GUI_ALV_GRID.
    Screen 9002 also has 2 buttons (PF-STATUS): PRINT and SAVE in application tool bar. Now, I need to print the data of ALV and save the data in excel by pressing these 2 buttons respectively. Please let me know the way-out. If these functionalities can achieved by standard tool of the screen 9002, it will be also OK.
    Thanks
    Arghya

    Hi,
    Why don't you use the function "excel inplace" in the ALV?  With the ALV you have some buttons "SORT/TOTAL/FILTER... and you have PRINT and EXCEL INPLACE"?
    Do you use the method   call method g_grid->set_table_for_first_display in order to display your data alv?
    Best regards

  • Issue with editable alv using  cl_gui_alv_grid

    Hello all,
    its a table update program . user can save create new entry and delete the entires . the screen should be avaiable for multiple time inputs by the user . i achived it by  method handle double click and i am refreshing the scrren and making the alv for ready for input . but user wants the screen shoukld get refreshed automatically once user clicks on save button .
    how can I achive plz advise .
    I am working on ALV by cl_gui_alv_grid , I am using the followingmethods of the class
    1)  METHODS:  handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
                  IMPORTING e_object e_interactive.
    2)     METHODS:     handle_user_command FOR EVENT
                     user_command OF cl_gui_alv_grid
                     IMPORTING e_ucomm,
                     check_changed_data.
    3)     METHODS:      handle_double_click FOR EVENT
                      double_click  OF  cl_gui_alv_grid
                      IMPORTING e_row e_column.
    4)    METHODS: handle_data_changed
                  FOR EVENT data_changed OF cl_gui_alv_grid
                  IMPORTING er_data_changed.
    Thanks in advance .

    Hi Soumyaprakash,
    SAve is an user command . I want to have the values which are changed by the user and again the output should be ready for any actions like change the data , create new and delete any entry .
    basically  the alv output screen should be reday for inputs any number of times untill user clicks on back button .
    Thanks
    Basavaraj

Maybe you are looking for

  • Changing e-mail IDs- can no longer authorize music to my computer

    When I changed e-mail accounts, I also changed my Apple ID to reflect the new account. Now, music that I purchased under the old ID will not play. iTunes keeps asking me to authorize my computer - I do, iTunes store OKs it. Then I click "play" on the

  • Failing to open an Aperture library

    Aperture wouldn't open one of my libraries, citing a permission problem.  When I did a cmd-I for the library, I could see that 'Everyone' had only read access.  When I authenticated myself and tried to set this permission to 'read and write', I got a

  • How to call a concurrent program with some parameters in a stored procedure

    Hi All, I have made two procedures, xx_nidhi_proc1 and xx_nidhi_proc2. xx_nidhi_proc1 takes four parameters from front end and is registered as concurrent program in oracle apps and running fine alone. xx_nidhi_proc2 calls the concurrent program of x

  • Bridge CC crashes immediately after launch

    I re-installed Bridge several times. Also logged in and out on the cloud and resetted preferences. Bridge still crashes immediately without any error message. What can I do more?

  • Sony HDR-XR520VE + Projekt- und Exporteinstellungen

    Hallo, ich habe die Sony HDR-520VE und immer noch einige Fragen im Umgang mit dem HD-Videos erstellen. Die Sony HDR-520VE kann laut Datenblatt folgende Bildformate HD; FH (1920x1080i, 16 Mb/s)/HQ (9 Mb/s)/SP (7 Mb/s)/LP (5 Mb/s), SD; HQ (9 Mb/s)/SP (