Object ALV Grid - Line selection

Hi all.
Is there a way to force my grid to have allways a selected line.
If possible I would like to see the row marker and I don't want users to be able to select more than one line.
I tried all layout sel_mode... but I didn't find the result I desire...
Do you have an idea ?
Thanks a lot

Hi,
check this
    call method grid1->set_table_for_first_display
      exporting
        is_layout                     = gs_layout
        is_variant                    = gs_variant
        i_save                        = v_save
        i_default                     = v_default
        it_toolbar_excluding          = i_exclude[]
      changing
        it_outtab                     = i_output[]
        it_fieldcatalog               = i_fieldcat[]
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4.
    if sy-subrc ne 0.
      message id sy-msgid type sy-msgty number sy-msgno
                  with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    call method grid1->refresh_table_display.
* Creating object for the single clickevents
    if event_receiver_grid is initial.
      create object event_receiver_grid.
    endif.
    set handler event_receiver_grid->handle_toolbar_200 for grid1.
    call method grid1->set_toolbar_interactive.
    set handler event_receiver_grid->user_command_200 for grid1.
module user_command_0200 input.
  call method cl_gui_cfw=>dispatch.
  case ok_code.
    when c_ddno.
      perform f__display.
    when c_exit.
      perform f_exit_program.
    when c_back.
      perform f_exit_program.
    when c_canc.
      perform f_exit_program.
    when others.
  endcase.
  clear ok_code.
endmodule.                               " User_command_0200 INPUT
form f_display.
  refresh: i_sel_alvrows,
           i_dblclk.
  clear :  i_sel_alvrows,
           i_dblclk,
           wa_dblclk.
  v_dbcnt = c_0.
  call method grid1->get_selected_rows
    importing
      et_index_rows = i_sel_alvrows[].
  call method cl_gui_cfw=>flush.
  describe table i_sel_alvrows lines v_dbcnt.
  if i_sel_alvrows[] is initial.
    message i176.
  endif.
  if v_dbcnt gt 1.
    message i177.         " You cannot select more that one row
  else.
    loop at i_sel_alvrows into wa_sel_alvrows.
      read table i_output into wa_output index wa_sel_alvrows-index.
      if sy-subrc eq c_0.
        move-corresponding wa_output to wa_dblclk.
        append wa_dblclk to i_dblclk.
        clear: wa_dblclk.
      endif.
    endloop.
  endif.
endform.                                 
aRs

