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>

Similar Messages

  • Disabling fields(Make the field as non-editable)  in webdynpro ALV

    HI All,
    I have a requirement in the ABAP webdynpro where I have to disable(Make the field as non-editable) the field(or that ALV cell alone)  in the ALV after the user has inputed in that field.
    Is it possible, if yes, could you please give me some sample code , or links to which I can refer to.
    Thanks for your help.
    Regards,
    Subash M

    Hi,
    Use the following approach :
    1. Create an ALV and create an inputfield cell editor for the column that you want to make editable/disable.Refer this tutorial for creating an [Editable ALV|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1]
    2. Now under the same node create an attribute EDITABLE type boolean and bind this to the readonly property of the input field. Include the following code while creating Input field for binding.
    lr_input_field->set_read_only_fieldname( 'EDITABLE' ).
    3. Now implement the onDataCheck event or OnCellAction event and pass abap_true to this attibute to make the cell readonly/disable.Refer this tutorial for [Events in ALV|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/bd28494a-0801-0010-45a3-fc359d82d3e8]
    Hope this helps.
    Regards,
    Radhika.

  • Set editable/non-editable checkbox in alv grid

    Hi all,
    How to set a checkbox in alv grid in editable/non-editable. i am using alv gird display function module for this. i tried to used method  cl_gui_alv_grid=>mc_style_disabled. but its not working. is it possible to have this functionality in grid? please help. thanks in advance.

    Hi,
    Try like this.
    CALL METHOD gr_alvgrid->set_table_for_first_display
    EXPORTING
    I_BUFFER_ACTIVE =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    is_layout = gs_layout
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    CHANGING
    it_outtab = gt_list[]
    it_fieldcatalog = gt_fieldcat
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4
    regards
    Rajesh kumar

  • How to made Qty field as non editable in MIRO

    Hi SAP Gurus,
    While Post a Goods Receipt (MIRO) for Receive the Material from Job
    Worker, the Qty of Raw Material which needs to Issue or consume from
    Stock will propose as per PO BOM. The Qty field of Raw Material is in
    Editable Mode. Business wants that Qty Field to be Non-editable and not
    to allow user to Change the Proposed Qty. As per PO BOM and based on
    Material Received from Job Worker, Raw Material has to Issue or Consume
    from Stock. If any Under Consumption or Over Consumption will be
    adjusted thru MB04.
    Pls let me know is there any setting to make Raw Material Qty field as
    non editable.
    Thanks & Regards
    Sathish
    Ph:9940518715

    Hi,
    There is no field selection in MIRO.
    USE SHD0 and create a screen variant
    Thanks & regards,
    Kiran

  • How to make a field in non Editable mode

    Hi All:
    Now i created one form through wizard method this consists of following details
    Table name:T1
    Fields:No,Name
    here my requirement is how to make this "No" field in non editable mode after the insertion of the first record.

    You can make it a display item, you can disable the item, or you can set the update property to No. See the set_item_property in the Help documentation.

  • 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

  • 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 ALV  Dump:  at setting non editable attribute

    I have a problem with the ALV.
    I have 2 fields in the ALV: a editable Key field and a non editable dependent text field.
    I have binded a free programmed F4-Help at the key field.
    In the F4Component I set the Key-field AND the text-field via :
        lr_f4_context_element               TYPE REF TO if_wd_context_element.
        lr_f4_context_element = wd_comp_controller->listener->f4_context_element.
    ... set_static attribute.
    The values are visible in the two alv columns.
    But If I change the key after this manually I want to change the text field too.
    I change at on eventhandler ON_DATA_CHECK trough set_static_attribute.
    But I get later a dump for not assigned fieldsymbol:
    Der Abbruch trat im ABAP-Programm "CL_SALV_WD_DATA_TABLE========
      zwar in                                                       
    "SET_TABLE_CELL_REF". Das Hauptprogramm war "SAPMHTTP ".       
    Im Quelltext befindet sich die Abbruchstelle in Zeile 8        
    des (Include-)Programms "CL_SALV_WD_DATA_TABLE=========CM00J". 
      1 method set_table_cell_ref.         
      2                                    
      3   field-symbols:                   
      4     <l_value> type any.            
      5                                    
      6   assign r_value->* to <l_value>.  
      7                                    
    >>>   me->set_table_cell(              
      9     index     = index              
    10     attribute = attribute          
    11     value     = <l_value> ).       
    12                                    
    13 endmethod.                         
    How I can avoid the dump, but change the not editable text field, when the key field is changed?

    I could solve the problem with the context-mapping between the F4-component and the main-component.
    The Approach to set data from the F4-Component to the main component directly was wrong!

  • Table control : Need to change Single field as non editable

    Hi Experts,
                    Plz help me out. In a table control there r 7 fields and only one field is editable. When i change the status of a record as delete in tat table control, only the deleted record (all fields)should become non-editable. Is it possible? Pls suggest.
    Regards,
    J. Sriram.

    Hi,
    In PBO of your screen
    you should be using a step loop like this :
    CONTROLS control1 TYPE TABLEVIEW USING SCREEN 100.
    LOOP AT itab WITH CONTROL control1.
    ENDLOOP.
    Where the control1 is the tableview control defined in your program
    and placed on your screen.
    Put a second loop on screen inside this loop ant set the related attribute :
    LOOP AT itab WITH CONTROL control1.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'COLUMN1'.
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDLOOP.
    So you can set cells editable or non-editable
    and you can filter it which record & which field..

  • Need to do one field as non editable once a document is moved to 'executed' phase.

    Hi All,
    I have a field called 'comment' in Contract document. And once the document is moved to Executed phase all the fileds becomes non editable. And since 'Comment' is free text my user wants to do it as editable even when the document is in executed phase.The phases include
    1.Draft
    2.Budget Owner Approval
    3.Financial Approval
    4.Procurement Approval
    5.Approved
    6.Digital Signature
    7.Executed
    I tried this both in post phase script as well as pre phase script and found it's not working. Please suggest your ideas. Is there any other place I need to add code.
    Postphase
    if (phase.equals("Executed"))
    logMsg.setLogMessage(" Executed START ");
    Logger.info(logMsg);
    //Changes done by me
    comments = doc.getExtensionField("NON_DIGSIG_COMMENT").get();
    logMsg.setLogMessage(" Comments are " + comments);
    Logger.info(logMsg);
    IapiDocumentLockManager.unlockField(session,doc,"NON_DIGSIG_COMMENT");
    //Changes ended
    parent = doc.getParentIBean();
    if (hasValue(parent))
    // get associated vlv value for phase
    ValueListValueIBeanHomeIfc vlvHome = IBeanHomeLocator.lookup(session, ValueListValueIBeanHomeIfc.sHOME_NAME);
    if (classinfo == 1004)
    {// parent is Master Agreement
    vlvBean = vlvHome.findUniqueByNameType("Executed Agreement",10);
    } // end if classinfo == 1004
    else
    vlvBean = vlvHome.findUniqueByNameType("Executed Agreement",1);
    } // end else
    if (hasValue(vlvBean))
    vlvLocalizedRef = vlvBean.getLocalizedObjectReference();
    // set parent status
    parObjRef = doc.getParentIBean().getObjectReference();
    parentHome = IBeanHomeLocator.lookup(session, parObjRef);
    parentHome.upgradeToEdit(doc.getParentIBean());
    doc.getParentIBean().setStatusRef(vlvLocalizedRef);
    logMsg.setLogMessage(" Parent Status updated to " + vlvLocalizedRef.getDisplayName() + " ");
    Logger.info(logMsg);
    parentHome.save(doc.getParentIBean());
    logMsg.setLogMessage(" Parent saved ");
    Logger.info(logMsg);
    } // end if hasValue(parent)
    logMsg.setLogMessage(" Executive Summary Approval END ");
    Logger.info(logMsg);
    Prephase
    if (hasValue(other_phase) && hasValue(phase) && phase.equals("Approved") && other_phase.equals("Executed"))
            logMsg.setLogMessage("Entering comment block");
            Logger.info(logMsg);
            //Changes by Lakshmi
            comments = doc.getExtensionField("NON_DIGSIG_COMMENT").get();
        logMsg.setLogMessage(" Comments are " + comments);
        Logger.info(logMsg);
        IapiDocumentLockManager.unlockField(session, doc, "NON_DIGSIG_COMMENT");
            if (!bypassCheck)
            ae.chainAtEnd(doc.createApplicationException("NON_DIGSIG", "zclm.contractdocument.advancetoexecutedfromapproved"));
        } // end if (hasValue(other_phase) && hasValue(phase) && phase.equals("Approved") && other_phase.equals("Executed"))
    //Block added my me
        if (hasValue(other_phase) && hasValue(phase) && phase.equals("Digital Signature") && other_phase.equals("Executed"))
            logMsg.setLogMessage("Entering comment block");
            Logger.info(logMsg);
            comments = doc.getExtensionField("NON_DIGSIG_COMMENT").get();
        logMsg.setLogMessage(" Comments are " + comments);
        Logger.info(logMsg);
        IapiDocumentLockManager.unlockField(session, doc, "NON_DIGSIG_COMMENT");

    I agree with the definition of a position - that it's an occurrence of a job in an Organization. And I also couldn't agree with you more: that defintion shouldn't preclude you from moving the position around the company with re-orgs etc.
    Sadly that's a limitation of Oracle HRMS and there is no way to change the Organization of a position. You'll just have to streamline your processes to clone positions instead. Here, Position Copy is your friend:
    *HRMS Manager > Work Structures > Position > Position Copy
    There are also other tools that may help. Check out:
    Need To Change the Organization Associated with a Position [ID 375483.1]
    Does that help?

  • Making a header field as non editable while creating PO using ME21n

    Hi Friends,
    Could any one tell me the BADI or screen exit to make a header field (for eg: EKGRP - Purchasing Group) as non editable after giving default value to it?
    Thanks in advance,
    Ram

    Hi Ram,
    goto se80 t-code and give 'ME' package, and now see the enhancements available.
    You l get a relavent one, if you go through all those.
    Hope this helps
    Regards,
    Sujatha

  • Item field to non-editable mode(display mode) in Purchase Order(ME22n).

    Hi SDN,
    Based on the Comany code i need to modify the item level fields like <b>Item, Account Assignment, Material</b> to non-editable mode(display mode) in Purchase Order(ME22n).
    So i modifed in the method MODIFY_SCREEN_TC_LINE of class CL_TABLE_VIEW_MM and set the value L_FIELD_STATUS = *  for the screen filed MEPO1211-EBELP. When i execute, the whole column changed to display mode and the empty rows filled with 0(zero). But i want only grey mode for the line items that are present for that PO but not for the whole column. So can any one guide me to do so. I am using 4.6c.
    Thanks in Advance
    Regards
    Basha

    Hi Ramesh,
    Normally you can change the currency field, after entering information in Data base's table, go to Detail's table and change the rate as you want, then directly choose your PO number.
    so the system accept the rate entered aven though the PO had another rate.
    Regards.

  • Fields become non-editable when forwarding X11 session to Windows in Java 7

    I have found what I believe could be a bug in Java 7, and Swing specifically. The scenario in which it occurs is pretty rare, so it's not surprising that I couldn't find anyone posting about experiencing this issue, but it's an issue that happens consistently for our product and our users.
    Steps to reproduce:
    1) Download any Swing-based Java application (for instance, IntelliJ IDEA or SoapUI) on a Linux machine.
    2) SSH into this host machine from a Windows SSH client, using X11 forwarding (you can use this guide to set it up using PuTTy and Xming - http://blog.nth-design.com/2010/05/19/x11-putty-xming/ )
    3) Run the application, and make sure the application is running with JRE7.
    4) Try to edit some different text fields.
    When doing this, certain text fields that are supposed to be editable suddenly become non-editable. This issue does not occur if you repeat the above procedure with JRE6.
    If you need any further assistance in reproducing this issue, let us know.
    Regards,
    Arian Jafari

    pd**** wrote:
    I have the same issue and I can't believe that this isn't the number one topic on every Java forum. GUI applications simply DO NOT WORK on Java 1.7. Absolutely incredible that this bug that will render millions of Java applications unusable has not been fixed.The OP describes a somewhat rare use case (X11 session forwarding), and you turned it into "millions of GUI applications don't work"? I'm confused here.

  • How to make the field as non editable?

    Hi Gurus,
    I have created the WD leave applications which will trigger the BAPI(which returns half of the work structure allocated to the employee leave sickness)value  will be freezed in the input UI element.
    Right now am getting the above said value but UI element is in still editable mode.
    My requirement is once we freezed the value UI element has to be non editable.
    any useful clues will be higly appreciated with higher points...............
    Thanks in Advance,
    Dharani

    hai dharani,
    1.create a context attribute o type boolean and bind it to the ui elements enable property.
    2.use the following code to set the enable to false.
    3.wdContext.currentContextElement().setEnabled(false);
    Any issues let me know.
    Thanks n Regards
    Sharanya.R

  • 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.

