How to edit only some rows in ALV

Hi Experts,
I have editable ALV. I need to allow edit only for some rows, not generaly all of them.
Do you have any idea how to do it?
I use ALV through FM module REUSE_ALV_GRID_DISPLAY.
Thenks&regards,
Jirka

Hi,
You need to use events. Sample code from sdn.
TYPE-POOLS:SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA:IT_EVENTS TYPE SLIS_T_EVENT.
data: begin of it_chg occurs 0,
      index type sy-tabix,
      end of it_chg.
DATA:  X_EVENTS    TYPE SLIS_ALV_EVENT.
DATA: BEGIN OF ITAB OCCURS 0,
      NAME(10) TYPE C,
      ZTERM TYPE C,
      END OF ITAB.
PERFORM FILL_TABLE.
loop at itab where zterm = 'A'.
it_chg-index = sy-tabix + 3. 
" addition 3 IS FOR FIELD LABELS
append it_chg.
clear it_chg.
endloop.
DATA:L_POS TYPE I VALUE 1.
CLEAR: L_POS.
L_POS = L_POS + 1.
**fieldcatalog
X_FIELDCAT-FIELDNAME = 'NAME'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS    = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-FIELDNAME = 'ZTERM'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS    = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
**events
REFRESH:IT_EVENTS.
CLEAR:X_EVENTS,IT_EVENTS.
X_EVENTS-NAME = SLIS_EV_END_OF_LIST.
X_EVENTS-FORM = 'MODIFY_LIST'.
APPEND X_EVENTS TO IT_EVENTS.
CLEAR X_EVENTS.
END-OF-SELECTION.
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM = SY-REPID
      IT_FIELDCAT        = IT_FIELDCAT
      IT_EVENTS          = IT_EVENTS
    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.
*&      Form FILL_TABLE
      text
FORM FILL_TABLE.
  ITAB-NAME = 'vijay'.
  ITAB-ZTERM = 'A'.
  APPEND ITAB.
  clear itab.
  ITAB-NAME = 'ABC'.
  ITAB-ZTERM = 'B'.
  APPEND ITAB.
  clear itab.
  ITAB-NAME = 'TEST'.
  ITAB-ZTERM = 'C'.
  APPEND ITAB.
  clear itab.
  ITAB-NAME = 'DILIP'.
  ITAB-ZTERM = 'D'.
  APPEND ITAB.
  clear itab.
  ITAB-NAME = '123'.
  ITAB-ZTERM = 'E'.
  APPEND ITAB.
  clear itab.
  ITAB-NAME = 'GEN'.
  ITAB-ZTERM = 'A'.
  APPEND ITAB.
  clear itab.
  ITAB-NAME = 'ALV'.
  ITAB-ZTERM = 'F'.
  APPEND ITAB.
  clear itab.
  ITAB-NAME = 'ALVTEST'.
  ITAB-ZTERM = 'A'.
  APPEND ITAB.
  clear itab.
ENDFORM.                    "FILL_TABLE
*&      Form  MODIFY_LIST
      text
FORM MODIFY_LIST.
data: l_lines type i.
describe table itab lines l_lines.
  L_LINES  = L_LINES + 3.
  "because we have 3 lines extra occupied by lables.
  "if we have header,i mean top of page add the no.of lines
  "how many ever top of page have + 3 for labels.
  DO L_LINES TIMES.
    read table it_chg with key INDEX = sy-index.
    if sy-subrc = 0.
**This code is for reading the out put line
**and modify accordinlg to our requiremnet.
**don't chnage this.
      READ LINE SY-INDEX INDEX SY-LSIND.
      IF SY-SUBRC = 0.
        MODIFY LINE SY-INDEX INDEX SY-LSIND
                   FIELD FORMAT ITAB-NAME INPUT.
      ENDIF.
    ENDIF.
  ENDDO.
ENDFORM.                    "MODIFY_LIST

