ALV Grid fields from editable to non-editable mode

Hi,
I am displaying my data through ALV Grid. In my grid the non-key fields are in editable mode.
When I edit any of the editable fields and place the cursor on other field the field which I have edited should become disable(non-editable). Again if I want to edit the same field which is now in non-editable mode should again change to editable mode when the cursor is placed on it.
Thanks & Regards,
Adithya M.

Hi Adithya,
I am confused by your statement "place the cursor on other field the field which I have edited should become disable" -- are you stating that this is the requirement or what is currently happening with your program.  The way the edit fields should work by default is they are editable at all times unless you tell it otherwise. 
If you are saying your requirement is to change the field to disabled once the field is edited (runtime change), first you want to handle the event on data changed then within your method of handling on data changed, you can disable the field from being edited by using cell styles and changing the value to disabled. 
If you look at program BCALV_GRID_EDIT,
You will find code where it disables the field for edit using Cell Style -- this will give you an idea how Cell Style controls editable fields and display fields:
        ls_cell-style  = cl_gui_alv_grid=>mc_style_enabled.
        ls_cell-maxlen = 4.
        ls_cell-fieldname = 'CARRNAME'.
        append ls_cell to gt_sflight-cell.
This specific code will set the field disabled when the program is first exectued, in your case if you need to do this at run time, after someone edits the field, you need to implement handling the event on data changed, in the same program you will find:
method handle_data_changed.                 
   perform data_changed using er_data_changed.
endmethod.                     
It is within this method that you can disable a field for editing.
However, once it is disabled you will not get back into the handle_data_changed method.  I'm not sure I understand your statement "Again if I want to edit the same field which is now in non-editable mode should again change to editable mode when the cursor is placed on it."  Why would you want the user to be able to edit something, then show it disabled, then let them click on it and edit it again?  Why not just leave it in edit mode?  Maybe if I understand the requirement better, I can answer this portion of the question. 
If this is based on security or changing from edit to display for the entire grid, you can run the same program mentioned above and click on the Change/Display button in the top left to see how it enables and disables the entire grid for editing.
Cheers,
Bonnie