Maybe you are looking for

  • USB ports not working properly

    I have a pavillion dv4 1123us - old.  It is not recognizing usb devices - although the usb ports are still providing power.  I have tried reinstalling the chipset and reinstalling the usb ports by deleting from device manager.  Intermittently, my mod

  • WARNING: Actions on button and MovieClip

    I have the following code that I am trying to get to work with ActionScript 3.0: on (rollOver) { gotoAndPlay("s1"); on (releaseOutside, rollOut) { this.gotoAndPlay("s2"); on (release) { this.gotoAndPlay("s2"); The problem is that ActionScript 3.0 wil

  • Cursor with IN CLAUSE in PACKAGE

    Hi Hope someone can help and I'm really not sure why Oracle makes it so difficult. To simplify, I have a package that takes an associative table - tabStr = {a,b,c} as input.Based on this, it build a string variable varStr which is of type 'a','b','c'

  • Reposition a movieclip on stage with coordinates from an xml

    Hello i am new to this forum, and kinda a beginner with actionscript. what i'm trying to do is reposition a movieclip already with the coordinates that will be in an XML file on my server. But so far no luck. This is what i have for AS3 var my_x:Numb

  • Bookmarks menu will not scroll down or select sub-folder

    When I select <Bookmark this page>, the Bookmark menu pop-up appears and I can see the see the many sub-folders of bookmarks that I have but I cannot scroll down the list nor select a specific sub-folder. I am running FF v 8.x on Windows 7. The bookm