Similar Messages

  • Return from ALV  Grid to Selection screen

    hi,
    I want to go back from ALV grid to selection screen.
    I am using the following code:
    WHEN 'BACK'.
    CALL METHOD grid1->refresh_table_display.
    CALL METHOD grid1->free.
    CALL METHOD custom_container1->free.
    CALL SELECTION-SCREEN 1000.
    it is working,but when i press BACK button from selection screen to program it is showing ERROR IN FLUSH 4 Error.
    Also I tried with method FLUSH
    WHEN 'BACK'.
    CALL METHOD grid1->refresh_table_display.
    CALL METHOD grid1->free.
    CALL METHOD custom_container1->free.
    CALL METHOD cl_gui_cfw=>flush.
    it's still showing same Error.
    Please help on this.
    Regards,
    Sankar

    Hi,
    My grid name is grid1.
    I tried with :
    DATA grid1 TYPE REF TO cl_gui_alv_grid.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    e_grid = grid1.
    CALL METHOD grid1->check_changed_data.
    CALL METHOD grid1->refresh_table_display.
    LEAVE TO SCREEN 0.
    Even, I tried with declaring another grid : grid2
    DATA grid1 TYPE REF TO cl_gui_alv_grid.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    e_grid = grid1.
    CALL METHOD grid1->check_changed_data.
    CALL METHOD grid1->refresh_table_display.
    LEAVE TO SCREEN 0.
    In both cases, I am getting the following Error : OBJECTS_OBJREF_NOT_ASSIGNED

  • Objects alv grid

    Hi,
    I need to avoid the displaying the Crystal Report Functionality which is present in the drop down functionality of Excel Icon on ALV grid using object methods .
    Am using
    call method grid1->set_table_for_first_display
           exporting
                    i_save          = 'A'
                    is_variant      = gs_variant
                    is_print        = gs_print
                    is_layout       = gs_layout
                    i_default       = 'X'
                    changing it_fieldcatalog = gt_fieldcat
                    it_sort         = gt_sort
                    it_outtab       = itab_display[].
    The below code will explain Using 'REUSE_ALV_GRID_DISPLAY'. I am looking for object oriented method to do the same as below code .
    declare an internal table as below -
    Data: t_exclude type SLIS_T_EXTAB with header line.
    t_exclude-fcode = '&VCRYSTAL'.
    append t_exclude.
    clear t_exclude.
    Now the function code of the crystal report functionality will be appended to this internal table. pass this parameter to the 'IT_EXCLUDING' parameter of the FM 'REUSE_ALV_GRID_DISPLAY.
    below is a sample code.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = w_repid
    is_layout = fs_layout
    it_fieldcat = i_fieldcat
    it_excluding = t_exclude[]
    i_save = 'A'
    it_events = t_events
    TABLES
    t_outtab = t_iab
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    Thanks,
    Vind

    Hi John ,
                     Tried the code still not wroking , are there any more changes to include in the code  please let me know am trying to exclude the option Crystal Report'.
    -Exclude functions:
    zlv_exclude = cl_gui_alv_grid=>MC_FC_EXPCRDATA.
    append zlv_exclude to zlt_functions.
    zlv_exclude = cl_gui_alv_grid=>mc_fc_view_crystal.
    append zlv_exclude
    to zlt_functions.
      call method grid1->set_table_for_first_display
           exporting
                    i_save          = 'A'
                    is_variant      = gs_variant
                    is_print        = gs_print
                    is_layout       = gs_layout
                    i_default       = 'X'
                    it_toolbar_excluding = zlt_functions
                    changing it_fieldcatalog = gt_fieldcat
                    it_sort         = gt_sort
                    it_outtab       = itab_display[].
    Thanks,
    Vind

  • How can I hide the marker button in an ALV GRID line?

    Hi all,
    I am switching an old program from ALV LIST to ALV GRID. In the old list, I put a checkbox on each line to abilify the user to mark some lines. However, there are some lines that I don't want the user to select. In the list, I set the field for the box name to "*" (asterisk) and in the list, the checkbox is not input enabled.
    Now in the grid, this does not function any more. all lines are markable. How can I deactivate the marker function for some lines?
    Greetings
    Jörg

    Hi,
         use the below snippet in your code
      DATA: ls_celltab TYPE lvc_s_styl.
      REFRESH pt_celltab.
      IF p_mode EQ text-103.
    *§2a.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell
       to status "editable".
        ls_celltab-fieldname = c_character1.
        ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
        ls_celltab-style2 = cl_gui_alv_grid=>mc_style_f4.
        INSERT ls_celltab INTO TABLE pt_celltab.
        ls_celltab-fieldname = c_character2.
        ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
        ls_celltab-style2 = cl_gui_alv_grid=>mc_style_f4.
        INSERT ls_celltab INTO TABLE pt_celltab.
        ls_celltab-fieldname = c_character3.
        ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
        ls_celltab-style2 = cl_gui_alv_grid=>mc_style_f4.
        INSERT ls_celltab INTO TABLE pt_celltab.
        ls_celltab-fieldname = text-107.
        ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
        ls_celltab-style2 = cl_gui_alv_grid=>mc_style_f4.
        INSERT ls_celltab INTO TABLE pt_celltab.
        ls_celltab-fieldname = c_selectionid.
        ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
        INSERT ls_celltab INTO TABLE pt_celltab.
    Regards

  • ALV grid row selection event

    Hi,
    I have alv grid using cl_gui_alv_grid. I want to capture the row selection event and display the detail below the table.
    how do I capture the row selection.? I want to display the details below as and when the row selection changed.
    Regards
    Panneer

    More detail example, also works with multiple selections:
    data go_alv type ref to cl_gui_alv_grid.
    data go_handler type ref to lcl_event_receiver.
    *       CLASS lcl_event_receiver DEFINITION
    class lcl_event_receiver definition.
      public section.
        methods delayed_change_select
                for event delayed_changed_sel_callback of cl_gui_alv_grid.
    endclass.                    "lcl_event_receiver DEFINITION
    *       CLASS lcl_event_receiver IMPLEMENTATION
    class lcl_event_receiver implementation.
      method delayed_change_select.
        message 'Selection changed' type 'S'.
      endmethod.                    "delayed_change_selection
    endclass.                    "lcl_event_receiver IMPLEMENTATION
    *&      Module  STATUS_0100  OUTPUT
    module status_0100 output.
      data lt_fcat_lvc type lvc_t_fcat.
      data lt_fcat_alv type slis_t_fieldcat_alv.
      data ls_layo type lvc_s_layo.
      set pf-status 'MAIN'.
      if go_alv is initial.
        ls_layo-sel_mode = 'A'.
    *   ls_layo-sel_mode = 'B'.    "Also works
    *   ls_layo-sel_mode = 'C'.    "Also works
    *   ls_layo-sel_mode = 'D'.    "Also works
        call method go_alv->set_table_for_first_display
          exporting
            is_layout       = ls_layo
          changing
            it_fieldcatalog = lt_fcat_lvc
            it_outtab       = gt_data[].
        create object go_handler.
        set handler go_handler->delayed_change_select for go_alv.
        call method go_alv->register_delayed_event
          exporting
            i_event_id = cl_gui_alv_grid=>mc_evt_delayed_change_select.
      endif.
    endmodule.                 " STATUS_0100  OUTPUT

  • ALV Grid row selection possible options

    Hello Experts,
    I have an ALV Grid output with rows color codes based on certain status for each rows.Now when the user selects one or more lines to do the next process, what happens now as sap standard is the selected lines becomes highlighted ( kind of yellowish) and the selection button gets pressed.
    But what the user is requesting is ,lets say he selects one blue and another red line, then both becomes yellow (because of the SAP standard highlighting) ...he would like those line colors to be still red and blue and only the selection button pressed.
    Is there a way to do that is ALV grid? I'm trying to convince him to look at the status colum if he gets confused with what colors he selected or I will have to use a checkbox field as the first column and and hide the ALV selection option.
    But was curious to find if this is possible in ALV?Or any other suggestions to handle this requirement is welcome.
    Mat

    Hi Mat,
    I am curious if your user is so arogant when he buys a car too. Does he say to dealer "Sorry I don't want this gear lever to be placed here and here, I want it a litte bit higher. Can you please fix that?". This sounds like you are struggling with dumb user. I have never heard of someone complaining that the standard highlight is in wrong color. You already provided to him row colors, right? I think most of the users would be hugging you for such facilities.
    I think in your case as the user is inalterable you should go for the checkboxes as you say. This way maybe you will somehow satisfy his needs (as the row colors will be kept even during selection). Personally I wouldn't bother such requirements. As long as the program reports correct data, he should not complain at all.
    Good luck then
    Marcin

  • Event for edit fields in Object ALV grid

    Hi community,
    I've building an ALV Grid in a SubDynpro of Tabstrip...
    Any fields are edit.
    I would like refresh my internal table at data changed of ALV object but if not assign a field at F4 event this result 
    not refresh.
    Thanks everybody,
    Antonello

    Hi Antonello Didonna,
    Use this code, its working:-
    After the user edits any records and performs an action then place this code.
    Say when user presses a button with function code 'EXECUTE', and all the changes from the output screen in ALV reflects back to internal table.
    * handle the code execution based on the function code encountered
    CASE sy-ucomm.
    * when the function code is EXECUTE then process the selected records
      WHEN 'EXECUTE'.
    * to reflect the data changed into internal table
        DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
        IF ref_grid IS INITIAL.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              e_grid = ref_grid.
        ENDIF.
        IF NOT ref_grid IS INITIAL.
          CALL METHOD ref_grid->check_changed_data.
        ENDIF.
        " now your internal table data is changed as in ALV output
        " append your code
      WHEN OTHERS.
        " your code
    ENDCASE.
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

  • ALV GRID - Handling selected rows? Sorting in OUTTAB is different from ALV

    Dear Experts ,
    I have a transaction with ALV grid. I have defined several application specific functions to the ALV grid tool bar. My requirement is to handle the ALV tool bar functions only for the selected rows.
    Code snippet:
    DATA:
    LS_GRID_DS TYPE TYS_DS.
    TYPES: BEGIN OF TYS_DS.
    INCLUDE   TYPE TYS_ALVGRID.
    TYPES: STRUCNAME LIKE DD02L-TABNAME.
    TYPES: PRETAB    TYPE ZTAB_T,
           OUTTAB    TYPE ZTAB_T,
           OUTTAB_HIDDEN TYPE ZTAB_T,
           OUTTAB_SUM TYPE ZTAB_T,
           OUTTAB_ROLLBACK TYPE ZTAB_T,
           END OF TYS_DS.
      LOOP AT ls_grid_ds-marked_rows INTO ss_index_split
           WHERE rowtype IS INITIAL.
    ( Marked rows is correctly giving the row numbers of the highlighted rows)
    READ TABLE ls_grid_ds-outtab INTO ss_sel_rows_ds_split
                   INDEX ss_index_split-index.
    ISSUE : Sorting in ls_grid_ds-outtab internal table is different from ALV Grid display.
    Hence, though ls_grid_ds-marked_rows giving correct rows, I am not able to handle the my requirement correctly.
    Why sorting in gs_grid_ds-outtab is different from ALV display? How can they made in sync?
    Thank you in Advance.
    Sravan.
    Edited by: Raja Sravan on Jan 16, 2009 1:13 AM

    Hello Raja
    The OUTTAB is usually in sync with the display on the frontend grid control because it is a CHANGING parameter (of method SET_TABLE_FOR_FIRST_DISPLAY).
    Question: Do you "feed" ls_grid_ds-outtab to the parameter IT_OUTTAB of method SET_TABLE_FOR_FIRST_DISPLAY?
    If not then it is obvious why you get discrepancies.
    Regards
      Uwe

  • Recycling objects (alv-grid)

    Hi gurus.
    I must get seven different grids (seven different totals) starting from a gui.
    I wouldnu2019t wish to declare seven containers and seven alv-grid, I would prefer declare only one time both objects. So every time I use the FREE instruction and then the CREATE again:
      DATA: r_cont_2   TYPE REF TO cl_gui_custom_container,
            r_alv_2    TYPE REF TO cl_gui_alv_grid,
            gs_layout2 TYPE lvc_s_layo.
      IF NOT r_cont_2 IS INITIAL.
        FREE r_cont_2.
        CLEAR r_cont_2.
      ENDIF.
      IF NOT r_alv_2 IS INITIAL.
        FREE r_alv_2.
        CLEAR r_alv_2.
      ENDIF.
      CREATE OBJECT r_cont_2
         EXPORTING
             container_name = 'SCR_TXT2'.
      CREATE OBJECT r_alv_2
       EXPORTING
           i_parent = r_cont_2.
      CASE ok_code.
        WHEN '1'.
          CALL METHOD r_alv_2->set_table_for_first_display
           EXPORTING
               is_layout = gs_layout2
           CHANGING
               it_fieldcatalog = it_fdcat  u201C <<< Changed for table 1!!!
               it_outtab = it_tab1         u201C <<< Table 1
           EXCEPTIONS
               OTHERS = 4.
        WHEN '2'.
          CALL METHOD r_alv_2->set_table_for_first_display
           EXPORTING
               is_layout = gs_layout2
           CHANGING
               it_fieldcatalog = it_fdcat  u201C <<< Changed for table 2!!!
               it_outtab = it_tab2         u201C <<< Table 2
           EXCEPTIONS
               OTHERS = 4.
    u2026u2026..
    ENDCASE.
    When I get the first output,  I get the first grid correct (any table, everything is ok). When I get the second output and over, I see the first table again. In debug mode I can see the second new table correctly when I call the method, and I can see the objects full before the FREE instruction, and empty after.
    Is there a solution, or must I declare seven alv-grid?
    Must I declare seven containers too?
    Thanks for you replies.

    Hi ,
    Use one instance for alv and container . Change fieldcat , layout using SET_FRONTEND_FIELDCATALOG
    SET_FRONTEND_LAYOUT methods , than refresh grid.

  • WEB DYNPRO ALV GRID  GET SELECTED ROWS...

    I'm reusing component ALV Grid ...
    How can i get selected rows...

    Hi Stephan,
    In order to get the multiple rows which were selected by the user you will just have to call the get_selected_elements method of if_wd_context_node. So as you can see its no different from how you would get the multiple rows selected by the user in a table ui element. First get the reference of the node which you have used to bind to the ALV & then call this method on it.
    METHOD get_selected_rows .
      DATA: temp TYPE string.
      DATA: lr_node TYPE REF TO if_wd_context_node,
                wa_temp  TYPE REF TO if_wd_context_element,
                ls_node1 TYPE wd_this->element_node_flighttab,
                lt_node1 TYPE wd_this->elements_node_flighttab.
      lr_node = wd_context->get_child_node( name = 'NODE_FLIGHTTAB' ).
    " This would now contain the references of all the selected rows
      lt_temp = lr_node->get_selected_elements( ).
        LOOP AT lt_temp INTO wa_temp.
    " Use the references to get the exact row data
          CALL METHOD wa_temp->get_static_attributes
            IMPORTING
              static_attributes = ls_node1.
          APPEND ls_node1 TO lt_node1.
          CLEAR ls_node1.
        ENDLOOP.
    ENDMETHOD.
    Hope this helps resolve your problem.
    Regards,
    Uday

  • Display alv grids in selection screen based on the user event

    Hi All,
    I am workign on displaying ALV in same selection screen.I am able to display the ALV in selection screen.
    But i have 2 buttons in my selection screen 'Create' and 'change'.
    When i click on create i need  with some type of data and when i click on 'change' my alv grid another type of data.Ex: if i click on crate mara data should be dispalyed when i click on change makt table data should be dispalyed and also i have user defined buttons are in my grids.
    So i have used 2 containers to dispaly to different data.I am able to display the perfectly but the problem is first time when i click on create the grid is displaying when i click on change button  the create alv grid is displaying down and change data is dispalying up.
    I need only one alv grid at a time.Can anybody please let me know how can i do this.
    Thanks,
    Taragini

    Hello,
    Also I would suggest if it is relevant data maintain in one interntal table and show/hide based on condition
    through fieldcatalog (NO_OUT) parameter.
    Thanks

  • Need sample interactive ALV(At line selection event...)

    Hello Experts,
    I have a requirement that when I show the results, there will be 3 hotspots for
    the sales order, delivery order and invoice number. So for example I click on
    the sales order it will open a pop up window that will show additional information, etc.
    So when the user clicks all 3 hotspots it will show 3 popup windows.
    How do I do this guys? simple examples will be highly appreciated.Thank you guys and take care!

    Hi,
    This is the sample report for INTERACTIVE REPORT.
    REPORT  YMS_INTERACTIVETEST LINE-SIZE 50 NO STANDARD PAGE HEADING.
    TABLES: VBAP,KNA1,VBAK.
    SELECT-OPTIONS: CUST FOR KNA1-KUNNR.
    DATA: BEGIN OF ITAB OCCURS 0,
            KUNNR LIKE KNA1-KUNNR,
            NAME1 LIKE KNA1-NAME1,
            VBELN LIKE VBAK-VBELN,
            AUDAT LIKE VBAK-AUDAT,
            AUART LIKE VBAK-AUART,
            POSNR LIKE VBAP-POSNR,
            POSAR LIKE VBAP-POSAR,
          END OF ITAB.
    DATA: ITAB1 LIKE ITAB OCCURS 0 WITH HEADER LINE.
    INITIALIZATION.
    START-OF-SELECTION.
      SELECT KNA1KUNNR KNA1NAME1 INTO CORRESPONDING FIELDS OF TABLE ITAB1
              FROM KNA1 WHERE KNA1~KUNNR IN CUST.
      LOOP AT ITAB1.
        WRITE:/10 ITAB1-KUNNR HOTSPOT, 30 ITAB1-NAME1.
        HIDE: ITAB1-KUNNR.
      ENDLOOP.
    AT LINE-SELECTION.
      CASE SY-LSIND.
        WHEN '1'.
          SELECT KNA1KUNNR VBAKVBELN VBAKAUDAT VBAKERDAT INTO CORRESPONDING FIELDS OF TABLE ITAB1
          FROM KNA1 INNER JOIN VBAK ON KNA1KUNNR = VBAKKUNNR.
          LOOP AT ITAB1.
            WRITE:/ ITAB1-VBELN HOTSPOT, ITAB1-AUDAT, ITAB1-AUART.
            HIDE: ITAB1-VBELN, ITAB1-AUDAT, ITAB1-AUART.
          ENDLOOP.
        WHEN '2'.
          SELECT VBAKVBELN VBAPPOSNR VBAP~POSAR
          INTO CORRESPONDING FIELDS OF TABLE ITAB1 FROM VBAK INNER JOIN VBAP ON VBAKVBELN = VBAPVBELN.
          LOOP AT ITAB1.
            WRITE:/ ITAB1-POSNR, ITAB1-POSAR.
          ENDLOOP.
      ENDCASE.
    TOP-OF-PAGE.
      WRITE:/ SY-VLINE,TEXT-001 COLOR COL_NEGATIVE.
      ULINE.
    Thanks,
    Sankar M

  • Can i raise any event on the ALV  GRID row selection.

    Hi All ,
            Is there any way to trigger any event upon the selction of the ALV <b>GRID</b> rows?
    Suppose i have 2 grid controls  1 for Header and the other for corresponding line items . I would have already the header data (differnt document headers)  populated , upon selecting (i don't want any user click or button click) one of the header i want to do some changes to the corresponding line times for the header data selected...
    Please give me some tips on how to  go about on this .
    Thanks,
    ALFH

    <b>upon selecting ?</b>
    how the user will select , since you dont want user click or button click?
    one option is to have hotspot, but again user has to click .
    Regards
    Raja

  • Partial grouping of ALV grid lines

    Hello.
    I have the following table and I want to do a partial grouping of the lines:
    Order number | Vendor | Oder line | Order quantity | Total quatity shipped | Track ID | Shipped |
    418          | ABC    | 01        | 08             | 00                    | TR007    | 08      |
    418          | ABC    | 02        | 10             | 05                    | TR008    | 05      |
    418          | ABC    | 02        | 10             | 05                    | TR009    | 05      |
    418          | ABC    | 03        | 13             | 13                    | TR010    | 13      |
    Now, if the first three column values of a line are equal, then the equal lines should be partially grouped. In this sample line 2 and 3 are equal, so the result of the grouping should look like this:
    Order number | Vendor | Oder line | Order quantity | Total quatity shipped | Track ID | Shipped |
    418          | ABC    | 01        | 08             | 00                    | TR007    | 08      |
                 |        |           |                |                       | TR008    | 05      |
    418          | ABC    | 02        | 10             | 10                    ----------------------
                 |        |           |                |                       | TR009    | 05      |
    418          | ABC    | 03        | 13             | 13                    | TR010    | 13      |
    I've already tried to sort the columns, but then I get the following and this is not what I need:
    Order number | Vendor | Oder line | Order quantity | Total quatity shipped | Track ID | Shipped |
    418          | ABC    | 01        | 08             | 00                    | TR007    | 08      |
                 |        ---------------------------------------------------------------------------
                 |        | 02        | 10             | 05                    | TR008    | 05      |
                 |        |           ---------------------------------------------------------------
                 |        |           | 10             | 05                    | TR009    | 05      |
                 |        ---------------------------------------------------------------------------
                 |        | 03        | 13             | 13                    | TR010    | 13      |
    Can someone help me to solve this problem?
    Regards,
    Benjamin

    Hi Selva
    Normally my alv output like this
      Deisp date Packing Material Noof packing
       18/15/2010   hdp                 5
       18/05/2010    pail                10
       20/052010     hdp                25
    I need tha alv out pu like this
         Dispatch date  18/05/2010
                            hdp           5
                            pail           10
         Dispatch date 20/05/2010
                           hdp          25

  • How to make the first row  selected before the display of ALV grid

    Hello Experts,
    I created a ALV grid using custom container in a screen . Now i want do the follwing:
    1. i want that, the  <b>first line must be selected before the display of ALV.</b>
    2. I have selection buttons . But i dont want the multiselect button and the  
        standard  toolbar in the ALV grid.
    Could any one please help me regarding the above?
    Thanks & Regards
    Sudhansu

    can u pls explain in more details with an example?
    I am telling u the scenario.
    1. i have a screen(Modal dialog Box)  containing ALV grid with selection buttons for each row  (top part) and a subscreen(second part).
          Now when i click on a selection button, it will display the corresponding values in the subscreen.
        When this screen will display for the first time , then first row of the ALV grid should be selected and the corresponding values should be displayed in  the subscreen.
    i   wrote the following code in the PAI. But when i select a record its not triggering the PAI.
    DATA:
         gi_index_rows TYPE lvc_t_row, " Internal table for indexes of selected rows
         g_selected_row LIKE lvc_s_row, " Information about 1 row
         l_lines TYPE i.
      CLEAR g_wa_vdmeko.
    *get selected row
      CALL METHOD g_alv_grid->get_selected_rows
        IMPORTING
          et_index_rows = gi_index_rows.
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      LOOP AT gi_index_rows INTO g_selected_row.
        READ TABLE g_int_vdmeko INDEX g_selected_row-index INTO g_wa_vdmeko.
        SELECT SINGLE  *
               FROM vdmepov
               WHERE bukrs = g_wa_vdmeko-bukrs AND
                     styp  = g_wa_vdmeko-styp  AND
                     sbez  = g_wa_vdmeko-sbez  AND
                     svym  = g_wa_vdmeko-svym  AND
                     svnr  = g_wa_vdmeko-svnr.
      ENDLOOP.
    I am displayinng the ALV using method "set_alv_for_first_display".
    Please help if u have any idea..................
    Thanks
    Sudhansu

Maybe you are looking for