Similar Messages

  • How to design ALV GRID with a column in NON-editable Mode and has F4 Help?

    Hello Friends,
      How to code for ALV GRID, which has a column that takes value only from F4 Help and does not accept any other user input?
    Can I have that column non-editable and yet has F4 Help?
    Please help ASAP.

    Hi,
      The examples in the mentioned programs do not suffice my problem.In these programs. They have made the cell non-editable but you cant even input value through F4 Help.
    I want to make a cell non-editable (which can be changed only through F4 Help), which do not accept user input.

  • ALV grid field editable/non editable at runtime

    Hi All,
    I am working on alv grid using containers. I have to make few cells in grid to editable and few othres to non editable which I did using styles by defining table type lvc_t_styl and updating my main internal table. Now once grid is displayed for first time (using set_table_for_first_display) it has required fields in editable and non editable as required. But now on triggering of data_changed event I have to change the editable cells to non editable and the non editable cells to editable. I tried doing this as same way as I have done before calling set_table_for_first_display method i.e. by  defining table of type lvc_t_styl in data_changed event and modifying my main internal table but this time the editable fields are changed to non editable and again becomes editable. Same problem with non editable cells also. They become editable and again becomes non ediatble of there own. Can anyone suggest any solution.
    <b>Note: Points awarded for helpful answers</b>
    null

    Hi,
    Check this link.I am explaining the steps for this.
    Kindly reward points by clicking the star on the left of reply,if it helps.<a href="https://wiki.sdn.sap.com/wiki/display/Snippets/ALV-Editingandsavingtheeditedvaluesin+Database(OOPS)">Editing OOPS ALV</a>

  • How can we make edit and non edit of rows on particular conditions in alv

    hi experts,
                   i am very new to web dynpro for abap.i have one query regarding alv.
    in one view i have alv table with two line items,and line each line item having foue editable fields and remaining are non editable.
    now i am navigating to another view and make some action.here i have generated one value  and updated this value to one field ofselected  line items of alv table in the previous view.now i am coming back to previous view .now i want to display the row of alv table which contain value which is generated in second view as completely non editable and remaining rows are as it is .
    hi guys please look into this and suggests me.

    Hi babu,
    You can do this in one view it self.
    create a one attribute of type wdy_boolean.. in view context.
    Bind these attribute to read only property of table.. and  initially set the value to abap_true in wddoinit method.
    Then create one button say "EDIT" in view and create action for edit button.. in that action set the above attribute value to
    abap_false.
    so now, initially table will be in display mode, when you click on edit mode...it will become editable mode...
    Hope you got some idea.
    Regards
    Srinvias

  • ALV for fields from multiple tables and make them editable

    Hi,
    I am working on a forecasting report. We have created few custom table e.g. store forcaset detail for whole year month wise. tables are say sales data, budget data, forcast data etc.
    Now i need to make a report based on monthwise based on above mention table.
    eg.o/p looks like:
    column name                     type desc monthapr monthmay .......
    table forcast                      Qty  sales    100          150
    table budget/sales             amt   amou    20.50    130.50
    table sales vs forcast       amt   amount  3000     50000
    -Now i don't know how to display data from multiple table in single ALV list that to with different field type.
    -2nd issue is i need to make only perticuler row editable so that user can chage data.
    -3rd when user change data and press calulate button - it should calculate data for future month - i got formula for that and disply the calulated data.
    - 4th if user like the forcast data then when press save - change data should update dbtable.
    Is this all possible with simple abap FM Or need to use ABAPOO.
    I will appericiate all expert help.
    Many thanks in advance.
    KDE.
    Edited by: kde_test on Jun 4, 2010 5:44 PM

    Hi,
    Solutions :
    1. You can use  FM REUSE_ALV_HIERSEQ_LIST_DISPLAY as guided by Ashutosh.
    You can also check out this
    [http://www.sap technical.com/Tutorials/ABAP/3DGraph/demo.htm]  change link to saptechnical without space
    2. [How to make certain rows in ALV grid editable...;
    3 & 4. Use two importing paramaters 'PF_STATUS_SET' 'USER_COMMAND' of  REUSE_ALV_GRID_DISPLAY.
    create two function codes 'CALC and 'SAVE' in pf-status and provide your required functionality to these function codes using User-Command.
    Sorry am unable to provide you with supporting code, but you can search for it and It can solve your problem
    Regards,
    Rohit

  • How to control edit checks on alv grid fields

    I have set up an alv grid that allows for user input. 
    The fields are defined from the data dictionary. 
    Edit checks are happening on all fields, but I would like to turn that off for some fields. 
    How is that controlled?
    Regards!

    u need to define ur own field catalog for this purpose, for the fields for which u want to set check box, add property like this
      X_FIELDCAT-FIELDNAME = 'LIFNR'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-SELTEXT_L  = 'VENDOR'.
      X_FIELDCAT-NO_ZERO    = 'X'.
      X_FIELDCAT-OUTPUTLEN  = 10.
      X_FIELDCAT-COL_POS    = 1.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
      X_FIELDCAT-FIELDNAME = 'BUKRS'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-CHECKBOX = 'X'.
      X_FIELDCAT-SELTEXT_L  = 'COMPANY'.
      X_FIELDCAT-NO_ZERO    = 'X'.
      X_FIELDCAT-OUTPUTLEN  = 4.
      X_FIELDCAT-COL_POS    = 2.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
        CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
          EXPORTING
            I_PROGRAM_NAME         = SY-REPID
            I_INTERNAL_TABNAME     = 'IT_FINAL'
            I_INCLNAME             = SY-REPID
          CHANGING
            CT_FIELDCAT            = IT_FIELDCAT
          EXCEPTIONS
            INCONSISTENT_INTERFACE = 1
            PROGRAM_ERROR          = 2
            OTHERS                 = 3.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            I_CALLBACK_PROGRAM = SY-REPID
            IS_LAYOUT          = L_LAYOUT
            IT_FIELDCAT        = IT_FIELDCAT
          TABLES
            T_OUTTAB           = IT_FINAL
          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.
    u can even check program BCALV_EDIT_05, award points if found helpful

  • Editable and non editable issue in ALV OOPS

    Hi All,
    After giving the input in selection screen when i execute the report program will display the output in ALV OOOps.
    Here i need few fields in Editable and some fields are non editbale mode. I can't use Edit  ='X" in fieldcatalog.
    I refered few threads in SDN at last  i found the method cl_gui_alv_grid=>mc_style_enabled. using this method also i am not getting. PLz see below sample code.
        gs_celltab-fieldname = 'Z_MESSAGEID'.
        gs_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
         INSERT gs_celltab INTO TABLE gt_celltab.
          gs_final-celltab = gt_celltab.
          APPEND gs_final TO gt_final.
    I am passing GT_FINAL to below mthiod.
        CALL METHOD grid->set_table_for_first_display
          EXPORTING
            i_save               = 'A'
           i_default            = 'X'
            is_layout            = gs_layout
            is_variant           = gs_variant
            it_toolbar_excluding = gt_exclud
          CHANGING
            it_fieldcatalog      = gt_fieldcat[]
            it_outtab            = gt_final[].
    still inut all fields are in disply mode. Any body can suggest me how to approach.
    Regards,
    Maheedhar

    Here is the sample code.
    DATA :PT_CELLTAB Type LVC_T_STYL,
               LS_CELLTAB TYPE LVC_S_STYL,
               L_MODE type RAW4.
      LS_CELLTAB-fieldname = 'KUNRG'.
      LS_CELLTAB-style = cl_gui_alv_grid=>mc_style_disabled.
      Insert LS_CELLTAB Into Table PT_CELLTAB.
      LS_CELLTAB-fieldname = 'KUNNR_AG'.
      LS_CELLTAB-style = cl_gui_alv_grid=>mc_style_enabled.
      Insert LS_CELLTAB Into Table PT_CELLTAB.
    Append X_OUTTAB to TB_OUTTAB.
    *---Switch edit mode 0 for No-edit 1 for Edit
      CALL METHOD g_grid->set_ready_for_input
        EXPORTING
          i_ready_for_input = 1.
    its recommended to use the below events for editable mode to handle changed data
    example
    handle_data_changed
           FOR EVENT     data_changed OF cl_gui_alv_grid
               IMPORTING e_onf4
                         e_onf4_before
                         e_onf4_after
                         er_data_changed,
    Handle data Change Finished
        handle_data_changed_finished
           FOR EVENT data_changed_finished OF cl_gui_alv_grid
               IMPORTING. ...
    Edited by: Ashwin Kumar Chitram on Oct 3, 2011 8:06 PM

  • Setting a Text field in adobe form non editable

    Hi Experts,
    I have generated a Adobe form using webdynpro java. I have  couple text fields. They are binded with some values which a RFC returns. When I see the output These text fiels values which are populated from backend are editable. Can anyone suggest me how to make these text fields non editable.
    Thanks,
    Raj

    Hi Raj,
    You have to set the properties of these text field as readonly.
    For this you have to select the text field ... Go to the Object Pallete.
    There you will see three Tabs Field, Value and Binding.
    You have to click on Value Tab  and there you have select the Type as Read Only.
    If you do not have Object Pallet open .. go to Menu Bar Window and Click Object
    This will solve your problem.
    Cheers
    Satya

  • Make editable and non-editable some cells in ALV OO

    Hello Experts, i have a table like this:
    KUNNR DATE VALUE1
    And a search button that obtains data, and then display the information in the ALV, like this
    KUNNR DATE       VALUE1
    1000     1.1.2009    A
    1001     2.2.2009    B
    Also i have a button that append  an empty line to the ALV
    I want that the kunnr retrieved in the search be non-editable
    But i want that the kunnr cell in the appended line be editable
    How can i do this?
    THANKS!
    Edited by: Mariano Gallicchio on Jun 26, 2009 3:45 PM

    when (sy-ucomm for New row)
    LOOP AT <fcat> into <workarea>
       CASE <workarea>-fieldname.
          WHEN 'KUNNR'.
    * Making a column as Editable
            <workarea>-edit = 'X'.
        ENDCASE.
      ENDLOOP.
    Kanagaraja L
    Edited by: Kanagaraja  Lokanathan on Jun 26, 2009 4:01 PM
    Edited by: Kanagaraja  Lokanathan on Jun 26, 2009 4:02 PM

  • How to make some fields of a view non editable

    Hi experts,
    I need to make some fields like system user, system time and system date of a view non editable and after saving values for all other editable fields, the system should fill the values for the non editable fields as well.
    Kindly help in this regard.

    I am assuming that you created a maintenance view for your table. Under view fields there is a column called 'Maintenance Attribute for view field' (one character field with 'P' in the column. Set that column value to 'H' for the fields that you want to hide.
    You then have to go to SE54, give your maintenance view name, in the menu, 'Environment-->Events' create an event 01 with your own code to fill in those hidden fields. Look with key words 'Table Events' in this forum and you will get a lot of examples.

  • Sold to party field should be editable and non-Editable for diff sales org

    Hi,
        in creation of SO,i want SP field should be editable for Domestic sales org and Non Editable for Export sales org.
    please help on this.

    Dear Mohanty,
    In sales order, for domestic sles SP is editable - It is Normal process.
    Non Editable for Export sales org.
    In this how user will enter the sold to party while creating sales order.
    And did you create export customer classification in Sales org rather Distribution channel.
    Regards,
    Mani

  • How to make Date fields Editable or Non-Editable based on Call Staus

    Hi,
    We are using CRM2007 Web GUI for Service call creation. We are using date profile to populate the dates. Here my requirement is if call status is 'Call created' then some set of date fields to be appeared in display mode(Non Editable) and some set of date fields to be appeared in change mode(Editable). How to achieve this. Kindly suggest me.
    Regards,
    Steve

    Hello,
    Kindly check the following thread which is giving many solutions for your requirement:
    Re: how to make field non-editable (display mode)
    Kind regards,
    Nicolas Busson.

  • How to make some fields of table as non editable through SM30

    Hi,
    I craeted a custom table and maintained thriugh sm30. 2 fields should be read only. Can any one help me un that
    Regards,
    Jayaram

    Create  a view   and in  the maintain status   ,make it read only so that  the  fields  will be  on  read only mode  .
    Girish

  • F4 help in ALV grid field

    Hello Experts,
    I am using cl_salv_table=>factory to display ALV grid.
    Now I also want to attach f4 help in one of the field of ALV grid.
    I am unable to locate any event or method.
    Please help.

    Hello,
    @Marcin: The aim to display values in search help is not to select values for editable field in alv grid but to display some additional information based on value in that field.
       If search help is not possible, then dropdown can also work for me or pls provide any other solution to this.
    I had tried implementing dropdown, for that I am using class "cl_salv_column_list" method "set_dropdown_entry".
    From this I am able to see dropdown icon for my field but not able to populate values in dropdown.
    Pls help in populating values in dropdown.
    My logic is:-
    Based on the values in the field in alv grid I have to calculate value dynamically to be displayed in search help or drop down list.

  • ALV Grid bug when dealing with non-ASCII character

    Dear all,
    I have a requirement to display user's remarks on ALV.  The data element of the remarks column is TEXT200.  I know that each column in an ALV Grid can display at most 128 characters.  Since my SAP is an Unicode system, I expect that each column in my ALV Grid can display 128 Chinese characters, too.  However, the ALV Grid only display 42 Chinese characters at most.  Is this a bug in ALV Grid?  How can I fix it?
    I did a small experiment.  The results are listed below.  My version is Net Weaver 7.01.  The results show that the bug does not exist in ALV List.  However, my user prefers ALV Grid, which is more beautiful and elegant.
    Type of ALV
    Max number of
    ASCII character
    in an ALV column
    Max number of
    non-ASCII character
    in an ALV column
    REUSE_ALV_GRID_DISPLAY
    128
    42 Chinese characters
    CL_SALV_TABLE
    128
    42 Chinese characters
    CL_GUI_ALV_GRID
    128
    42 Chinese characters
    REUSE_ALV_LIST_DISPLAY
    132
    132 Chinese characters
    If you encounter the bug, please post your solution.  Thanks a lot. 

    It looks like limitation of ALV grid cell, which can contain up to 128 bytes in SAP gui.
    Your unicode characters are probably 3 bytes each.
    Check OSS Note 910300 for more detailed info.
    EDIT: Note 1401711 seems to be a correction for your issue It allows to use 128 characters (even if they take more than 128 bytes).

Maybe you are looking for

  • My first generation ipod nano freezes on language menu. All a can do is reset it

    Hi! My 1st generation ipod nano froze today on the menu. I've resetted it holding the select and menu button and i've restored it from itunes a few times. Now it freezes on the language menu. It's like the wheel and select button don t work anymore,

  • Downpayment  and then invoice (milestone)

    Dear Frnds,                     I have a few issues working with billing plan............pls do assist I am currently using Milestone billing plan for customer transactions. The client  billing plan has booking amount, next installment and Final inst

  • Ranlib usage in Solaris 10 - Sparc vs i386

    Hi I have applications which use ranlib (though obseleted, but legacy software) as a part to create static libraries. Now it works fine on the SPARC Solaris 10, but when the same software is compiled in i386 Solaris 10, the static libraries are not f

  • Robohelp 10 - Inserting a Last modified date in a topic - how can it be achieved?

    Hi there, this is my first post, so apologies if I am in the wrong place... I would like to insert a "last modified" date in my topics, but can't figure out how to do this! The Date field inserts today's date whenever the topic is opened, and so does

  • X301- Enough power for my needs?

    Hi- I'm considering buying a X301 with the main factor easy transportablity because of frequent business trips.  My needs are simple- word processing, small spreadsheets, email and internet surfing.  However, the processor is ancient by todays comput