ALV Row Editable for specific column

Hi,
  I am creating a transaction using ALV  - Webdynpro. I would like to enable or disable the row ,(specific column in that row ).
Problem is very similar to the thread posted in the below link.
enable or disable row in alv
Please let me know how to achive the scenario.
Thanks,
Kumar

Hi Kumar,
Have a look at [this thread|How to set some rows in ALV to be editable or some non editable.; in which I have given the complete code to solve your problem. There is one post which explains how to set the cell editor, and one more post explains setting the cell as editable or read only.
You need to bind the read_only property of your node attribute (i.e, whichever column you want this behavior on), to another attribute (say FLD_READ_ONLY) in the same context node. And based on the value in attribute FLD_READ_ONLY, the cell property would be changed. Define this attribute of type char01. So based on your business logic, if you want the cell to be read only, set X in the attribute, and if you want it to be editable, set space.
I hope that would be clear enough. Please revert for any clarifications. Depending on your requirement, if you want the read_only property to change on lead selection, you can get the lead selection index and set the attribute FLD_READ_ONLY = X / space only for that element. This would make only one cell editable at a time.
You could also refer to this recent [thread|ABAP WebDynpro: Can edit a cell in a column?; for the same issue, where you would have some additional pointers.
Regards,
Nithya

Similar Messages

  • IsCellEditable() to disable cell editing for specific columns

    Hello experts:
    My SSCCE for this question is at the below link:
    http://forum.java.sun.com/thread.jspa?threadID=5293914&messageID=10244030#10244030
    My question is how do I disable cell editing for all but the "Price" column of my table in the SSCCE. I tried adding the below lines of code right after creating the JTable. But get compilation errors.
    //Here is the block of code that I am trying to include.
         @Override                                                       
         public boolean isCellEditable(int row, int col) {     
         if (col == 7) {                                                  
                   return true;
              } else {
                   return false;
         } //Below is the method in detail03.java showing the block of code added
    private JScrollPane BuildEmptyTable() {
         model = new DefaultTableModel();
         model.addTableModelListener( this );
         model.setColumnIdentifiers(new String[] { "SKU","Qty", "Price"});
            tblDetailTest = new JTable(model);
         @Override                                                       
         public boolean isCellEditable(int row, int col) {     //     <----- I tried placing the
         if (col == 7) {                                        //                  the code block here
                   return true;
              } else {
                   return false;
         tblDetailTest.setRowHeight(20);
         tblDetailTest.setPreferredScrollableViewportSize(new Dimension(900, 100));
         JTableHeader tblHdr = tblDetailTest.getTableHeader();
         tblHdr.setBackground(Color.yellow);
         JScrollPane scrollPane = new JScrollPane(tblDetailTest);
         return scrollPane;
    }Can somebody please guide me? Thank you very much.

    oops!
    Sorry, my bad! I did not tell you what I tried. Following your suggestion, I made the following 2 changes to the code:
    In the method, BuildEmptyTable(), where I build the table structure, I have the following statement:
         tblDetail = new JTable(model){
    public boolean isCellEditable(int row, int col) {
           return col == 8;
    };And in a separate method after the table is populated with data, I have the below code:
         tblDetail.getModel().addTableModelListener(new TableModelListener() {
         public void tableChanged(TableModelEvent e) {
         if (e.getType() == TableModelEvent.UPDATE)
              int row = e.getFirstRow();
              int column = e.getColumn();
                 if (column == 8){
                   //code here
                   System.out.println("Updating item price!");
         }I do understand that the message gets displayed as many number of times equal to number of rows inserted into the table, because of the UPDATE event. But my problem is I do not know how to make a code change to do what I exactly want, as I have indicated in my previous note. Meaning I want the listener to be called only when the
    data in the editable cell changes.
    Thank You.

  • Hide row values for certain column in GRR2

    Hi Experts,
    Looking for some help in report painter. I need to hide row values for certain columns in report painter. The requirement is I have 5 columns in the report, the 5 th column is the sum of col 1 to 4 and in my row i have a formula setup to sum of values for each column, what i would like to do is for column 1 thru 4 i didnt want to display the total values in row total but i wanted to dispaly value for column 5 in row total. I have been trying my best with putting formula, but couldnt succeed.
    Could somebody let me know is there an way to get this addressed.
    Thanks in advance
    Best Regards,
    gj

    How was it achieved ? Did you use sections for the columns for which rows needed to be hidden?
    I have a smiliar issue of hiding certain rows for few columns.

  • Showing Sub-Totals only for Specific Column in PowerView

    Hi,
    Is there a way of showing the sub-totals only for specific columns in a PowerView Matrix?
    I am only aware of showing the sub-totals for all or non of the columns.
    Thanks and Regards,
    Justin

    Hi Justin,
    According to your description, you want to get sub-totals specific columns within columns group. Right?
    In this scenario, we can use IIF() function in expression to achieve your goal. The expression will only return the total value when the column value is a specific value, otherwise we can make it return nothing. Try the following expression:
    IIF(Fields!Column.Value="[specific value]",Sum(Fields!Total.Value),nothing)
    We have tested this scenario in our local environment. Here are screenshots for your reference:
    Reference:
    Expression Examples (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Web Dynpro ALV disable column sort for specific column

    Hi,
    I have the above mentioned problem. The Coding I use is:
    DATA:  lr_field_settings  TYPE REF TO if_salv_wd_field_settings,
                lt_fields          TYPE SALV_WD_T_FIELD_REF.
    FIELD-SYMBOLS:  <fs_field>  LIKE LINE OF lt_fields.
    lr_field_settings ?= lr_config.
    lt_fields = lr_field_settings->get_fields( ).
    READ TABLE lt_fields ASSIGNING <fs_field> WITH KEY fieldname = 'ANSPRECH_DETAILS'.
    IF sy-subrc EQ 0.
      <fs_field>-r_field->if_salv_wd_sort~set_sort_allowed( abap_false ).
      <fs_field>-r_field->if_salv_wd_sort~set_grouping_allowed( abap_false ).
    ENDIF.
    When debugging I can see that the object attributes for sort_allowed and grouping_allowed are changed from 'X' to ' '
    but the running application still allows sorting and grouping for the column 'ANSPRECH_DETAILS'.
    So what did I forget or what is my mistake ????
    Thx for your help.
    Dino Dini

    I got the similar requirement and I tried to do the below way.. it worked for me..
    DATA: lr_field_settings TYPE REF TO if_salv_wd_field_settings.
    DATA: lr_field TYPE REF TO cl_salv_wd_field.
    lr_field_settings ?= lr_table.
    lr_field = lr_field_settings->get_field( 'MATNR' ).
    lr_field->IF_SALV_WD_SORT~SET_SORT_ALLOWED( abap_false
    you can observe in the below image that sort option is not enabled for MATNR in the ALV.

  • Get column value for specific columns

    I want to change the default behavior of a IKM. In a specific step, I need to call a PLSQL procedure inside the loop below, and that procedure will substitute the insert clause. The procedure uses only some attributes, and I need to check the name of each one when I use the getColList method.
         for aRecord in myCursor loop
              insert into      <%=snpRef.getTable("L","TARG_NAME","A")%>
                   <%=snpRef.getColList("", "[COL_NAME]", ",\n\t\t\t", "", "((INS AND (NOT TRG)) AND REW)")%>
                   <%=snpRef.getColList(",", "[COL_NAME]", ",\n\t\t\t", "", "((INS AND TRG) AND REW)")%>
              values
                   <%=snpRef.getColList("", "aRecord.[COL_NAME]", ", \n\t\t\t", "", "((INS AND (NOT TRG)) AND REW)")%>
                   <%=snpRef.getColList(",", "aRecord.[COL_NAME]", ", \n\t\t\t", "", "((INS AND TRG) AND REW)")%>
         end loop;
    For example, to call the procedure I do that: schema.proc_1(col1, col2, col3). However, I have more than 3 columns, and I need to restrict them when I use the getColList method. I would like to know if there is a way to get only specific columns, giving these names. I pass the name of the column, and the method should return its value. Can I use the getColList to do that? Is there any other way to do that?

    Hi Luciene,
    You can use the UD flags to do this. If you click on one of your mappings in the Diagram tab of your interface you will notice several UD flags (UD1 to UD5) you can use those to flag the columns you want to use in proc_1.
    To summarize:
    - at the interface level flag the columns you want to use in your PL/SQL code -> check UD1 for all of them
    - modify your IKM code:
    <%=odiRef.getColList(",", "COL_NAME", ",\n\t\t\t", "", "((INS AND TRG) AND REW AND UD1)")%> <- retrieve columns flagged with insert, not read only, mapped on target and with UD1 flagged. The "AND UD1" part can be used in other getColList.
    Hope this helps.
    Thanks,
    Julien

  • Make a filed Non-Editable for specific Users

    Hi Experts
    Any Idea How can I make fields of any Table non-editable for a specific Group of Users.
    My Requirement
    I have 4 fields namely, Customer Name, Address, Pincode,City which at time of creation is open to user but once updated and customer is created,  I need to make it non-editable for a specific Group of user.
    Please advice.
    Regards
    Prashant

    Hello Neethu,
    I just wanted to confirm one of the sentence in the above post.
    I feel that the option 2 can also be achieved (Once record is approved and gone through all processes of WF and saved in MDM.Specific users should not modify the record.)
    For this we need to create validation where we need to mention the User
    Just create a Status field and write an expression as
    IF(STATUS FIELD [RECORD]=STATUS[DONE] AND UPDATED BY="USER NAME",FALSE,TRUE)
    for this the automatic execution type property should be set to error.
    Only difficulty is that we need to mention all the users for whome we want to remove the write access once the record is saved.
    Rgds,
    Prasad.

  • ALV: F4 help for a column wanted, but without any check

    Hello,
    I have an ALV and I use a DDIC structure for the field catalog. My requirement is that for all columns in ALV, the F4 should appear normally (using the DDIC information), but I do not want an automatic check for the value entered by user.
    So .e.g. if in F4, possible values are 1, 2, 3 then the ALV throws an error if user leaves the field blank (because blank was not a possible value for the domain of the field). How, can I by-pass this automatic check by ALV (while still keeping the F4 help)?
    Regards,
    Mohit

    Hi hope u know the difference between value table and check table.
    In this case you have to give value table as F4 reference but not check table.
    I mean consider the field Plant. if you are defining plane with reference to master table T001w and u r entering a value not in T001W it will give error. because here it is check table. where as define the plant with refence to MARC. then MARC will be value table. and dont give error if you enter any plane value not there in MARC.
    Try to find out value tables for your fields and use. Then it will work.

  • Disable DataGrid row selection for a column?

    Hi,
    I have a DataGrid with a CheckBox in one column. When the CheckBox itself is clicked, or any point in the CheckBox column
    is clicked, I *don't* want the grid row selected. IOW, row selection should be disabled for the column. How to get this behavior?
    Thanks, Garry

    Hi All,
    I do have almost similar requirement where I have image overlay-ed on row, on whose click a context menu should appear but row should not get selected.
    Row selection should happen if user clicks elsewhere on that row (apart from overlayed image).
    I tried below lines in MouseClick event listeners.
    event.stopImmediatePropagation();
      event.stopPropagation();
    Above lines stopped itemClick event but didnt prevent the row selection.
    Regards,
    Pavan

  • Single row editing for multiple tables in a single page

    Hi!
    I have split a table with many many columns into more tables with a lower number of columns. There is an ID column (sequence generated) that is Primary Key common for all tables. Obviously, the relationship between these tables is 1 to 1, so it’s not about having to build master-detail pages.
    What I need now is to edit all these tables in a single page: one single row from each table. The Automated Row Fetch & Automatic Row Processing (DML) processes used for the old table must be replaced by something else.
    Is there a way to use in a single page more pairs of such processes for more tables?
    I want to avoid manually writing processes with lot of PL/SQL code to handle row fetch & update.
    Keep in mind that the page will have an ID item that can be used to identify unique rows in all my tables.
    Thanks,
    Sorin

    I have split a table with many many columns into more tables with a lower number of columns
    IMHO that is a very bad idea. There is nothing wrong with having many columns in a table. If you would like to split them to better "categorize" them, just create views on the table and expose different subsets of the columns.
    I want to avoid manually writing processes with lot of PL/SQL code to handle row fetch & update.
    That is unavoidable given how you have designed the underlying tables.
    You could try creating a view that joins all the tables by the PK and creating a form based on that view. Then write a INSTEAD OF trigger on the view that "doles out" the DML on the view to each of the underlying tables.

  • Reg : ALV row editable status

    Hi All,
    I am displaying an ALV report with some of the rows as non editable and some as editable.
    Now when user selects a particular row I want to check weather the row is editable or non editable.
    I there any method which can give the current editable status of the row.
    Thanks In advance
    Vijay

    Hi,
    A possible alternative is to take a checkbox with all the records (in field catalogs).
    Also take an additional field in internal table as flag(1) TYPE c to be used for checkbox in alv.
    So, the rows which are enabled for input, keep checkbox as checked.
    And if you add a new row then also check the checkbox so that you can easily identify the selected row.
    Hope this solves your problem.
    Regards,
    Tarun

  • Disable row selection for certain column in JTable

    I have a JTable with several columns, one of which contains an "Info" button. I already have it worked out that when I click on the "Info" button, that event gets passed from the JTable to the button. I have multi-select enabled for the JTable, but I don't want clicking on the "Info" button to change the current selection. I have a klugy "fix" working where I save off the current selection, and then restore it after the user presses the "Info" button. However, this results in "flashing" - the row containing the selected "Info" button becomes selected briefly, then the original selection is restored. How can I avoid this? I would like to just ignore selection events on the "Info" column, but still pass the mouse click event through to the button.
    Any suggestions?

    try this
            JTable table = new JTable() {
                public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend) {
                    if (!getColumnModel().getColumn(columnIndex).getIdentifier().equals("Info")) {
                        super.changeSelection(rowIndex, columnIndex, toggle, extend);
                    }//else

  • Table Control: Disabling editing for a column

    Hi everyone. Greetings from Buenos Aires, Argentina.
    First of all, I want to apologize for this question in case of it has already been made. The forum is too large to read it completely and I really need the answer, if any, to my trouble.
    I have a table control inside a screen. In it's PBO, I coded a module to change the table control attributes. I declared a work area like the line of the table control's control in order to loop it. I mean this:
    In the TOP of Table Control (I made it by using the wizard) I have this:
    CONTROLS: TC_1 TYPE TABLE VIEW USING SCREEN dynpro_number)
    And in the PBO module I have typed the following:
    MODULE control_change_attrs OUTPUT.
    DATA: wa_tc_1 LIKE LINE OF TC_1-COLS.
    LOOP AT TC_1-COLS INTO wa_tc_1.
    ENDLOOP.
    ENDMODULE.
    In the (...), I have put code with such a logic that, depending of the contents of certain fields in the dynpro, it will hide (or not) some columns of the Table Control. This part is made correctly.
    This logic, also makes (or should make) the table control to disable the input of a column, depending wether a flag is active or not. This flag is activated in other screen's PAI, which is called depending on the contents of the sy-ucomm field of this screen (the one with the table control).
    The (...) is something like this (I'll omit some parts):
    IF wa_tc_1-screen-name = 'COLUMN_TO_HIDE'.
       IF gv_flag = 'X'.
          wa_tc_1-screen-input = 0.
       ENDIF.
       MODIFY TC_1-COLS FROM wa_tc_1.
    ENDIF.
    In a PAI module of this screen, I have coded the following:
    MODULE user_command INPUT.
    CASE gv_ok_code.
       WHEN 'RUN'.
          PERFORM RUN.
        WHEN ...
    ENDCASE.
    END MODULE.
    And in the RUN subroutine, obviusly among other things, I have this:
    CALL SCREEN 0150 STARTING AT XX YY.
    In a module in the PBO of the screen 0150, I clear gv_ok_code. In a PAI module, this is what I have put:
    CASE gv_ok_code.
       WHEN 'ACCEPT'.
          gv_flag = 'X'.
          CLEAR gv_ok_code.
          LEAVE TO SCREEN 0.
      WHEN ...
      WHEN ...
    ENDCASE
    The thing is, when the contents of gv_ok_code is 'ACCEPT' and therefore the flag is activated, then the 0150 screen's PAI finishes and the previous screen's PBO is processed, I know for sure (by the mean of the debugging mode) that the table controls's atrributes are correctly modified, and the most important thing, they stay like that... But, the column desired does not gets disabled, at least not until the NEXT PBO (I mean, it gets disabled when I press the Enter key).
    Why is happening this?

    Thanks a lot for the response, Max.
    I' ve been testing your answer. When I implemented the code that you suggested, after the first PAI, the table control's columns appear as I want.
    The thing is, in order to test if the changes in the columns are reflected in the screen after the call of the dynpro no. 0150 (and the obvious return to the first one), I need to be able to select one or more table control's rows (since when I followed the table control wizard, I made it with selection column, and with multiple selection). But, after implementing your code, I'm not able any longer to select any rows.
    I click on them, but they don't turn yellow. I commented the call of the module inside the LOOP AT itab... of the PBO and I was able to select them once again, so we're sure the problem is caused because of the call to this new module. But why?
    Note: you should know, since the table control is with multilpe selection, the LOOP sentence in the PBO is like this:
    LOOP AT itable
           INTO work_area
           CONTROL tc_1
           WITH CURSOR tc_1-current_line.
    MODULE change_attribs.
    ENDLOOP.
    Does that give a hint to you?

  • FSG - Overriding the Account Row Assigment for a column

    In an FSG we would like to have a column which returns a stat value from a code combination in order have a calculation in the report.
    For example - see table below - the "opening hours" are posted into a code combination which we'd like to use in each row of the report. This is then used to calculate the final column by dividing the actual value for the row by the opening hours value.
    We can do this in Excel, but would like the capability of
    FSG Calculation Example                         
         Actual     Budget     Variance     Opening Total $
    Revenue:     $'000     $'000     $'000     Hours     Per Hour
    General Sales     100     90     10     150     667
    Add on sales     200     210     -10     150     1333
    Commissions     50     45     5     150     333
         350 345 5
    How can you get the column to orveride the row account assignment to show he same value from one account code for each row?
    Many thanks

    >
    I am trying to find the length of a particular row in a table..is it possible to?
    >
    No - not without trying to calculating it yourself. What exactly is it you need the exact length for?
    There are at least two types of 'length': the number of bytes used by Oracle to store the data in its internal format and the length used for a display format. And the internal format also includes bytes for structure information (e.g. a length byte); those affect the actual data storage.
    For example a column defined as DATE requires a length byte and seven bytes for the date data itself in the internal format. And the length in bytes of character data such as VARCHAR2 depends on the actual characters stored in the column and the characterset. For single-byte character sets each character requires one byte of storage but multi-byte characters can take up to four bytes.
    And a column defined as NUMBER can take 1-22 bytes for the internal storage but the display format would be different for the data itself as well as needing a sign and a possible decimal point.
    See 'Oracle Built-in Data Types' in the SQL Language doc
    http://docs.oracle.com/cd/E11882_01/server.112/e17118/sql_elements001.htm

  • SQL query to see table names for specific columns

    hi
    i have a database containing more than 100 tables. I want to see all the tables containg a column 'Employee_id'. plz tell me SQL query some other way.
    Thanks

    Time to learn data dictionary basics
    SELECT DISTINCT table_name
    FROM all_tab_cols
    WHERE column_name ='EMPLOYEE_ID';

Maybe you are looking for

  • Why Cant I Undelete FIles?

    I have a Mac Pro with an SSD and HFS+ drive it is only 128 GB so I do have to empty parts of it often. I am considering having an HDD on the side as some programs are taking too much space, yet, I am surprised at the inability to recover materials th

  • Silence at the beginning of a bounced file

    most times that i bounce a wave file and convert it into an mp3, i get about 20 seconds of silence at the beginning of the file and the last 20 seconds of the song is cut off. any suggestions? thanks!

  • How do I set my text notification to just a vibration?

    Im not even sure if this is possible, but I just want my text notification to be a vibration instead of a sound. I've tried putting the vibrate option on and text sound to 'None', but it doesn't work.

  • Exciting! BT Infinity being rolled out - could I h...

    Hello, I've been watching excitedly as the FTTC has been rolled all over our town (Ramsbottom) and the new Huawei cabs are being put in place. Hoorah. We are due to get Infinity in Q1 2011 and it's looking great. Our nearest cab is being installed to

  • Photoshop elements 12 purchased but stating it was a trial membership

    I recently purchased this photoshop element 12 and adobe premiere.  Yesterday it stopped working stating my "trial period" had expired.   How do I get it working again.