Lead selection in ALV grid

Hi.
I am usinmg Set_table_for_first_display to display the ALV grid.
In my ALV grid, I have a field as Flag which will show as a lead selection in the grid. Such that I have designed the field catelog and layout.
When I select a row and click on DISPLAY button, it has to display the details.
This I am able to do through GR_GRID->GET_SELECTED_ROWS() .
But after displaying the data the cursor is not in the same row. Lead selection is cleared.
I manually tied to set the FLag as X and updated the table. Even then Lead selection is not coming in the row.
Suggestion  is very much helpul for this.
Thanks,
Sumithra

DOne by using Set_selected_rows method

Similar Messages

  • Capture multiple rows on lead select in ALV Web dynpro

    Hi all,
    I am trying to capture the selected rows on lead select in ALV.
    I have tried with supply function and ON_LEAD_SELECT event of ALV.
    When I am trying this I am able to capture only one row but not multiple.
    I don't want use any extra actions or buttons to get the selected rows, it must be possible only through any ALV events or using supply function.
    BR,
    Eshwar

    Hi,
    You use this to set to on_select?
    DATA:
         lo_config_table        TYPE REF TO cl_salv_wd_config_table.
       lo_config_table->if_salv_wd_table_settings~set_on_select_enabled( ).
    And in the component controller create a new method for event_handler
    This method will executed
    Hope this works
    Maarten

  • Select From ALV Grid

    I'm hoping that someone can help.
    I have a program that displays an ALV grid. I want the user to be able to select one or more lines from this grid and then to pop up a box to allow them to input a new date and then update this date via BAPI.
    Could any one please point me in the right direction of how to get the info of the lines selected by the user into another internal table so that I can merge this with my new date info to run the BAPI.
    Thanks

    Which version of ALV technology do you use (REUSE_ALV, OO ALV, SALV ? ) <br />
    <br />
    e.g. for CL_GUI_ALV_GRID<br />
    - Use the <a class="jive-link-external" href="http://help.sap.com/saphelp_erp2004/helpdata/en/ef/a2e9eff88311d2b48d006094192fe3/frameset.htm" target="_newWindow">SEL_MODE</a> field of the layout to enable multiple row selection (also add a check box in internal table)<br />
    - you have method <a class="jive-link-external" href="http://help.sap.com/saphelp_erp2004/helpdata/EN/0a/b55312d30911d2b467006094192fe3/frameset.htm" target="_newWindow">GET_SELECTED_ROWS</a> and CHECK_CHANGED_DATA <br />
    <br />
    <i>Also, don't hesitate to use the search tool.there are sample in wiki like [Capture single and multiple row selction in ALV |http://wiki.sdn.sap.com/wiki/display/Snippets/Capturesingleandmultiplerowselctionin+ALV]</i><br />
    <br />
    Regards,<br />
    Raymond

  • Single selection in ALV Grid Control

    hi,
    I want to enable single row selection only in the alv grid displayed.
    attribute sel_mode of layout doesnt help.
    Can anybody provide me a solution.
    Regards,
    Auro

    Hello,
    Try this:
    DATA:gs_layout type lvc_s_layo.
    gs_layout-NO_ROWMARK = 'X'.
    call method g_grid->set_table_for_first_display
           exporting is_layout             = gs_layout
    Regards,
    Beejal
    **reward if this helps

  • How do I find an event which is triggered on line selection for ALV grid?

    Hi,
    I'm trying to find an event which is triggered when a user selects a row in the ALV grid. I want to add my own code in to add up the total values of selected lines, but can't find any event which will trigger my method.
    I found CLICK_ROW_COL but it's protected so when I try and add a method for it:
      PROTECTED SECTION.
        METHODS:
        select_row
            FOR EVENT click_row_col OF cl_gui_alv_grid.
    I get the syntax error:
    Access to protected event "CLICK_ROW_COL" is not allowed.
    Am I using the right event? Am I implementing it correctly?
    Any help appreciated. Thanks in advance.
    Gill

    I chose to solve this by removing the line select buttons from the ALV and replacing them with a checkbox defined as a hotspot.  I then used EVENT hotspot_click FROM cl_gui_alv_grid to highlight the line and change my totals on a single click.

  • Multi Line Selection with ALV Grid

    Dear all
    what do I have to do to make multiple line selection available in an ALV Grid (Version 4.7)?
    Herbert

    Hi Herbert again,
    Once you displayed your alv output display, then select rows in the alv display.
    then when you click for interactive buttion (ie. like Refresh functionality), In debug mode you can see internal table with Sell field active (i.e. marked "X") which you have selected.
    e.g.
    FORM user_command USING lv_ucomm TYPE sy-ucomm ls_selfield TYPE slis_selfield.
      DATA:
            lv_ref_grid   TYPE REF TO cl_gui_alv_grid.
      CLEAR : gv_tcode.
    *-- to ensure that only new processed data is displayed
      IF lv_ref_grid IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = lv_ref_grid.
      ENDIF.
      IF NOT lv_ref_grid IS INITIAL.
        CALL METHOD lv_ref_grid->check_changed_data.
      ENDIF.
      CASE lv_ucomm.
        WHEN '&IC1'.
          IF ls_selfield-fieldname = 'MATNR'.
            READ TABLE gt_gi INTO gs_gi INDEX ls_selfield-tabindex.
            IF sy-subrc = 0.
              gv_tcode = 'MMBE'.
              SET PARAMETER ID 'MAT' FIELD gs_gi-matnr.
              CALL TRANSACTION gv_tcode AND SKIP FIRST SCREEN. "#EC CI_CALLTA "MMBE
            ENDIF.
          ENDIF.
        WHEN 'COPY'.
          LOOP AT gt_gi INTO gs_gi WHERE sel = 'X'.
            gs_gi-sel = ' '.
            APPEND gs_gi TO gt_gi.
            CLEAR gs_gi.
          ENDLOOP.
        WHEN 'POST'.
          REFRESH : gt_error[].
        WHEN OTHERS.
      ENDCASE.
    ENDFORM.                    " USER_COMMAND
    I hope you clear now.
    Feel free to ask any doubts.
    Thanks and regards,
    Vijay

  • Single row select in ALV Grid

    HI,
    I want to make my ALV Grid only single row select enabled, can some one guide me which variable should be set for the same.
    Thanks and Regards,
    Harsh

    If you are using OO for alv then
      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.
    * Info message : Please select a row
        message i176.                        " Please select a row'.
      endif.
      if v_dbcnt gt 1.
    * Info message : Multiple Row Selection not  possible
        message i177.                        " Multiple Row Selection not
        " possible'
      endif.
    or if your using REUSE then
    form user_command using p_ucomm type sy-ucomm
                         rs_selfield type  slis_selfield.
    " Check the rs_selfield-tabindex value here
    " you may get some clue here
    endform.

  • Layout selection in ALV grid.

    Hi All,
    I have one requirement to change the existing program. Currently it is displaying all the fields in the ALV grid. Now i need to make the selection screen with two options for Header data selection and Item data selection. So now if I select the Header data only to be displayed (in the coding I made the changes in the field catalog and hidded some fields using
                                 WHEN 'FKART'
                                  if p_header = 'X'.
                                   <fc>-no_out = 'X'.
                                  endif.
    so now it should not display the FKART field in the output. My question is, If I select some different layout in the ALV GRID  even this hidden header fields are also getting displayed. Please help me and give me the solution for this.
    Regards,
    AL.

    Hi Anbu,
    You can try like this,  Modify your Col Position like this...
    IF P_HEARDER = 'X'.
      COL_POS = COL_POS + 1.
      FIELDCATALOG-COL_POS     = COL_POS.
      FIELDCATALOG-FIELDNAME   = 'FKART'.
      FIELDCATALOG-OUTPUTLEN   = 10.
      FIELDCATALOG-NO_OUT     = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
    ELSE.
      COL_POS = COL_POS + 1.
      FIELDCATALOG-COL_POS     = COL_POS.
      FIELDCATALOG-FIELDNAME   = 'FKART'.
      FIELDCATALOG-OUTPUTLEN   = 10.
      APPEND FIELDCATALOG TO FIELDCATALOG.
    ENDIF.
    Thanks & regards,
    Dileep .C

  • Row Selection in ALV Grid created using CL_GUI_ALV_GRID

    Hi,
    I have ALV grid using cl_gui_alv_grid. I want to capture the row selection and display the selected rows in 2nd ALV grid (using cl_gui_alv_grid).
    Method CALL METHOD Grid->get_selected_rows giving right no. of selected records first time and process these records by POST button and hence shows these records in next alv grid. but when i came back to 1st ALV by pressing BACK button on 2nd ALV then if I again select records on the same 1st ALV grid the same Method CALL METHOD Grid->get_selected_rows fires again. but this times it wouldn't give the selected records. I mean first time this gives me correct no. of selected records but 2nd time wouldn't.
    how do I capture the row selection.?
    Kindly suggest me. helpful answer will be appreciated.
    Thanx in Advance.
    Robin

    Hi,
    Write this code, you have to free the container.
    MODULE user_command_0101 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
           c_container->free( ).
           c_container1->free( ). " this is the container of secondary list.
           clear: r_grid,  r_grid1, c_container, c_container1.
          LEAVE TO SCREEN 100.
      ENDCASE.
    Regards and Best wishes.

  • Multiple Selection in ALV grid

    HI All,
    I am displaying output using ALV grid method. On screen i am selecting multiple rows & based on selection i want process further. How can i determine whcih rows user has selected ?
    Regards,
    Rahul

    Hi,
    In IT_FIELDCAT you can pass one field with attributes of check box.
    for example.
    Declare:
    DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
    FIELDCAT_LN LIKE LINE OF GT_FIELDCAT.
    Pass the below values.
    FIELDCAT_LN-FIELDNAME = 'CHECK'.
    FIELDCAT_LN-TABNAME = 'ITAB1'.
    FIELDCAT_LN-KEY = ' '. "SUBTOTAL KEY
    FIELDCAT_LN-NO_OUT = ' '.
    FIELDCAT_LN-SELTEXT_L = 'Check Box'.
    FIELDCAT_LN-CHECK-BOX = 'X'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    <b>rEWARD IF USEFULL</b>

  • How to sense which lines are selected in ALV grid with Reuse FM.

    Hi!;
    with the help of the forum I have developed a ALV grid whose first column is a editable checkbox.
    The user click some of the lines on the ALV grid and I added an additional button on the tooolbar named "ACCEPT".
    When the button ACCEPT is clicked I want to get the lines whose checkbox is checked.
    How can I do that ?
    Making the first column (Checkbox column ) hotspot of no help.
    Would you please help me ?
    Erkan
    Moderator message: please search for available information/documentation.
    Edited by: Thomas Zloch on Sep 14, 2011 3:05 PM

    hi,
    you can refer the below link:
    /thread/492162 [original link is broken]

  • LEAD SELECT on ALV table...

    Hi All,
         I am using ALV table in my application. I am able to display data into ALV table.
         But how to give LEADSELECT event to that ALV table..?
       Can anyone please help me.
       Thanks in Advance.

    Hi,
    In the METHODS tab, give any name and select EVENT HANDLER and for that ALV select the ONLEADSELECT event in the F4 help for events.
    Name                       Method Type              Desc               EVENT                                                                         ALV Name
    ON_LEAD_SELECT Event Handler     On lead     ON_LEAD_SELECT     INTERFACECONTROLLER  ALV_DETAIL_REV
    Regards,
    Lekha.

  • Default row selected in alv grid

    Hi Everyone,
    I have couple of alv screens. By default the topmost cell is highlighted in the first grid, the data of second grid is dependant on the first one. So if the topmost record is selected by default in first grid, i want to highlight its corresponding records in the second grid.
    How do I achieve this.
    Any help on this will be of great use to me.
    Thanks in advance,
    Prashant.

    In PAI,
    MODULE user_command_9001 INPUT.
      REFRESH i_fieldrows.
    <b>CALL METHOD o_alvgrid->get_selected_rows
                  IMPORTING
                  et_index_rows = i_fieldrows.</b>  LOOP AT i_fieldrows INTO w_fieldrows.
        READ TABLE i_output INTO w_output INDEX w_fieldrows-index.
      ENDLOOP.
      CASE sy-ucomm.
        WHEN 'EXIT' OR  'CANC'.
    WHEN 'MD04'.
          IF w_output-matnr IS INITIAL.
            MESSAGE i001 WITH text-e07.
          ELSE.
            SET PARAMETER ID 'MAT' FIELD w_output-matnr.
            SET PARAMETER ID 'WRK' FIELD w_output-werks.
            CALL TRANSACTION 'md04' AND SKIP FIRST SCREEN .
          ENDIF.
        WHEN OTHERS.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    Similarly in the next screen PAI,
    use
    CALL METHOD o_alvgrid->set_selected_rows
                  IMPORTING
                  et_index_rows = i_fieldrows.

  • At Line Selection on ALV Grid

    Hi guys: I need to double click on a field in the ALV report that should bring up another structure (which I have created) called s_det
    s_det has only document number & company code.
    Please provide the code for doing this in ALV. I know I cant use At Line Selection. Please give me simple code.
    thanks so much
    Brian

    Hi
    take this as an example for ur solution.
    In this if we double click on first level display then it opens second level display.Just have a look on the following code.
    This is Interactive ALV report of displaying each row with colours and Headers.
    TYPE-POOLS SLIS.
    TYPES: BEGIN OF I_EKKO,
           EBELN LIKE EKKO-EBELN,
           AEDAT LIKE EKKO-AEDAT,
           BUKRS LIKE EKKO-BUKRS,
           BSART LIKE EKKO-BSART,
           LIFNR LIKE EKKO-LIFNR,
           L_COLOR(4) TYPE C,
           END OF I_EKKO.
    DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
          WA_EKKO TYPE I_EKKO.
    TYPES: BEGIN OF I_EKPO,
           EBELN LIKE EKPO-EBELN,
           EBELP LIKE EKPO-EBELP,
           MATNR LIKE EKPO-MATNR,
           MENGE LIKE EKPO-MENGE,
           MEINS LIKE EKPO-MEINS,
           NETPR LIKE EKPO-NETPR,
           L_COLOR1(4) TYPE C,
           END OF I_EKPO.
    DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
          WA_EKPO TYPE I_EKPO.
    DATA: V_REPID TYPE SY-REPID,
          I_FLDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FLDCAT TYPE SLIS_FIELDCAT_ALV,
          I_EVENTS TYPE SLIS_T_EVENT,
          WA_EVENT TYPE SLIS_ALV_EVENT,
          GD_LAYOUT TYPE SLIS_LAYOUT_ALV,
          GD_LAYOUT1 TYPE SLIS_LAYOUT_ALV.
    DATA: I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST ALV REPORT',
          I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDARY ALV REPORT'.
    INITIALIZATION.
    V_REPID = SY-REPID.
    PERFORM FLDCATALOG.
    PERFORM CALL_EVENTS.
    PERFORM POPULATE_EVENT.
    PERFORM BLD_LAYOUT.
    PERFORM BLD_LAYOUT1.
    START-OF-SELECTION.
    PERFORM DATA_RETRIEVAL.
    PERFORM DISPLAY_ALV_REPORT.
    FORM FLDCATALOG.
    WA_FLDCAT-TABNAME = 'IT_EKKO'.
    WA_FLDCAT-FIELDNAME = 'EBELN'.
    WA_FLDCAT-SELTEXT_M = 'PO NUMBER'.
    APPEND WA_FLDCAT TO I_FLDCAT.
    CLEAR WA_FLDCAT.
    WA_FLDCAT-TABNAME = 'IT_EKKO'.
    WA_FLDCAT-FIELDNAME = 'AEDAT'.
    WA_FLDCAT-SELTEXT_M = 'DATE'.
    APPEND WA_FLDCAT TO I_FLDCAT.
    CLEAR WA_FLDCAT.
    WA_FLDCAT-TABNAME = 'IT_EKKO'.
    WA_FLDCAT-FIELDNAME = 'BUKRS'.
    WA_FLDCAT-SELTEXT_M = 'DOCUMENT TYPE'.
    APPEND WA_FLDCAT TO I_FLDCAT.
    CLEAR WA_FLDCAT.
    WA_FLDCAT-TABNAME = 'IT_EKKO'.
    WA_FLDCAT-FIELDNAME = 'LIFNR'.
    WA_FLDCAT-SELTEXT_M = 'VENDOR CODE'.
    APPEND WA_FLDCAT TO I_FLDCAT.
    CLEAR WA_FLDCAT.
    ENDFORM.
    FORM CALL_EVENTS.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
    IMPORTING
       ET_EVENTS             = I_EVENTS
    EXCEPTIONS
      LIST_TYPE_WRONG       = 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.
    FORM POPULATE_EVENT.
    *READ TABLE I_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
    *IF SY-SUBRC = 0.
    WA_EVENT-FORM = 'TOP_OF_PAGE'.
    MODIFY I_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME = WA_EVENT-FORM.
    *ENDIF.
    READ TABLE I_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
    IF SY-SUBRC = 0.
      WA_EVENT-FORM = 'USER_COMMAND'.
      MODIFY I_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME = WA_EVENT-NAME.
    ENDIF.
    ENDFORM.
    FORM BLD_LAYOUT.
    GD_LAYOUT-INFO_FIELDNAME = 'L_COLOR'.
    ENDFORM.
    FORM DATA_RETRIEVAL.
    DATA LN_COLOR(1) TYPE C.
    SELECT EBELN AEDAT BUKRS BSART LIFNR
    FROM EKKO INTO TABLE IT_EKKO.
    LOOP AT IT_EKKO INTO WA_EKKO.
    LN_COLOR = LN_COLOR + 1.
    IF LN_COLOR = 8.
      LN_COLOR = 1.
    ENDIF.
    CONCATENATE 'C' LN_COLOR '11' INTO WA_EKKO-L_COLOR.
    MODIFY IT_EKKO FROM WA_EKKO.
    ENDLOOP.
    ENDFORM.
    FORM DISPLAY_ALV_REPORT.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = V_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
       I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = I_TITLE_EKKO
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         = GD_LAYOUT
       IT_FIELDCAT                       = I_FLDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
       I_SAVE                            = 'A'
      IS_VARIANT                        =
       IT_EVENTS                         = I_EVENTS
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = IT_EKKO
    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.
    FORM TOP_OF_PAGE.
    DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
          WA_HEADER TYPE SLIS_LISTHEADER.
    WA_HEADER-TYP = 'H'.
    WA_HEADER-INFO = 'THIS IS MY FIRST ALV'.
    APPEND WA_HEADER TO T_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = T_HEADER
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.
    FORM USER_COMMAND USING R_COMM TYPE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_COMM.
        WHEN '&IC1'.
          READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
          PERFORM FLDCAT_EKPO.
          PERFORM CALL_EVENT_EKPO.
         PERFORM POPULATE_EVENT_EKPO.
          PERFORM DATA_RETRIEVAL_EKPO.
          PERFORM DISPLAY_ALV_REPORT_EKPO.
      ENDCASE.
    ENDFORM.
    FORM FLDCAT_EKPO.
    WA_FLDCAT-TABNAME = 'IT_EKPO'.
    WA_FLDCAT-FIELDNAME = 'EBELN'.
    WA_FLDCAT-SELTEXT_M = 'PO NUMBER'.
    APPEND WA_FLDCAT TO I_FLDCAT.
    CLEAR WA_EKPO.
    WA_FLDCAT-TABNAME = 'IT_EKPO'.
    WA_FLDCAT-FIELDNAME = 'EBELP'.
    WA_FLDCAT-SELTEXT_M = 'LINE NO'.
    APPEND WA_FLDCAT TO I_FLDCAT.
    CLEAR WA_EKPO.
    WA_FLDCAT-TABNAME = 'IT_EKPO'.
    WA_FLDCAT-FIELDNAME = 'MATNR'.
    WA_FLDCAT-SELTEXT_M = 'MATERIAL NUMBER'.
    APPEND WA_FLDCAT TO I_FLDCAT.
    CLEAR WA_FLDCAT.
    WA_FLDCAT-TABNAME = 'IT_EKPO'.
    WA_FLDCAT-FIELDNAME = 'MENGE'.
    WA_FLDCAT-SELTEXT_M = 'QUANTITY'.
    APPEND WA_FLDCAT TO I_FLDCAT.
    CLEAR WA_FLDCAT.
    WA_FLDCAT-TABNAME = 'IT_EKPO'.
    WA_FLDCAT-FIELDNAME = 'MEINS'.
    WA_FLDCAT-SELTEXT_M = 'BASE UNIT OF MEASURE'.
    APPEND WA_FLDCAT TO I_FLDCAT.
    CLEAR WA_FLDCAT.
    WA_FLDCAT-TABNAME = 'IT_EKPO'.
    WA_FLDCAT-FIELDNAME = 'NETPR'.
    WA_FLDCAT-SELTEXT_M = 'PRICE'.
    APPEND WA_FLDCAT TO I_FLDCAT.
    CLEAR WA_FLDCAT.
    ENDFORM.
    FORM CALL_EVENT_EKPO.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
    IMPORTING
       ET_EVENTS             = I_EVENTS
    EXCEPTIONS
      LIST_TYPE_WRONG       = 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.
    *FORM POPULATE_EVENT_EKPO.
    *READ TABLE I_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
    *IF SY-SUBRC = 0.
    WA_EVENT-FORM = 'TOP_OF_PAGE'.
    MODIFY I_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME = WA_EVENT-FORM.
    *ENDIF.
    *ENDFORM.
    FORM BLD_LAYOUT1.
    GD_LAYOUT1-INFO_FIELDNAME = 'L_COLOR1'.
    ENDFORM.
    FORM DATA_RETRIEVAL_EKPO.
    DATA LN_COLOR1(1) TYPE C.
    SELECT EBELN EBELP MATNR MENGE MEINS NETPR
    INTO TABLE IT_EKPO
    FROM EKPO.
    LOOP AT IT_EKPO INTO WA_EKPO.
    LN_COLOR1 = LN_COLOR1 + 1.
    IF LN_COLOR1 = 8.
      LN_COLOR1 = 1.
    ENDIF.
    CONCATENATE 'C' LN_COLOR1 '11' INTO WA_EKPO-L_COLOR1.
    MODIFY IT_EKPO FROM WA_EKPO.
    ENDLOOP.
    ENDFORM.
    FORM DISPLAY_ALV_REPORT_EKPO.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = V_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE1'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = I_TITLE_EKPO
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         = GD_LAYOUT1
       IT_FIELDCAT                       = I_FLDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
       I_SAVE                            = 'A'
      IS_VARIANT                        =
       IT_EVENTS                         = I_EVENTS
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = IT_EKPO
    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.
    FORM TOP_OF_PAGE1.
    DATA: T_HEADER1 TYPE SLIS_T_LISTHEADER,
          WA_HEADER1 TYPE SLIS_LISTHEADER.
    WA_HEADER1-TYP = 'H'.
    WA_HEADER1-INFO = 'SECONDARY ALV LEVEL'.
    APPEND WA_HEADER1 TO T_HEADER1.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = T_HEADER1
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               = .
    ENDFORM.
    reward points,if it is useful.
    Thanks,
    chandu.

  • How to keep lead selections in alv table...

    Hi experts.
    I made a alv.
    A logic  in wdmodifyview is following..
    METHOD wddomodifyview .
      IF first_time EQ abap_true.
        wd_comp_controller->set_alv_config( ).
      ENDIF.
      wd_this->set_maktx( ).  "<- for displaying maktx
    ENDMETHOD.
    When I want to select a line, do not selected.
    I know because of "wd_this->set_maktx( )." sentence.
    But I want to select multi lines in above condition...
    How to keep selected lines in alv?
    Help me please.
    Thanks.
    Regards.

    What logic is taking place in wd_this->set_maktx( )?  It is pretty difficult to say what is causing the issue without knowing what code you are executing?  If you are resetting the context bound to the ALV, that would explain why you are losing your selections.

Maybe you are looking for

  • Dump in tragation J2IUN

    Hi experts, I am getting dump in J2IUN tragation ...dump analysis in st22 is as fallow Runtime Errors         DYNPRO_FIELD_CONVERSION Date and Time          31.10.2007 14:02:22 Short text Conversion error What happened? The current screen processing

  • How do I update the Bank Account to pay my iCloud Storage plan

    HOw ow to update the Bank account to pay my iCloud Storage Plan

  • Auto font size for textfield by javascript

    Hi there.  I got the following script for a textfield in a fillabe PDF.  Th length of the textfield is 150.  It is required that if the text is > 100, the text size will be set to point 8, otherwise it will be point 12. var tf = this.rawValue; if (tf

  • How do  I make a ring tone for iphone 4

    How how do  I make a ring tone from my original music , all I read is old  , surely I can convert something to a ringtone  for my iphone 4. Just seems like I cant do anything without buying something from Apple ... need some help , iM geetting tired

  • Best way to remove applications and unneeded files

    I have an Imac running slow. Duo Core processor. 4 mgs Ram. Disabled Java in Safari. Getting all my photos off the computer. Safari runs slow. Beachball forever. Have removed past Mac Keeper. Want to know the best way (Until I can add more RAM, if I