Select ALV row right after first display

Hi,
I want to pre-select specific rows in my ALV already when it`s first displayed. I tried to use method set_selected_rows in the PBO where the ALV object is created, but it did not work. It only worked when I put the method in the PAI.
Can I select rows of the ALV when it is initially displayed, that is before it`s screen`s PAI is called?
Thanks.
Krisz

Hi
Its possible to have the rows pre-selected using buttons.
In PBO, after calling method-set_table_for_first_display
     CALL METHOD cl_grid->get_selected_rows
       IMPORTING
         et_index_rows = tb_row_id[]
Loop on the internal table whose records are displayed in ALV,
and set the parameter index in TB_ROW_ID as SY_TABIX.
endloop.
     CALL METHOD cl_grid->set_selected_rows
       EXPORTING
         it_index_rows = tb_row_id.
I have tested it and works.
Please let me know whether it works or not
BR
Lavanya

Similar Messages

  • Creating new row right after popup opens (JBO-35007 because of  trigger)

    Hi,
    I have the same popup (with an ADF form) to add and to edit data. But i have two buttons which displays this popup - Add new and Edit, Edit works OK, on add, i insert new record like this:
            DCIteratorBinding dciter =
                (DCIteratorBinding)bindingContainer.get(iterator);
            ViewObject view = dciter.getViewObject();
            Row newRow = view.createRow();
            view.insertRow(newRow);
            view.setCurrentRow(newRow);before popup is open. And it adds a new record. But the record has id -10 (or some other negative number). This -10 is shown on calling page (the page from which the popup is open) in ADF ReadOnly table as -10 as id and other cells in row empty. That shouldn't happen (se bellow why). User then edits empty form in popup, and commits - then i get JBO-35007 because -10 changed to 123 - because of trigger.
    I tried to requery - it doesn't help, see Refresh after pop-up window closes.
    Can you suggest a solution on how to create a row right after popup opens?
    Also,
    i create new record on button's LaunchListener method. This method seems to execute before popup is open and so it affects the calling page also. I think the problem would be solved if new row would be created after popup is opened, not while opening it. (clicking create in popup works fine)

    in my real case, i usually don't show ids; but to simplify debugging, i created test project where i show as many things as possible.
    you mean, creating new record like following?
            bindings.getOperationBinding("Create").execute();I don't use that because i don't get empty fields in popup window (although new record is created). Actually, i don't know how to set this created record to be selected one. Suggestions?
    And I did some more testing, if I create new record with clicking on Create (not creating new row automatically), i get JBO-35007 only if there was selected any other than the first row in table.
    and i tried to move create method binding in pagedef, so it's the first one.. But it seems like there is no effect.
    btw, i found this in one of examples on web:
       <invokeAction Binds="Execute"
                      id="refreshTableViewObjectAfterAddingNewApp"
                      Refresh="prepareModel"
                      RefreshCondition="#{processScope.addedNewApp}" />refresh condition must be true when adding new row and false for everything else. I'm not sure what that does, but it seems to work... :)
    I really shouldn't use the same View Objects in popup and 'master' page, should I?

  • Dreamviewer CS5 opens but shuts down right after first view again and again...without no error information

    I have Adobe Premium CS5 for MAC. My Dreamviewer CS5 opens but shuts down right after first view again and again. With no error information.
    I have tried to download it again (web download link) with reopening the computer, but still it does not work.
    Did not ask any serial numbers at all so I assume I was able to "smell" existing program on computer.
    As Dreamviewer is part of bigger package, do i have to install only this program, web design set or what?
    Do I have to download some other programs to get it work? All other graphic and web programs open and work properly.
    What to do? Will it install it again if not uninstalled first?

    For something like this, I would try clearing the program cache first: Deleting a corrupted cache file
    Then restore preferences if the cache trick didn't work: Restore preferences | Dreamweaver CS4, CS5, CS5.5, CS6
    And finally, if neither work, reinstalling using the cleaner tool instructions here: Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6

  • Changing field catalog of ALV grid after first display (was: "ALV GRID")

    Dear experts!
    I am using CL_GUI_ALV_GRID to display an ALV, whose fieldcatalog has 5 fields (FIELD1, FIELD2, FIELD3, FIELD4 and FIELD5).
    I am setting "NO_OUT = 'X' " to the fields FIELD3 and FIELD5 in the fieldcatalog before call the method SET_TABLE_FOR_FIRST_DISPLAY.
    If a specific event occurs on the screen, I would like to set "NO_OUT = 'X'" to the fields FIELD2 and FIELD4 and I would like to set the "NO_OUT = ''" to the fields and FIELD3 FIELD5. This should happen at runtime after the method call "SET_TABLE_FOR_FIRST_DISPLAY".
    I've tried using the method SET_FIELDCATALOG, but it is private.
    Does anyone have any idea how to solve this problem?
    Thank you very much!
    Rubens
    Edited by: Thomas Zloch on Aug 22, 2011 3:49 PM - subject corrected

    Hi
    Try to use the method SET_FRONTEND_FIELDCATALOG (it'll call private method SET_FIELDCATALOG)
    Max

  • OracleDataAdapter changes table row state after first Update call

    I have a single dataset containining multiple tables, connected by relation with cascade constraints.
    When I try to do something like:
    OracleDataAdapter da1 = new OracleDataAdapter();
    da1.InsertCommand = previouslyInitializedCommand;
    OracleDataAdapter da2 = new OracleDataAdapter();
    da2.InsertCommand = anotherCommand()
    using (TransactionScope ts = new TransactionScope())
    using (OracleConnecction conn = new OracleConnection(connString))
    conn.Open();
    da1.InsertCommand.Connection = conn;
    da2.InsertCommand.Connection = conn;
    da1.Update(dataset.Table1);
    da2.Update(dataset.Table2);
    ts.Complete();
    The second Update never happens because the first Update call changes Table2 row status to "Unmodified" so no INSERT command is issued.
    Anyone knows how this behaviour can be avoided?

    Hi,
    Maybe take a look here: [http://msdn.microsoft.com/en-US/library/33y2221y%28v=vs.80%29.aspx]
    I would focus on this part:
    Ordering of Inserts, Updates, and Deletes
    In many circumstances, the order in which changes made through the DataSet are sent to the data source is important. For example, if a primary key value for an existing row is updated and a new row has been added with the new primary key value as a foreign key, it is important to process the update before the insert.
    You can use the Select method of the DataTable to return a DataRow array that only references rows with a particular RowState. You can then pass the returned DataRow array to the Update method of the DataAdapter to process the modified rows. By specifying a subset of rows to be updated, you can control the order in which inserts, updates, and deletes are processed.
    DataTable table = dataSet.Tables["Customers"];
    // First process deletes.
    adapter.Update(table.Select(null, null, DataViewRowState.Deleted));
    // Next process updates.
    adapter.Update(table.Select(null, null,
      DataViewRowState.ModifiedCurrent));
    // Finally, process inserts.
    adapter.Update(table.Select(null, null, DataViewRowState.Added));r,
    dennis

  • Report for CRM-Opportunities - Open CRMD_ORDER for selected ALV row

    Hello,
    i created a report which can be used to find the relevant opportunities and list them in a ALV table.
    I have the requirement that by doubleclick on the table line the selected opportunity shall open in tx crmd_order.
    I have the GUID and the object_id of the opportunity in my ALV tableline.
    Has anybody already experience how to achieve this?
    Thank you
    Best regards
    Manfred

    It works perfectly for me. Look at the code (this works)
    REPORT ytestfhe3.
    DATA: gv_1o_manag    TYPE REF TO cl_crm_1o_manag,
          gv_1o_main     TYPE REF TO cl_crm_1o_main.
    DATA: gv_dynnr       TYPE sydynnr.
    DATA: gv_1o_frame_pa TYPE crmt_1o_frame_pa.
    DATA: gv_guid        TYPE crmt_object_guid.
    DATA: gv_boolean     TYPE crmt_boolean VALUE 'X'.
    PARAMETERS: p_order TYPE crmd_orderadm_h-object_id.
    START-OF-SELECTION.
      SELECT SINGLE guid FROM crmd_orderadm_h
                         INTO gv_guid
                        WHERE object_id EQ p_order.
    END-OF-SELECTION.
      gv_1o_frame_pa-transaction_guid = gv_guid.
      CREATE OBJECT gv_1o_manag
        EXPORTING
          iv_with_navig  = gv_boolean
          iv_1o_frame_pa = gv_1o_frame_pa.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.
      CALL METHOD gv_1o_manag->get_main_screen
        IMPORTING
          ev_dynnr = gv_dynnr.
      CALL FUNCTION 'CRM_1O_MANAG_CALL_SCREEN_UI'
        EXPORTING
          iv_dynnr       = gv_dynnr
          iv_1o_frame_pa = gv_1o_frame_pa.

  • Select records by date after first of next month

    Hi
    I have an asp app accessing a SQL Server db and am getting
    myself into a tangle over dates. I have a date field ValidFromDt
    (smalldatetime) and another date field ValidUntilDt which
    respectively define when a record is valid from and until. I want
    to select all records valid on the first of next month - i.e. were
    now in July so I want any whose 'valid from' date is now or any day
    up to 1 Aug but excluding those which expire before 1 Aug and also
    those whose valid from date is 2 Aug or later. Whatever month we're
    in, it is the first of next month I want to select up until.
    Any suggestions much appreciated.
    Thanks
    TP

    Try...
    SELECT yourTable.* FROM yourTable WHERE
    CSng(Month([ValidFromDt]))>CSng(Month(Date()))

  • Adding a button to ALV row (OO ALV)

    Hi,
       I am able to add a button to the ALV row but I am not able to capture which button is pressed. I am defining the button as below :
      l_f_colpos = l_f_colpos + 1.
      l_r_fcat-tabname = 'G_T_GLALV'.
      l_r_fcat-fieldname = 'BUTTON1'.
      l_r_fcat-col_pos = l_f_colpos.
      l_r_fcat-scrtext_m = text-008.
      l_r_fcat-style = cl_gui_alv_grid=>mc_style_button.
      l_r_fcat-just = 'X'.
      APPEND l_r_fcat TO gt_glfcat.
      CLEAR l_r_fcat.
    My requirement is when the user presses the button on the ALV row , I have to display something depending on the row.
    Please give some inputs of how to capture the button which is pressed.
    Thanks in advance,
    Nilanjan Dey

    Hi Nilajan,
    take Reference of folowing program.
    REPORT zalv_toolbar.*type pools declaratins for icon and alv
    TYPE-POOLS : slis,icon.*Structure declaration for tcodes
    TYPES : BEGIN OF ty_table,
            tcode TYPE tcode,
            pgmna TYPE progname,
            END OF ty_table.*Structure for tocde text
    TYPES : BEGIN OF ty_itext,
            tcode TYPE tcode,
            ttext TYPE ttext_stct,
            sprsl TYPE sprsl,
            END OF ty_itext.*Structure for output display
    TYPES : BEGIN OF ty_output,
            tcode TYPE tcode,
            pgmna TYPE progname,
            ttext TYPE ttext_stct,
           END OF ty_output.*internal table and work area declarations
    DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0,
           it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
           it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0,
           wa_table TYPE ty_table,
           wa_output TYPE ty_output,
           wa_ittext TYPE ty_itext.*Class definition for ALV toolbar
    CLASS:      lcl_alv_toolbar   DEFINITION DEFERRED.*Declaration for toolbar buttons
    DATA : ty_toolbar TYPE stb_button.* Data declarations for ALVDATA: c_ccont TYPE REF TO cl_gui_custom_container,   "Custom container object
          c_alvgd         TYPE REF TO cl_gui_alv_grid,   "ALV grid object
          it_fcat            TYPE lvc_t_fcat,            "Field catalogue
          it_layout          TYPE lvc_s_layo,            "Layout
          c_alv_toolbar    TYPE REF TO lcl_alv_toolbar,           "Alv toolbar
          c_alv_toolbarmanager TYPE REF TO cl_alv_grid_toolbar_manager.  "Toolbar manager*Initialization event
    INITIALIZATION.*Start of selection event
    START-OF-SELECTION.*Subroutine to get values from tstc table
      PERFORM fetch_data.*subroutine for alv display
      PERFORM alv_output.*---------------------------------------------------------------------*
    *       CLASS lcl_alv_toolbar DEFINITION
    *       ALV event handler
    CLASS lcl_alv_toolbar DEFINITION.
      PUBLIC SECTION.*Constructor
        METHODS: constructor
                   IMPORTING
                     io_alv_grid TYPE REF TO cl_gui_alv_grid,*Event for toolbar
        on_toolbar
           FOR EVENT toolbar
           OF  cl_gui_alv_grid
           IMPORTING
             e_object.ENDCLASS.                    "lcl_alv_toolbar DEFINITION*---------------------------------------------------------------------*
    *       CLASS lcl_alv_toolbar IMPLEMENTATION
    *       ALV event handler
    CLASS lcl_alv_toolbar IMPLEMENTATION.
      METHOD constructor.*   Create ALV toolbar manager instance
        CREATE OBJECT c_alv_toolbarmanager
          EXPORTING
            io_alv_grid      = io_alv_grid.  ENDMETHOD.                    "constructor  METHOD on_toolbar.*   Add customized toolbar buttons.
    *   variable for Toolbar Button    ty_toolbar-icon      =  icon_generate.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button1'.    APPEND ty_toolbar TO e_object->mt_toolbar.    ty_toolbar-icon      =  icon_voice_output.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button2'.
        APPEND ty_toolbar TO e_object->mt_toolbar.    ty_toolbar-icon      =  icon_phone.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button3'.
        APPEND ty_toolbar TO e_object->mt_toolbar.    ty_toolbar-icon      =  icon_mail.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button4'.    APPEND ty_toolbar TO e_object->mt_toolbar.    ty_toolbar-icon      =  icon_voice_input.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button5'.    APPEND ty_toolbar TO e_object->mt_toolbar.**   Call reorganize method of toolbar manager to
    **   display the toolbar    CALL METHOD c_alv_toolbarmanager->reorganize
          EXPORTING
            io_alv_toolbar = e_object.  ENDMETHOD.                    "on_toolbarENDCLASS.                    "lcl_alv_toolbar IMPLEMENTATION*&---------------------------------------------------------------------*
    *&      Form  fetch_data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM fetch_data .* Select the tcodes upto 200 rows from TSTC  SELECT   tcode
               pgmna
               FROM tstc
               INTO CORRESPONDING FIELDS OF TABLE it_table
               UP TO 200 ROWS
               WHERE dypno NE '0000'.*Select the tcode textx  IF it_table[] IS NOT INITIAL.    SELECT ttext
               tcode
               sprsl
               FROM tstct
               INTO CORRESPONDING FIELDS OF TABLE it_ittext
               FOR ALL ENTRIES IN it_table
               WHERE tcode = it_table-tcode
               AND sprsl = 'E'.  ENDIF.* Apppending the data to the internal table of ALV output  LOOP AT it_table INTO wa_table.
        wa_output-tcode = wa_table-tcode.
        wa_output-pgmna = wa_table-pgmna.*    For texts
        READ TABLE it_ittext INTO wa_ittext WITH KEY tcode = wa_table-tcode.
        wa_output-ttext = wa_ittext-ttext.    APPEND wa_output TO it_output.
        CLEAR wa_output.  ENDLOOP.ENDFORM.                    " fetch_data
    *&      Form  alv_output
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM alv_output .*Calling the ALV
      CALL SCREEN 0600.ENDFORM.                    " alv_output** Calling the ALV screen with custom container
    *On this statement double click  it takes you to the screen painter SE51.*Enter the attributes
    *Create a Custom container and name it CC_CONT and OK code as OK_CODE.
    *Save check and Activate the screen painter.
    *Now a normal screen with number 600 is created which holds the ALV grid.* PBO of the actual screen , Here we can give a title and customized menus
    *&      Module  STATUS_0600  OUTPUT
    *       text
    MODULE status_0600 OUTPUT.
    *  SET PF-STATUS 'xxxxxxxx'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0600  OUTPUT
    * calling the PBO module ALV_GRID.
    *&      Module  ALV_GRID  OUTPUT
    *       text
    MODULE alv_grid OUTPUT.*create object for custom container
      CREATE OBJECT c_ccont
           EXPORTING
              container_name = 'CC_CONT'.*create object of alv grid
      CREATE OBJECT c_alvgd
          EXPORTING
              i_parent = c_ccont.* create ALV event handler
      CREATE OBJECT c_alv_toolbar
        EXPORTING
          io_alv_grid = c_alvgd.* Register event handler
      SET HANDLER c_alv_toolbar->on_toolbar FOR c_alvgd.* Fieldcatalogue for ALV  PERFORM alv_build_fieldcat.* ALV attributes FOR LAYOUT
      PERFORM alv_report_layout.  CHECK NOT c_alvgd IS INITIAL.* Call ALV GRID  CALL METHOD c_alvgd->set_table_for_first_display
        EXPORTING
          is_layout                     = it_layout
        CHANGING
          it_outtab                     = it_output
          it_fieldcatalog               = it_fcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.ENDMODULE.                 " ALV_GRID  OUTPUT*&---------------------------------------------------------------------*
    *&      Form  alv_build_fieldcat
    *       text
    *      <--P_IT_FCAT  text
    *----------------------------------------------------------------------*FORM alv_build_fieldcat.  DATA lv_fldcat TYPE lvc_s_fcat.
      CLEAR lv_fldcat.  lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '1'.
      lv_fldcat-fieldname = 'TCODE'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 8.
      lv_fldcat-scrtext_m = 'TCODE'.  APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.  lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '2'.
      lv_fldcat-fieldname = 'PGMNA'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'PROGNAME'.  APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.  lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '3'.
      lv_fldcat-fieldname = 'TTEXT'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 60.
      lv_fldcat-scrtext_m = 'Description'.  APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.ENDFORM.                    " alv_build_fieldcat*&---------------------------------------------------------------------*
    *&      Form  alv_report_layout
    *       text
    *      <--P_IT_LAYOUT  text
    *----------------------------------------------------------------------*FORM alv_report_layout.  it_layout-cwidth_opt = 'X'.
      it_layout-zebra = 'X'.ENDFORM.                    " alv_report_layout* PAI module of the screen created. In case we use an interactive ALV or
    *for additional functionalities we can create OK codes
    *and based on the user command we can do the coding.
    *&      Module  USER_COMMAND_0600  INPUT
    *       text
    MODULE user_command_0600 INPUT.
    ENDMODULE.                 " USER_COMMAND_0600  INPUTOutput:
    Regards,
    Pravin

  • How to select a row in JTable

    Hello,
    I have a problem selecting a row in a JTable.
    I use
    mytable.getSelectionModel().setSelectionInterval(row, row);
    to select a row, but after that this row is only highlighted. After calling this method I cannot change the selection using the arrow keys.
    Can anybody give me a hint, how I can get the row selected, so that I can use the arrow keys immediately after selecting the row?
    Any help is welcome.
    Thanks,
    Fritz

    Hello,
    I got the solution:
    final int pRow = row;
    final int pCol = column;
    final JTable myTable = mytable;
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    myTable.requestFocusInWindow();
    myTable.changeSelection(pRow, pCol, true, true);

  • Hi, coding to display popup window after first alv grid display

    hi
    can anybody please send coding to display popup window after first alv grid display i.e.  first the prog shows grid display and from grid display the user select the field and on the basis of field value i need to show pop up window in the first secondary window and then third popup window.
    thanx
    rocky

    Hi rocky,
    here is the sample code .hope this helps you.
    TYPE-POOLS : SLIS.
    DATA : GT_OUTTAB TYPE VBAK OCCURS 0,
           GS_PRIVATE TYPE SLIS_DATA_CALLER_EXIT,
           GS_SELFIELD TYPE SLIS_SELFIELD.
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA : ITAB TYPE TABLE OF SLIS_SELFIELD,
           WA_ITAB LIKE LINE OF ITAB.
    START-OF-SELECTION.
    PERFORM POPULATE_GT_OUTTAB.
    PERFORM GET_POPUP.
    PERFORM POPULATE_ITAB.
    PERFORM FIELDCAT.
    PERFORM DISPLAY_DETAILS.
    *&      Form  FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    FORM FIELDCAT .
    LOOP AT ITAB INTO WA_ITAB.
    WA_FIELDCAT-FIELDNAME = 'TABINDEX'.
    WA_FIELDCAT-TABNAME = 'WA_ITAB'.
    WA_FIELDCAT-COL_POS = 1.
    WA_FIELDCAT-SELTEXT_L = 'TABLE INDEX'.
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'SEL_TAB_FIELD'.
    WA_FIELDCAT-TABNAME = 'WA_ITAB'.
    WA_FIELDCAT-COL_POS = 2.
    WA_FIELDCAT-OUTPUTLEN = 20.
    WA_FIELDCAT-SELTEXT_L = 'FIELD NAME'.
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'VALUE'.
    WA_FIELDCAT-TABNAME = 'WA_ITAB'.
    WA_FIELDCAT-COL_POS = 3.
    WA_FIELDCAT-SELTEXT_L = 'FIELD VALUE'.
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    ENDLOOP.
    ENDFORM.                    " FIELDCAT
    *&      Form  POPULATE_GT_OUTTAB
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_GT_OUTTAB .
    SELECT * FROM VBAK
           UP TO 10 ROWS
           INTO TABLE GT_OUTTAB.
    ENDFORM.                    " POPULATE_GT_OUTTAB
    *&      Form  GET_POPUP
          text
    -->  p1        text
    <--  p2        text
    FORM GET_POPUP .
    CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
      EXPORTING
       I_TITLE                       = 'SALES ORDER'
      I_SELECTION                   = 'X'
      I_ALLOW_NO_SELECTION          =
       I_ZEBRA                       = 'X'
      I_SCREEN_START_COLUMN         = 0
      I_SCREEN_START_LINE           = 0
      I_SCREEN_END_COLUMN           = 0
      I_SCREEN_END_LINE             = 0
      I_CHECKBOX_FIELDNAME          =
      I_LINEMARK_FIELDNAME          =
      I_SCROLL_TO_SEL_LINE          = 'X'
        I_TABNAME                     = 'SALES ORDER'
        I_STRUCTURE_NAME              = 'VBAK'
      IT_FIELDCAT                   =
      IT_EXCLUDING                  =
      I_CALLBACK_PROGRAM            =
      I_CALLBACK_USER_COMMAND       =
       IS_PRIVATE                    = GS_PRIVATE
    IMPORTING
       ES_SELFIELD                   = GS_SELFIELD
      E_EXIT                        = G_EXIT
      TABLES
        T_OUTTAB                      = GT_OUTTAB
    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.                    " GET_POPUP
    *&      Form  POPULATE_ITAB
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_ITAB .
    WA_ITAB-TABNAME = GS_SELFIELD-TABNAME.
    WA_ITAB-TABINDEX = GS_SELFIELD-TABINDEX.
    WA_ITAB-SEL_TAB_FIELD = GS_SELFIELD-SEL_TAB_FIELD.
    WA_ITAB-VALUE = GS_SELFIELD-VALUE.
    APPEND WA_ITAB TO ITAB.
    ENDFORM.                    " POPULATE_ITAB
    *&      Form  DISPLAY_DETAILS
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_DETAILS .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
      I_CALLBACK_PROGRAM             = ' '
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      I_STRUCTURE_NAME               =
      IS_LAYOUT                      =
       IT_FIELDCAT                    = IT_FIELDCAT
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_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
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        T_OUTTAB                       = ITAB
    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.                    " DISPLAY_DETAILS
    award points if helpful.
    regards,
    deepthi reddy

  • Selecting multiple rows in ALV grid display

    Hi,
    I have an ALV grid display in my report.
    My grid contains multiple rows.
    I have to select multiple rows at a time, to perform some operations on the selected rows.
    How can it be achieved?
    Thanks,
    Sandeep.

    Hi ,
    you have to use a box fieldname in the report to be able to select multiple lines at a time :
    - in your internal table declaration put the first field as 'box_fieldname' of type c1
    - then in your work area for layout add, lwa_layout-box_fieldname =     'box_fieldname'
    - in the perform for handling user commands, all selected lines will have an "X" in the field name  'box_fieldname'
    Thanks and Regards,
    Dev.

  • First row of table is displayed as selected always when application loads.

    Hi..
    I have a table with few rows in it.When the application loads the first row of table is displayed as selected always.I don't want any of the rows to be displayed as selected.
    How can I prevent this ?
    My jdev version 11.1.1.5.0
    Edited by: Lovin_JV_941794 on Mar 12, 2013 2:13 AM

    Hi,
    can you remove the attribute
    selectedRowKeys="#{bindings.XXXX.collectionModel.selectedRow}"This would ensure that there are no selected rows persisted. you can also paste the jspx code also for better answer.
    ~Abhijit

  • Selecting Multiple Rows from ALV GRID Display

    Hi,
    I am having a ALV GRID Display. I want to select multiple rows from the Output and move them to an internal table.
    Please let me know how do I acheive this.
    Thanks in advance,
    Ishaq.

    Hi,
    Have a look on the following code. It displays the selected rows which hv been selected in basic list.
    TABLES:
      spfli.
    TYPE-POOLS:
      slis.
    DATA:
      BEGIN OF t_spfli OCCURS 0,
        checkbox.
            INCLUDE STRUCTURE spfli.
    DATA:  END OF t_spfli.
    DATA:
      t_sspfli LIKE STANDARD TABLE OF t_spfli .
    DATA:
      fs_spfli LIKE LINE OF t_sspfli.
    DATA:
      fs_layout TYPE  slis_layout_alv,
      w_program TYPE sy-repid.
    SELECT *
      FROM spfli
      INTO CORRESPONDING FIELDS OF TABLE t_spfli.
    *fs_layout-info_fieldname = 'COLOR'.
    fs_layout-box_fieldname = 'CHECKBOX'.
    w_program = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program       = w_program
        i_callback_pf_status_set = 'FLIGHT'
        i_callback_user_command  = 'SPFLI_INFO'
        i_structure_name         = 'SPFLI'
        is_layout                = fs_layout
      TABLES
        t_outtab                 = t_spfli
      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.
    *&      Form  FLIGHT
          text
         -->RT_EXTAB   text
    FORM flight    USING rt_extab TYPE slis_t_extab..
      SET PF-STATUS 'FLIGHT' EXCLUDING rt_extab.
    ENDFORM.                    "FLIGHT
    *&      Form  SPFLI_INFO
          text
         -->UCOMM      text
         -->SELFIELD   text
    FORM spfli_info USING ucomm LIKE sy-ucomm
                           selfield TYPE slis_selfield.
      selfield-refresh = 'X'.
      CASE ucomm.
        WHEN 'FLIGHT'.
          LOOP AT t_spfli.
            IF t_spfli-checkbox = 'X'.
              t_spfli-checkbox = ' '.
             t_spfli-color = 'C51'.
              MODIFY t_spfli TRANSPORTING checkbox.
              fs_spfli = t_spfli.
              APPEND fs_spfli TO t_sspfli.
            ENDIF.
          ENDLOOP.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
      CLEAR fs_spfli.
      fs_layout-info_fieldname = 'COLOR'.
    fs_layout-confirmation_prompt = 'X'.
      fs_layout-key_hotspot = 'X'.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = w_program
          i_structure_name   = 'SFLIGHT'
          is_layout          = fs_layout
        TABLES
          t_outtab           = t_sspfli
        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.
      REFRESH t_sspfli.
    ENDFORM.                    "SPFLI_INFO
    Regards,
    Chandu

  • How can I select the row after a cfgrid refresh?

    I have a form that is bound to a cfgrid.  The grid is populated from a database.  When you navigate in the grid the data displayed in the form changes to match the selected row.  I can edit the data in the form and update the database.  After updating the data I refresh the cfgrid, which then displays the updated data.
    Unfortunately the cfgrid always highlights the first row, row 0, after a refresh.  I want to highlight the same row that was highlighted when the data was edited and saved.  Can anyone advise as to how I can do that?
    I have tried setting a listener when the grid is initiated that responds whenever the store is refreshed and triggers the function refreshSelection():
    g.getStore().on('load', refreshSelection) ;
    Before the form data is saved, the row number is stored in selectedRow[0].  When the grid is refreshed, refreshSelection is run:
    function refreshSelection() {
    if (0 >= selectedRecords.length)
         return;
    alert('Selected row is Row ' + selectedRecords[0] ) ;
    g.getSelectionModel().selectRow(selectedRecords[0]) ;
    selectedRecords[0] = 0 ;
    The alert shows the correct row number each time, but highlighting the last row viewed works intermittently, and only if the alert line is active.  If I comment out the alert, this fails every time, with row 0 being highlighted.  selectedRecords[0] is reset to 0 after the attempt to select the row so that navigation through the grid, such as choosing "Next Page," will properly highlight the first row of the page rather than the last row number that was edited.
    -Rick

    Massage?
    Why not ask the masseuse who gave you the massage?

  • Not able to select a row in ALV in Webdynpro

    Hi everyone,
    I have developed a webdynpro application and I have declared component usage for SALV_WD_TABLE.
    The data gets displayed in the ALV, but always the first row is selected.
    When I try to select another row,I am not able to select.
    Could anyone please suggest what might be the problem ?
    Thanks in advance.
    Regards,
    Kumudha.

    Hi Manas,
    Thanks for the inputs.
    I am placing the code below for your reference.
    I try to change the below as Display Text as Code...But it is not happening Plz check
    method wddoinit.
      if wd_this->ls_setup is initial.
        select single * from yyua_c_setup into wd_this->ls_setup
          where system_id = sy-sysid.
      endif.
      "adjustments for ALV
      data lo_cmp_usage type ref to if_wd_component_usage.
      lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
      if lo_cmp_usage->has_active_component( ) is initial.
        lo_cmp_usage->create_component( ).
      endif.
      data: l_ref_interfacecontroller type ref to iwci_salv_wd_table .
      l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
      data: l_value type ref to cl_salv_wd_config_table,
            lr_header_t type ref to cl_salv_wd_header,
            lv_text type string.
      l_value = l_ref_interfacecontroller->get_model( ).
      data: lr_column_settings type ref to if_salv_wd_column_settings,
            lr_input_field type ref to cl_salv_wd_uie_input_field,
            lr_column type ref to cl_salv_wd_column.
    Set column title and position
      lr_column = l_value->if_salv_wd_column_settings~get_column( 'CSINSTA' ).
      lr_column->set_position( 1 ).
    lv_text = cl_wd_utilities=>get_otr_text_by_alias( 'Z_REFERENCE/REQUEST_NUMBER' ).
      lr_column->r_header->set_text( 'Installation' ).
      lr_column->r_header->set_ddic_binding_field( '00' ).
      lr_column = l_value->if_salv_wd_column_settings~get_column( 'ERFUNAME' ).
         |
      lr_column->set_position( 18 ).
    lv_text = cl_wd_utilities=>get_otr_text_by_alias( 'Z_REFERENCE/ACTIVITY_DATE' ).
      lr_column->r_header->set_text( 'Job profile ext' ).
      lr_column->r_header->set_ddic_binding_field( '00' ).
    Hide columns
      lr_column = l_value->if_salv_wd_column_settings~get_column( 'ERFTSTMP' ).
      lr_column->set_visible( 0 ).
      lr_column = l_value->if_salv_wd_column_settings~get_column( 'AETSTMP' ).
      lr_column->set_visible( 0 ).
      lr_column = l_value->if_salv_wd_column_settings~get_column( 'STATUS' ).
      lr_column->set_visible( 0 ).
      lr_column = l_value->if_salv_wd_column_settings~get_column( 'PRIO' ).
      lr_column->set_visible( 0 ).
      lr_column = l_value->if_salv_wd_column_settings~get_column( 'ISSUE' ).
      lr_column->set_visible( 0 ).
      data: lr_functions type ref to if_salv_wd_function_settings,
            lr_function type ref to cl_salv_wd_function,
            lr_button_t type ref to cl_salv_wd_fe_button.
    Add self-defined functions in toolbar
      lr_functions ?= l_value.
      lr_function = lr_functions->create_function( 'SELECT' ).
      create object lr_button_t.
    lv_text = cl_wd_utilities=>get_otr_text_by_alias( 'Z_REFERENCE/VIEW' ).
      lr_button_t->set_text( 'Select' ).
      lr_function->set_editor( lr_button_t ).
    data : LR_FUNCTION_SETTINGS TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
    create object LR_FUNCTION_SETTINGS.
    SET row selectable as true
    CALL METHOD LR_FUNCTION_SETTINGS->IF_SALV_WD_TABLE_SETTINGS~SET_ROW_SELECTABLE
    EXPORTING
    VALUE = ABAP_TRUE.
    endmethod
    Regards,
    Kumudha.

Maybe you are looking for

  • Multipule iTunes libraries on the same computer

    Hi, Just a quickie: Is there n e way of having multiple libraries on the same computer in the same user account?? I wanna make 1 for diff music to the other thanks

  • The installed printer doesn't appear in the printer list in Firefox. How to print then?

    I reinstalled firefox resently and can't print anymore (print to PDF usually). When I ctrl P, the printer list is empty. So I can't print. When using another software (or other browser) I have the printer list. I have tried to reset the printer setti

  • AMD Catalyst and XServer 1.14

    Hello I am using the proprietary video driver, tried using xserver 1.14 while it was in testing but it broke my system (i downgraded xserver afterwards). Catalyst does not support the new xserver which was pushed to the standard repos today. When I t

  • Third party software problem with t5

    i have a tungsten t5. i am having a problem downloading the software to my handheld. the software supports windows ce, windows mobil 5, pocket pc 2000 (sh3, mips, arm), pocket pc 2002 arm, and pocket pc 2003 arm. can anyone help me? Post relates to:

  • How to post message to Adobe Reader or AVWindow?

    There is a modeless dialog created by my plugin. I want post message in dialog to Reader or AVWindow. How to post message and where can i receive these message? I'm using Windows XP thanks.