Similar Messages

  • How to EDIT a particular Row in ALV using normal function module Reuse_alv_grid_display

    Hi experts..
    i got one requirement like i need to edit some rows particularly in alv....
    Edit in alv output....is it possible to get  that .....using normal function module with out using oops concept...
    could any one pls help me...

    Hi Pendurti ,
    If you want a particular field to be editable , simply define the fieldcatalog as
    wa_fieldcatalog-edit          = 'X'.
    wa_fieldcatalog-input         = 'X'.
    for that field.
    and
    Now when you use FM ' Reuse alv grid display '
    define USER_COMMAND
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = v_repid
          i_callback_pf_status_set = 'SET_PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
          it_fieldcat              = int_fieldcatalog
          is_layout                = wa_layout
        TABLES
          t_outtab                 = t_disp.
    and now in form USER_COMMAND ; code as per following
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                                rs_selfield TYPE slis_selfield.
         DATA ref1 TYPE REF TO cl_gui_alv_grid.
         CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
           IMPORTING
             e_grid = ref1.
         CALL METHOD ref1->check_changed_data.
    endform.
    Regards,
    Yogendra Bhaskar

  • Hotspot click for only some rows in ALV grid for a particular column ?

    Hi there,
            In ALV grid, we can make Hotspot enable for all rows in a specified column
    by specifying in the fieldcatalog with Hotspot attribute set as true.
    But I want to enable Hotspot only for certain rows in the particular column. I tried with MC_STYLE4_LINK , but I didnt got the required result.
    So , how could I achieve that in ALV grid.
    Points would be rewarded for helpful answers.
    Regards,
    Anil .

    Hi,
    You can do it for a column. Please refer to the code snippet below,
      DATA : it_fcat TYPE lvc_t_fcat,
             wa_fcat LIKE LINE OF it_fcat.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
       EXPORTING
      I_BUFFER_ACTIVE              =
         i_structure_name             = 'SMMW_ALERTS_ICON_S'
      I_CLIENT_NEVER_DISPLAY       = 'X'
      I_BYPASSING_BUFFER           =
      I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = it_fcat
       EXCEPTIONS
         inconsistent_interface       = 1
         program_error                = 2
         OTHERS                       = 3
    LOOP AT it_fcat INTO wa_fcat.
      IF wa_fcat-fieldname = 'STATUS'.
        wa_fcat-hotspot = 'X'.
        MODIFY it_fcat FROM wa_fcat.
        CLEAR wa_fcat.
      ENDIF.
    ENDLOOP.
    CALL METHOD l_obj_alv_grid->set_table_for_first_display
          EXPORTING
        i_structure_name              = 'SMMW_ALERTS_ICON_S'
       CHANGING
            it_outtab                     = lt_alerts_st
            it_fieldcatalog               = it_fcat.
    In the above replace the structure 'SMMW_ALERTS_ICON_S' with your structure and column 'STATUS' with your desired column.
    Hope this helps,
    Regards,
    Vinodh

  • How to copy only some coulums and rows from excel files to a Oracle Table

    Dear all,
    I have the following problems:
    How to copy only some wanted coulums ( I.e DATETIME(format:17/09/2007 00:00:01 ) and TIME (format: 00:00:01 ) from excel files to oracle table.
    HOPE TO GET HELP FROM YOU GUYS!
    SINCERELY,
    MONOJSHARMALUITEL

    How about Heterogeneous Services so that the Excel sheet is an external database:
    1- Go to Control Panel>Administrative Tools>Data Sources (ODBC)>System DSN and create a data source with appropriate driver. Name it EXCL.
    2- In %ORACLE_HOME%\Network\Admin\Tnsnames.ora fie add entry:
    EXCL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.0.24)(PORT = 1521))
    (CONNECT_DATA =
    (SID = EXCL)
    (HS = OK)
    Here SID is the name of data source that you have just created.
    3- In %ORACLE_HOME%\Network\Admin\Listener.ora file add:
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = <hs_sid>)
    (ORACLE_HOME = <oracle home>)
    under SID_LIST_LISTENER like:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = d:\ORA9DB)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = ORA9DB)
    (ORACLE_HOME = d:\ORA9DB)
    (SID_NAME = ORA9DB)
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = EXCL)
    (ORACLE_HOME = D:\ora9db)
    Dont forget to reload the listener
    c:\> lsnrctl reload
    4- In %ORACLE_HOME%\hs\admin create init<HS_SID>.ora. For our sid EXCL we create file initexcl.ora.
    In this file set following two parameters:
    HS_FDS_CONNECT_INFO = excl
    HS_FDS_TRACE_LEVEL = 0
    5- Now connect to Oracle database and create database link with following command:
    SQL> CREATE DATABASE LINK excl
    2 USING 'excl'
    3 /
    Database link created.
    Now you can perform query against this database like you would for any remote database.
    SQL> SELECT table_name FROM all_tables@excl;
    TABLE_NAME
    DEPT
    EMP

  • How to delete a particular row in ALV table

    Hi,
    How to delete a particular row in ALV table based on some condition(by checking value for one of the columns in a row)
    Thanks
    Bala Duvvuri

    Hello Bala,
    Can you please be a bit more clear as to how you intend to delete the rows from your ALV? By the way deleting rows from an ALV is no different from deleting rows from a normal table. Suppose you have enabled selection property in ALV & then select multiple rows and click up on a button to delete the rows then below would be the coding: (Also keep in mind that you would have to maintain the Selection property of the context node that you are binding to your ALV to 0..n)
    data : lr_table_settings  TYPE REF TO if_salv_wd_table_settings,
                 lr_config          TYPE REF TO cl_salv_wd_config_table.
      lr_table_settings  ?= lr_config.
    ** Setting the ALV selection to multiple selection with no lead selection
      lr_table_settings->set_selection_mode( value = cl_wd_table=>e_selection_mode-multi_no_lead ).
    Next delete the selected rows in the action triggered by the button:
    METHOD onactiondelete_rows .
      DATA:  wd_node TYPE REF TO if_wd_context_node,
             lt_node1 TYPE ig_componentcontroller=>elements_node,
             wa_temp  TYPE REF TO if_wd_context_element,
             lt_temp  TYPE wdr_context_element_set,
             row_number TYPE i VALUE 0.
      wd_node = wd_context->get_child_node( name = 'NODE' ).
      CALL METHOD wd_node->get_selected_elements
        RECEIVING
          set = lt_temp.
      LOOP AT lt_temp INTO wa_temp.
        wd_node->remove_element( EXPORTING element = wa_temp ).
      ENDLOOP.
      CALL METHOD wd_node->get_static_attributes_table
        EXPORTING
          from  = 1
          to    = 2147483647
        IMPORTING
          table = lt_node1.
      wd_node->bind_table( new_items = lt_node1 ).
    ENDMETHOD.
    If in case this isn't your requirement please do let me know so that I can try come up with another analysis.
    Regards,
    Uday

  • How to edit a particular row in the table ctrl when a push button is clickd

    Hi Experts,
    How to edit a particular row (except the Primary keys) after selecting it in the TABLE CONTROL when a
    push button is clicked in the table control.
    For Eg. If you have a push button say "Modify", the particular row what we select in the table control should be in a
    editable mode after clicking "Modify" Push button.
    Please help me out.
    Thanks in advance.

    Hey Ram,
    Thanks a ton.
    Its working fine...sorry for the late reply.
    The reason behind the delay is because i had modified my code as per your logic it worked fine but the thing is that the whole column was in editable mode but not a single row.
    For E.g  If i want to edit a particular row, first i select the row and then  click on "Modify" button. After i click on the button, the whole column gets in a editable mode including the one which i intentionally selected.
    Here, the solution is that you have to set a flag in PBO so that once it is done with PBO then it need not come back again after we click on "Modify" button.
    And one more query is that after you modify a particular row in the table control ( When it is in editable mode) and click on the "Save" button, it is not getting updated to database.
    To update the database, we need to select the row once again after modifying it and click on the "Save" button.
    Here, database is updating only when it is selected again. If it is not selected, it is not getting updated.
    If you have any alternative solution, then please help me out.( I hope i am clear with the question.)
    Thanks,
    Ananth.

  • How to set some rows in ALV to be editable or some non editable.

    Dear all Gurus,
    I'm facing a situation here, I need your assistance.
    I'm creating a alv table where the user can enter a data and then this will be uploaded into the system. Now upon validation some records might fail and would need some changes and some records that had no problems would have been successfully posted.
    When the program returns to the user i want the successful one's to be greyed out and not editable. I'm not sure on how i could acess the rows of the table. I tried few classes and an all i could manage was to change the table setting and configs.
    Below i've pasted the code on how i've code my alv table. Please advice on how i could access the rows and disable the successfull ones. Please.
    METHOD wddoinit .
      DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage,
            l_interface     TYPE REF TO iwci_salv_wd_table,
           l_model         TYPE ref to cl_salv_wd_config_table, "Contains all characteristics of a table(collumns, fields, etc)
            lt_columns      TYPE        salv_wd_t_column_ref,  " Table type
            lt_fields       TYPE        salv_wd_t_field_ref,   " Table type
            l_btn_ins       TYPE REF TO cl_salv_wd_fe_button,
            l_btn_del       TYPE REF TO cl_salv_wd_fe_button,
            l_btn_sell_all  TYPE REF TO cl_salv_wd_fe_button,
            l_btn_dell_all  TYPE REF TO cl_salv_wd_fe_button,
            l_btn_calc      TYPE REF TO cl_salv_wd_fe_button,
            l_btn_save      TYPE REF TO cl_salv_wd_fe_button,
            l_function      TYPE REF TO cl_salv_wd_function,
            l_column        TYPE REF TO cl_salv_wd_column,
            l_header        TYPE REF TO cl_salv_wd_column_header,
            lr_input_1      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_2      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_3      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_4      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_5      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_6      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_7      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_8      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_9      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_10     TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_11     TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_12     TYPE REF TO cl_salv_wd_uie_input_field,
            l_link          TYPE REF TO cl_salv_wd_uie_button.
      CONSTANTS:
              zzto                        TYPE  string VALUE 'ZZTO',
              zzfrom                      TYPE  string VALUE 'ZZFROM',
              takeoff_date                TYPE  string VALUE 'TAKEOFF_DATE',
              read_date                   TYPE  string VALUE 'READ_DATE',
              takeoff_time                TYPE  string VALUE 'TAKEOFF_TIME',
              read_time                   TYPE  string VALUE 'READ_TIME',
              ac_hrs                      TYPE  string VALUE 'AC_HRS',
              le_hrs                      TYPE  string VALUE 'LE_HRS',
              re_hrs                      TYPE  string VALUE 'RE_HRS',
              ac_cycle                    TYPE  string VALUE 'AC_CYCLE',
              re_cycle                    TYPE  string VALUE 'RE_CYCLE',
              le_cycle                    TYPE  string VALUE 'LE_CYCLE',
              ltext                       TYPE  string VALUE 'LTEXT'.
      l_ref_cmp_usage =   wd_this->wd_cpuse_multi_alv( ).
      IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
        l_ref_cmp_usage->create_component( ).
      ENDIF.
    *Map the interface.
      l_interface = wd_this->wd_cpifc_multi_alv( ).
      DATA:
        node_mdoc                           TYPE REF TO if_wd_context_node,
        elem_mdoc                           TYPE REF TO if_wd_context_element.
    navigate from <CONTEXT> to <MDOC> via lead selection
      node_mdoc = wd_context->get_child_node( name = if_create_mass_entry=>wdctx_mdoc ).
      l_interface->set_data( r_node_data = node_mdoc ).
    *Map the model
      wd_this->l_model = l_interface->get_model( ).
    *Map the columns
      lt_columns = wd_this->l_model->if_salv_wd_column_settings~t_columns.
    *Map the fields
      lt_fields = wd_this->l_model->if_salv_wd_field_settings~t_fields.
      cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(
                        EXPORTING r_model = wd_this->l_model
                                  allowed = abap_false ). " try abap_true
    *Enable or Disable the ALV desired outlook and design
      wd_this->l_model->if_salv_wd_table_settings~delete_header( ).
      wd_this->l_model->if_salv_wd_table_settings~set_selection_mode(
                                           value  = cl_wd_table=>e_selection_mode-auto ).
      wd_this->l_model->if_salv_wd_table_settings~set_width( value = '100%'  ).
      wd_this->l_model->if_salv_wd_table_settings~set_visible_row_count( value  = '10' ).
      wd_this->l_model->if_salv_wd_table_settings~set_read_only( value  = abap_false  ).
      wd_this->l_model->if_salv_wd_std_functions~set_filter_filterline_allowed( value  = abap_true ).
      wd_this->l_model->if_salv_wd_std_functions~set_sort_headerclick_allowed( value = abap_true ).
      wd_this->l_model->if_salv_wd_std_functions~set_export_allowed( value = abap_false ).
    *Adding functionalities to the ALV
    *'Insert Row' Button
      CREATE OBJECT l_btn_ins.
      l_btn_ins->set_text( 'Insert Row' ).
      l_btn_ins->set_tooltip( 'To enter a new row' ).
      l_btn_ins->set_image_source( value = 'ICON_INSERT_ROW'  ).
      l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'INSERT'  ).
      l_function->set_position( value = '1' ).
      l_function->set_editor( value = l_btn_ins  ).
    *'Delete Row' Button
      CREATE OBJECT l_btn_del.
      l_btn_del->set_text( 'Delete Row' ).
      l_btn_del->set_tooltip( 'Delete the selected row' ).
      l_btn_del->set_image_source( value = 'ICON_DELETE_ROW' ).
      l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'DELETE'  ).
      l_function->set_position( value = '2' ).
      l_function->set_editor( value = l_btn_del  ).
    *'Select All' Button
      CREATE OBJECT l_btn_sell_all.
      l_btn_sell_all->set_text( 'Select All' ).
      l_btn_sell_all->set_tooltip( 'Select all entered record' ).
      l_btn_sell_all->set_image_source( value = 'ICON_INSERT_ROW'  ).
      l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'SELECT'  ).
      l_function->set_position( value = '3' ).
      l_function->set_editor( value = l_btn_sell_all ).
    *'Deselect All' Button
      CREATE OBJECT l_btn_dell_all.
      l_btn_dell_all->set_text( 'Deselect All' ).
      l_btn_dell_all->set_tooltip( 'Deselect all records selected' ).
      l_btn_dell_all->set_image_source( value = 'ICON_DESELECT_ALL'  ).
      l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'DESELECT'  ).
      l_function->set_position( value = '4' ).
      l_function->set_editor( value = l_btn_dell_all  ).
    *'Calculate' Button
      CREATE OBJECT l_btn_calc.
      l_btn_calc->set_text( 'Calculate Hours' ).
      l_btn_calc->set_tooltip( 'Calculate hours of each record' ).
      l_btn_calc->set_image_source( value = 'ICON_CALCULATION'  ).
      l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'CALC'  ).
      l_function->set_position( value = '5' ).
      l_function->set_editor( value = l_btn_calc  ).
    *'Save' Button
      CREATE OBJECT l_btn_save.
      l_btn_save->set_text( 'Save All' ).
      l_btn_save->set_tooltip( 'Save all' ).
      l_btn_save->set_image_source( value = 'ICON_SYSTEM_SAVE'  ).
      l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'SAVE'  ).
      l_function->set_position( value = '6' ).
      l_function->set_editor( value = l_btn_save  ).
      FIELD-SYMBOLS: <fs_column>  TYPE salv_wd_s_column_ref.
      LOOP AT lt_columns ASSIGNING <fs_column>.
        l_column = <fs_column>-r_column.
        l_column->get_header( RECEIVING value = l_header ).
        l_header->set_ddic_binding_field( value  = if_salv_wd_c_column_settings=>ddic_bind_none ).
        CASE <fs_column>-id .
          WHEN zzfrom.
            CREATE OBJECT lr_input_1  EXPORTING  value_fieldname = zzfrom.
            l_header->set_text( value = 'Flt Fr' ).
            l_column->set_position( value = '1'  ).
            l_column->set_cell_editor( lr_input_1 ).
           l_column->set_visible( '0' ).
          WHEN zzto.
            CREATE OBJECT lr_input_2  EXPORTING  value_fieldname = zzto.
            l_header->set_text( value = 'Flt To' ).
            l_column->set_position( value = '2'  ).
            l_column->set_cell_editor( lr_input_2 ).
          WHEN takeoff_date.
            CREATE OBJECT lr_input_3  EXPORTING  value_fieldname = takeoff_date.
            l_header->set_text( value = 'Takeoff Date' ).
            l_column->set_position( value = '3'  ).
            l_column->set_cell_editor( lr_input_3 ).
          WHEN read_date.
            CREATE OBJECT lr_input_4  EXPORTING  value_fieldname = read_date.
            l_header->set_text( value = 'Landing Date' ).
            l_column->set_position( value = '4'  ).
            l_column->set_cell_editor( lr_input_4 ).
          WHEN takeoff_time.
            CREATE OBJECT lr_input_5  EXPORTING  value_fieldname = takeoff_time.
            l_header->set_text( value = 'Takeoff Time' ).
            l_column->set_position( value = '5'  ).
            l_column->set_cell_editor( lr_input_5 ).
          WHEN read_time.
            CREATE OBJECT lr_input_6  EXPORTING  value_fieldname = read_time.
            l_header->set_text( value = 'Landing Time' ).
            l_column->set_position( value = '6'  ).
            l_column->set_cell_editor( lr_input_6 ).
          WHEN ac_hrs.
            CREATE OBJECT lr_input_7  EXPORTING  value_fieldname = ac_hrs.
            l_header->set_text( value = 'Flt Time' ).
            l_column->set_position( value = '7'  ).
            l_column->set_cell_editor( lr_input_7 ).
          WHEN le_hrs.
            CREATE OBJECT lr_input_8  EXPORTING  value_fieldname = le_hrs.
            l_header->set_text( value = 'LH Eng Runtime' ).
            l_column->set_position( value = '8'  ).
            l_column->set_cell_editor( lr_input_8 ).
          WHEN re_hrs.
            CREATE OBJECT lr_input_9  EXPORTING  value_fieldname = re_hrs.
            l_header->set_text( value = 'RH Eng Runtime' ).
            l_column->set_position( value = '9'  ).
            l_column->set_cell_editor( lr_input_9 ).
          WHEN ac_cycle.
            CREATE OBJECT lr_input_10  EXPORTING  value_fieldname = ac_cycle.
            l_header->set_text( value = 'No. of Landings' ).
            l_column->set_position( value = '10'  ).
            l_column->set_cell_editor( lr_input_10 ).
          WHEN re_cycle.
            CREATE OBJECT lr_input_11  EXPORTING  value_fieldname = re_cycle.
            l_header->set_text( value = 'RH Eng Start' ).
            l_column->set_position( value = '11'  ).
            l_column->set_cell_editor( lr_input_11 ).
          WHEN le_cycle.
            CREATE OBJECT lr_input_12  EXPORTING  value_fieldname = le_cycle.
            l_header->set_text( value = 'LH Eng Start' ).
            l_column->set_position( value = '12'  ).
            l_column->set_cell_editor( lr_input_12 ).
          WHEN ltext.
            CREATE OBJECT l_link.
            l_link->set_image_source( value = 'ICON_CREATE_TEXT'  ).
            l_link->set_text_fieldname( ltext ).
            l_link->set_tooltip( value = 'Create Log'   ).
            l_header->set_text( value = 'Enter Log').
            l_column->set_cell_editor( l_link ).
            l_column->set_h_align( cl_wd_table_column=>e_h_align-center ).
            l_column->set_position( value = '13' ).
          WHEN OTHERS.
            l_column->set_visible( '01' ).
        ENDCASE.
      ENDLOOP.
    ENDMETHOD.
    Your any help is highly appreciated. Thank you.
    Regards,
    Vinod

    Ok, here you go.
    In your context, apart from your display fields, add another attribute READ_ONLY, type char01. And lets assume you want the field by name field_1 to be editable or not based on some validation. Your code will be like this to initialize the ALV.
    DATA:
              l_alv_model               TYPE REF TO cl_salv_wd_config_table,
              lr_column_settings        TYPE REF TO if_salv_wd_column_settings,
              lr_column                 TYPE REF TO cl_salv_wd_column,
              lt_col                    TYPE SALV_WD_T_COLUMN_REF,
              ls_col                    TYPE SALV_WD_S_COLUMN_REF,
              lr_input_field            type ref to cl_salv_wd_uie_input_field.
        l_alv_model = l_ref_interfacecontroller->get_model( ).
        l_alv_model->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( abap_false ).
        lr_column_settings ?= l_alv_model.
        lt_col = lr_column_settings->get_columns( ).
        LOOP AT lt_col INTO ls_col where ID = 'FIELD_1'.
             create object lr_input_field exporting value_fieldname = ls_col-id.
             lr_input_field->set_read_only_fieldname( 'READ_ONLY' ).
             ls_col-r_column->set_cell_editor( lr_input_field ).
        ENDLOOP.
    In your event handler, you read your node, do a get_static_attributes_table. Perform all validations. Loop through your internal table and set the field READ_ONLY as 'X' when validation succeeds. Do READ_ONLY = space when validation fails. Then do a bind_elements. Now the rows for which read_only is false, will be editable and vice versa.
    Hope I was clear enough. Get back if you have any doubts.
    Regards,
    Nithya

  • ALV - how to make selectable only some rows on an ALV?

    Hi my problem is:
    I have an ALV GRID as output of a report.
    I have to make selectable only few rows based on the contents of a field (showed in a column in the ALV).
    Is it possible?
    Best Regards, Vincenzo

    I did understand, but as i told you there is nothing like that, neither an option nor an event to capture.
    Here is the documentation: http://help.sap.com/saphelp_erp2005vp/helpdata/EN/bf/3bd1369f2d280ee10000009b38f889/frameset.htm
    Read it and choose what you need and what is in existance.

  • Download link for only some rows

    Hi,
    I have 2 tables. One contains records for products, and the other contains images for only some of the products. The images have been uploaded through the application and therefore are in a 'upload_data' table.
    The tables are linked by product_id.
    I would like to display a report that shows all the column from the products table and a download link for only those products that have an image.
    So far the query only returns those rows that have an image.
    Thanks
    Edited by: user12970007 on 20-Apr-2010 17:59

    What does this query look like?

  • How to save only changed data of ALV in a local table ?

    Hi everyone,
    I created and alv with cl_gui_alv_grid, and I made it editable
    Now I need that when I click on a button only the changed data to be saved on a local (internal) table
    Is there a way I can do that ?
    I tried with methods like check_changed_data() but they don't return a table like that
    Regards,
    Dren Selimi

    ok than
    class lcl_event_receiver definition.
         methods:
    * Handle Data Changed
         handle_data_changed
         for event data_changed of cl_gui_alv_grid
         importing er_data_changed,
    endclass.                    "lcl_event DEFINITION
    class lcl_event_receiver implementation.
         method handle_data_changed.
              data: ls_good type lvc_s_modi.
              loop at er_data_changed->mt_good_cells into ls_good.
                   read table gt_table into gs_table index ls_good-index. "is your changed row in ALV
                    ls_good-fieldname "is your changed field
                   if ls_good-fieldname eq 'MATNR'.
                        gs_table-matnr " is your changed field old value.
                   endif. "i couldn't find a dynamic solution for old value
                   "if you do not have so many columns in alv you can use this solution
                    ls_good-value "is your changed field new value
                   append these values to your changed field table.
                   modify gt_table from gs_table index ls_good-index.           
              endloop.
              call method g_alvgrid->refresh_table_display.
         endmethod.
    endclass.

  • Only some rows selectable

    Hi,
    I wonder if anybody could help me in my problem?
    I made a table and would like only some of the rows to be selectable. Is this possible?
    The best solution would be to hide those squares on the left of the rows.
    Thanks in advance for your help.
    Piotrek
    Edited by: Piotr Kondratowicz on Feb 10, 2009 4:29 PM

    Hi Piotr,
    Create a value attribute of type boolean(Ex: ed) and assign it to all editable fields of the table.
    Based on a condition enable(ed=true)/disable(ed=false) the row fields as read only.Which will fulfill your requirement.
    Thanks & Regards,
    Jhansi Miryala

  • How to edit only audio tracks in multicam sequences?

    How can I cut only the audio track in a multicam sequence? I need it like in Final Cut Pro: Cut both video and audio, cut only video track x while audio track y remains untouched, cut only audio track x while video track y remains untouched. I can't find any solution. I use Premiere Pro CS6. Please don't recommend CC!

    Well, that's another nasty problem with multicam editing in PP. It cuts only the video but not both. The audio track is always that of the first selected clip (of that in the first video track) when I create a multicam sequence. I have manually to open it in the timeline, enable or disable certain audio tracks, go back to the sequence and cut. But when I have to switch the audio for only some camera angles it is impossible, because I can only change the audio track for the whole sequence. Or do I miss something? Maybe it is another cool "design feature"?

  • How can i select some row from multiple row in the same group of data

    I want to select some row from multiple row in the same group of data.
    ColumnA        
    Column B
    1                  OK
    1                   NG
    2                   NG
    2                          NG
    3                          OK
    3                          OK
    I want the row of group of
    ColumnA if  ColumnB contain even 'NG'
    row , select only one row which  Column B = 'NG'
    the result i want = 
    ColumnA         Column B
    1                         NG
    2                   NG
    3                          OK
    Thank you

    That's some awful explanation, but I think this is what you were driving at:
    DECLARE @forumTable TABLE (a INT, b CHAR(2))
    INSERT INTO @forumTable (a, b)
    VALUES
    (1, 'OK'),(1, 'NG'),
    (2, 'NG'),(2, 'NG'),
    (3, 'OK'),(3, 'OK')
    SELECT f.a, MIN(COALESCE(f2.b,f.b)) AS b
    FROM @forumTable f
    LEFT OUTER JOIN @forumTable f2
    ON f.a = f2.a
    AND f.b <> f2.b
    GROUP BY f.a

  • How to Gray out a row in ALV ?

    Hi Experts,
    I am having a requirement to gray a specific row in ALV . Is it possible through List Display  ? Or Is it possible through Grid Display ?
    If it is possible, please let me know how to achieve this .
    Thanks and regards,
    Kiran.

    Hello kiran kumar  ,
    you can colour a cell in AlV ie.  in turn you can colour entire row in one  Colour...just check out the blew given link
    http://wiki.sdn.sap.com/wiki/display/Snippets/ColorindividualcellsofanALVGRID
    Hope it helps.

  • How to identify the modified rows in ALV grid in OO

    Hello All,
    I have strange problem and i don't know how to solve it?
    I have ALV grid and in that ALV grid i have two buttons 'CONT' and 'ALLOC', when the user press 'ALLOC' button i will give a popup to make the user to enter some value.
    After entering the value i will do some calicualtions and i will distribute the amount in the fields of ALV grid and i should update the ALVGRID.
    Normally we can use CALL METHOD ME->REFRESH_TABLE_DISPLAY.( I have already checked by using this method and it worked fine)
    Here is the way my program look like
    ALVTREE1
    ALVTREE2
                 |----
    ALVGRID
    The problem is when i press the other button CONT i am unable to know what values exist in ALVGRID.
    How can i find these distributed amount in ALV?
    I hope i am clear while explaining problem.
    Here is  the required code:
      method handle_user_command.
        data: lt_fields       type table of sval,
              ls_field        type sval,
              ls_fieldcatalog type lvc_s_fcat,
              ls_merkpl       type zvhf_merkpl,
              lv_month(2)     type n ,
              lv_year(4)      type n ,
              lv_spmon        type zvhf_allocation-spmon,
              lv_value        type p.
        field-symbols: <fs> type any,
                       <ls_merkpl> type zvhf_merkpl.
        case  e_ucomm.
          when 'CNT'.
            call method gcl_gui_alv_grid->check_changed_data.
            call method dailogbox_container->set_visible
              exporting
                visible = space.
            call method gcl_gui_alv_tree2->frontend_update.
            call method gcl_gui_alv_tree2->update_calculations.
            clear: gt_merkpl.
          when 'ALCT'.
    Popup to get the values enterd by the user
            ls_field-tabname   = 'DD02V'.
            ls_field-fieldname = 'DDTEXT'.
            append ls_field to lt_fields.
            call function 'POPUP_GET_VALUES'
              exporting
                popup_title     = 'Enter value'
                start_column    = '1'
                start_row       = '1'
              tables
                fields          = lt_fields
              exceptions
                error_in_fields = 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.
            elseif sy-subrc = 0.
              read table lt_fields into ls_field index 1.
              if sy-subrc = 0.
                gv_value = ls_field-value.
    Read the table zvhf_allocation with nodekey  in order to get percentages
                select * from zvhf_allocation into table gt_allocation
                                   where dvkbur = gs_node_info-nodename.
    Read gt_merkpl in order to get existing line in ALV grid
                loop at  gt_merkpl into ls_merkpl.
    *Read FCAT inorder to find the field and move proprtinate value
                  loop at gt_fieldcatlog3 into ls_fieldcatalog.
    *Split is required to match ZVHF_ALLOCATION-SPMON  with screen text and to proprtinate the value
                    split ls_fieldcatalog-scrtext_l at '.' into
                          lv_month lv_year.
                    concatenate lv_year lv_month into lv_spmon.
    Check whether an entry exist or not in ZVHF_allocation
                    read table gt_allocation into gs_allocation
                                              with key spmon = lv_spmon binary search.
    *If an entry exist proprtinate the value as enterd in table
                    if sy-subrc = 0.
                      lv_value  = gv_value * gs_allocation-prozent.
                      lv_value = lv_value / 100.
                      perform assign_value using     ls_fieldcatalog-fieldname lv_value
                                           changing  ls_merkpl.
                      modify gt_merkpl from ls_merkpl.
                    endif.
                  endloop.
                 CALL METHOD gcl_gui_alv_grid->frontend_update.
                  call method gcl_gui_alv_grid->refresh_table_display
                    exceptions
                      finished = 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.
                endloop.
              endif.
            endif.
        endcase.
      endmethod.                    "handle_user_command
    If you have any further questions please let me know.
    Regards,
    Lisa

    Hello Vijay,
    Thanks for you reply,
    The event data_changed is not working because i called method refresh_table_display. So the event changed will not be raised after i press button CONT
    If i didn't call this method then i can see the value enterd by the user in ALV grid.
    So, do you have an more ideas.
    Regards,
    Lisa

Maybe you are looking for

  • JSON content - can't display image after click

    Hi to all, I am trying to to load a JSON file and load images with text information. I have a problem when i click the thumbnail, the large image can't displayed, i am receiving the following error: Failed to load resource: the server responded with

  • Why is it when iphone contacts send texts to me they go to imessage instead of sms?

    . m

  • Local Referance tag in Sun one server

    Hi All, In my ejb-jar.xml file have one ejb in that i have local Ejb. How i can spacify in the sun-ejb-jar.xml.when i trying to lookup the local ejb i got name not found exception .where as jboss we have one tag i.e. <local-jndi-name> like wise we ha

  • Continual crashes after launch

    Firefox 8.0.1 crashes randomly after launch - 5m to 30m after startup. Safemode crashes the same. Windows 7. Everything up to date. Been crashing this way for the last 2 months.

  • Access j2ee database schema

    Hi Experts, I am a SAP newbie Just a quick question about the j2ee schema.  This is the situation I have: I have installed two systems: a ABAP+Java stack and a Standalone Java. I am using oracle 9.2 dbase.  The j2ee dbase for the first system has the