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?

Similar Messages

  • ADF DI : Need to disable edit on a column in excel spread sheet

    Hi,
    I need to make a column disable for edit in ADF table in excel.I tried making read only property to true but , user can still edit that column but will get update failed error.I want my column to be completely disabled even for editing.Is there any way to disable edit on the column and makes it grey out??
    Thanks in Advance,
    Alekhya

    I have enabled worksheet protection, with only the Column i need to be
    made read only. Accodring to the ADF DI Dev guide, "The end user can insert a
    full row or column. However, once inserted, they cannot be deleted.". But
    even full row insert shows up disabled. Its not allowing me to insert a new row at all.

  • HOW TO MAKE TABLE CONTROL NON EDITABLE

    hi all
    how to make table control non editable
    Thanks & Regards
    harsha

    Hi,
    Try this code in the PBO inside the module in the LOOP...ENDLOOP.
       IF SY-TCODE EQ 'ZEMPLDISPLAY'.
        LOOP AT SCREEN.
         if screen-name eq 'column1' or screen-name eq 'column2'.  "Give the names of the columns in the table control
          SCREEN-INPUT = '0'.
          MODIFY SCREEN.
        endif.
        ENDLOOP.
      ENDIF.
    Or you can go the Layout of the table control in Change mode and for every column's attributes, make it 'Output' only field. Check  'Output only' field.

  • How to disable sorting for some columns in a ALV GRID?

    Hi i have requirement where I have to disable sorting for some columns in a ALV GRID. i am using REUSE_ALV_GRID_DISPLAY function module.
    Can anybody help me. how to acieve this? Any code snippets will really be appreciated.

    Hi,
    I have tried this but not completely successful. I think this can be done using the OOPS method.
      DATA: it_event_exit TYPE  slis_t_event_exit.
      DATA: w_exit TYPE slis_event_exit.
      w_exit-ucomm = '&ODN'.
      w_exit-before = 'X'.
      CLEAR w_exit-after.
      APPEND w_exit TO it_event_exit.
      w_exit-ucomm = '&OUP'.
      w_exit-before = 'X'.
      CLEAR w_exit-after.
      APPEND w_exit TO it_event_exit.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program          = w_repid
          i_callback_top_of_page      = 'ALV_TOP_OF_PAGE'
          i_callback_html_top_of_page = 'ALV_HTML_TOP_OF_PAGE'
          i_callback_user_command     = 'USER_COMMAND'  <- User command form
          is_layout                   = wm_layout
          it_fieldcat                 = wt_fieldcat
          it_events                   = i_events
          it_event_exit               = it_event_exit    <- Need to fill
          it_sort                     = wt_sort
          i_default                   = 'X'
    Now you can capture this events in the user command
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
      IF r_ucomm = '&OUP' and rs_selfield-SEL_TAB_FIELD = 'Your field name'.
      ENDIF.
    ENDFORM.                    "user_command
    In this form you will get the function code in 'r_ucomm' and the field selected for sorting in 'rs_selfield-SEL_TAB_FIELD'. But reseting 'r_ucomm' will not work.
    May be somebody else can give some help on this.
    But this will work if you follow the oop method.
    Please see this document for more info.
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an easy reference for alv grid control.pdf
    Thanks
    Vinod

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

  • Sap.m.Table: How to disable includeItemInSelection for one column?

    Dear UI5 Experts,
    I have used includeItemInSelection method for whole table as it is required for me on selectionChange event in sap.m.Table control.
    Now, I have a requirement where I need to disable that method for one column. Is there a way to disable includeItemInSelection method for only one column in sap.m.Table control. Please Advice.
    Thank you!
    Regards,
    Sai Vellanki

    Hi,
    you can use method oTable.bindAggregation
    Refer example sap.m.Table and see the source code.
    Regards,
    Chandra

  • How to Make a Table control Field Editable but input disabled

    Hi All,
        I got a requirement that in table control one column should be in edit mode (i.e. input enabled) but user should not be able to type anything in that field or column rather he can select the value from F4 help (or pick list) associated with that field or column. How to do this ? Please dont say make sceeen-input = 0 for that field.
    Experts please help me out...........
    Thankx in Advance
    Rizwan Ahmad Siddiqui

    Hi,
    I suggest you to go for a drop down instead of a search help.
    Regards,
    Charumathi.B

  • How to delete columns in table control (tab Services) for transaction ME51

    Hi, gurus!
    We're facing this problem in our upgrade: we have a batch input (ME51) in order to create purchase requisitions, but we get an error with the dynpro data (program: SAPMM06B, dynpro: 0102).
    We are sure we populate all the required fields in that screen.
    The only possible reason we find for that error is the fact  that we have two new entries in table control (in tab services=> Current settings there are 67 fixed columns)
    We had to add in table T162V (which previously had only 65 columns for each variant): ESLL-SRVMAPKEY y ESLL-EXTERNALID, as described on note 1382685, so table control and table T162V could have same number of fields.
    We guess we could solve the batch input error deleting those fields in both table control and T162V, but don't know how.
    We really would appreciate any clue.
    Thanks in advance.
    Best regards,
    J. Madariaga

    It's an own batch input.
    The error is: "Batch input information for dynpro SAPMM06B 0102 does not exist", but the fields in that screen are alright.
    And that batch input works fine in another client with same patch level, but without fields ESLL-SRVMAPKEY and ESLL-EXTERNALID in table T162V, so I guess that could be the problem (not sure about it, of course).
    Regards,
    J Madariaga

  • IB51, IB52 : Page up & Page Down option for table control disabled

    Hi experts,
    IB51, IB52 Page up & Page Down option for table control is disabled.
    We want to use these options in the table control while recording .
    Can any one tell us?
    Regards,
    Lakshmi

    Hi,
    You can refer to Note 379208 .
    The same is applicable in CRM too.
    Thanks ,
    Jomy

  • Table Control in Editable mode

    Hello All,
    I have created an infotype which has a table control. But all the table control lines are in non-editable mode. I would like to have all the lines in editable mode.
    Kindly help out.
    Regards,
    shails

    If your internal table contains no record and when you are refering to the table control then all the lines will get disabled.
    Now you will be knowing the number of lines your table control displays in singe page...say 10 lines.
    So initially in the PBO append 10 initial lines to your itab. then set the property lines of the table control to the total lines of internal table.
    Now in pbo capture the user command page down and append 10 initial lines to your itab.
    Hope you got the idea.
    Now if your itab already has some records , then just set the lines as total record count of your internal table.
    Also change the property in the screen attributes for each field of the control

  • Generic Table Control in ABUMN for multiple transfer of assets

    Hi Experts,
    Problem Description
    We are trying to use transaction ABUMN for multiple asset transfer.
    We need to transfer more than one assets to multiple assets by quantity
    and value.
    Our Efforts/Observation
    Instead of going ahead with BDC/LSMW, we tried using table control to utilize standard SAP functionality.
    For making this happen, we are trying to use the Generic Table control which is available in ABUMN once you click on "Multiple assets" button.
    However, even though we are making fields like
    EL7, EL8 etc available in the screen (by removing check from the "Invisible" check box), they are in display mode and are not giving me any option to select quantity and value that needs to be transferred from each asset.
    We need to assign these fields to some field like quantity/percentage so that they can be used.
    If you see, the column header is also blank.
    We need to transfer hundreds of assets, hence requesting you to please
    fix this urgently so that we can transfer assets and close the quarter.
    Thanks in advance for your help and support,
    Nitish Gupta
    +919867458892

    Hi Nitish,
    I'm sorry, transaction ABUMN will never get this functionality you requested.       
    For mass transfer, customers have the possibilities to use batch input on  transaction ABUM or BAPI.                                                                               
    Please refer customer to the following note :   216806  New posting transactions and batch input                                                                               
    regards Bernhard

  • 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

  • Expand Table Control with Fields for Purchase Order Item Overview

    Hi Gurus.
    Hereu2019s something easy for you, I hope/ think. We just want to additionally show the field u201CMFRPNu201D in the purchase order item overview. See structure MEPO1211 for the table control.
    How can we do this? Is it possible without a modification? Is there anything to pay attention to?
    Lot's of questions, because we donu2019t find any complete solutions yet. It seems there are no official SAP suggestions for this issue.
    Thanks in advance!
    Regards
    Patric

    Is there no one out there who can answer my question?

  • Table control disables all the lines

    hi Goo day,
    i have worked a lot on on TC and am struggling to get it right with the insert option.
    i have button on the main screen where i read the data and fill the table control and display on the RADIO Button How many records are in the TC.
    So i click the button and get into the TC but accept the records that i have displayed will all be disabled. even if i try to enable a line by insert i cant do it.
    PROCESS AFTER INPUT.
    LOOP AT IT_WAGON.
       chain.
       field : IT_WAGON-TRAIN_NUM,
               IT_WAGON-DELAY_MIN.
        MODULE modify_tabview_wagon.
       endchain.
    ENDLOOP.
       IF sy-ucomm = 'INST'.
          DESCRIBE TABLE it_wagon LINES v_count.
         ADD 1 TO v_count.
         INSERT it_wagon INDEX v_count.
        ENDIF.
    i want to know why they are are disabled.
    what can i do to overcome.

    Do this in the PBO.
    rob

  • Data in table control not seen for the Standard Transaction Iview

    Hi
    I am creating one Standard Transaction Iview for CATS .
    While doing print preview in IE 6 , I am not able to see data in Table control(Data Entry Area ).
    Can you please provide me the solution for how I can see the data in Table Control
    Regards
    Ruturaj

    Hi David,
    I too struggled a lot to find the solution ....atlast got it....It possible by exporting and importing the table control values to Database Index.
    1. AT SELECTION SCREEN OUTPUT event  triggers when you SAVE and GET the variant.
    2. So write the logic in AT SELECTION-SCREEN OUTPUT event.
    CONSTANTS: c_vari TYPE char30 VALUE
                             '(SAPLSVAR)RSVAR-VARIANT'.
      FIELD-SYMBOLS: <lfs_vari> TYPE ANY.
      ASSIGN: (c_vari) TO <lfs_vari>.
      IF sy-subrc = 0.
        IF <lfs_vari> IS NOT INITIAL.
          IF ok_code = 'SPOS'.
            EXPORT gt_chars[] TO DATABASE vari(tc) ID <lfs_vari>.
          ELSEIF ok_code = space.
            IMPORT gt_chars[] FROM DATABASE vari(tc) ID <lfs_vari>.
          ENDIF.
        ENDIF.
      ENDIF.
    In the above logic if OK_CODE is 'SPOS', that is for saving the variant with the name <lfs_vari>.
    Similarly if the OK_CODE is other than, 'GET'....that is for retrieving the variant. But in case of getting the variant OK_CODE is not filled with 'GET', but variant will be filled. We should take variant filling as base and do as done above.
    It worked for me.....

Maybe you are looking for

  • Calling a soap web service from a java desktop application

    Hi, Does anyone know how to call a soap web service from a java desktop application? I've seen examples using Apache Axis, but it sounds like Axis needs to run on a web server and we are trying to avoid that. My initial thought was that, "of course w

  • Java 1.4.2 swing (setBounds) performance problem

    Hi, We were having performance problems with swing ever since we moved to java 1.4.2 and we finally switched back to 1.4.1. However, we have now traced the problem to JVM and the following simple code demonstrates it. I would like to hear from others

  • How to create ADF region without Task Flow

    I want to divide my page into different regions, but I don't want to have any bounded task flow under each region. I want to include Page Fragment inside the Region. I find the example of creating Region using some page flow, would you please help me

  • Xsl:param question

    hi in my xsl I have something that is like <xsl:param name="x" select="@somevalue"/> that @somevalue is suppose to have a value assigned to it (so it is dynamic).......but I can't figure out how it might work can someone provide my some info as to ho

  • Import to iPhoto from external hard drive 'importing photos' remains on

    Hi, When I import to library (from the file list) from my external hard drive the photos are added to my library. However the 'importing photos' from the source pane remains on with the dial rotating! This stays on unless I 'force quit' iPhoto. After