Make Non-editable Column in Table Control of ME21N and ME22N

Hi Experts,
I was trying to look for a solution to make the columns for field MEPO1320-SLFDT(Stat Deliv. Date), MEPO1320-EEIND (Deliv. Date) and MEPO1211-NETPR (Net Price) from transaction ME21N and ME22N to be non-editable ONLY when Qty Received (MEPO1320-WEMNG) > 0.
I'd found that the modify screen codes were located at Class CL_TABLE_VIEW_MM, Method MODIFY_SCREEN_TC_LINE but there were no enhancement spots available to add my code. Is there any other method i can use to make those fields non-editable?
Thanks in advance!
Cheers,
Cheng
Edited by: Cheng Mei Tan on Jun 4, 2009 9:31 AM

Hi Cheng,
I think you can use this BAdi: ME_PROCESS_PO_CUST - Enhance Processing of Enjoy Purchase Order.
Use the method PROCESS_ITEM to control the fields at the item level.
I think is not possible to make the fields non-editable, however, you can put an error message whenever your condition is verified, and the user won't be able to change the fields.
Cheers,
Pedro

Similar Messages

  • Editable columns in table control?

    Hi Gurus,
    I am using table control. When I click one button(Add Structure ) i am creating table rows with data, example it creates 3 rows everytime on click on this button. But coming to colmns, for first row i want first 2 columns are in edit mode, in 2nd row 3, 4th colms are in edit and in 3rd row last 2 cols are in edit mode.
    For this i searched in this form i got some solution, i applied that but i am getting first row all columns in edit mode.
    I tried like this ... I created 3 attributes INV1, INV2,INV3 of type wdy_boolean in node. binded with enable property first 2 cols to INV1 like that. and on ADD_STRUCT button action code like this.
      DATA lo_nd_structure TYPE REF TO if_wd_context_node.
      DATA lo_el_structure TYPE REF TO if_wd_context_element.
      DATA ls_structure TYPE wd_this->Element_structure.
      data lt_structure type wd_this->Elements_structure.
    navigate from <CONTEXT> to <STRUCTURE> via lead selection
      lo_nd_structure = wd_context->get_child_node( name = wd_this->wdctx_structure ).
    ls_structure-month1 = First Month.
    APPEND ls_structure TO  lt_structure.
    ls_structure-month2 = Sec Month.
    APPEND ls_structure TO  lt_structure.
    ls_structure-month3 = Third Month.
    APPEND ls_structure TO  lt_structure.
    lo_nd_structure->bind_table(  new_items  =   lt_structure    set_initial_elements = abap_false ).
      DATA DIS1 TYPE WDY_BOOLEAN.
      DATA DIS2 TYPE WDY_BOOLEAN.
      DATA DIS3 TYPE WDY_BOOLEAN.
      DIS1 = ABAP_TRUE.
      DIS2 = ABAP_FALSE.
      DIS3 = ABAP_FALSE.
      lo_nd_structure->set_attribute(
       name =  `INV1`
      value = DIS1 ).
      DIS1 = ABAP_FALSE.
      DIS2 = ABAP_TRUE.
      DIS3 = ABAP_FALSE.
      lo_nd_structure->set_attribute(
       name =  `INV2`
      value = DIS2 ).
      DIS1 = ABAP_FALSE.
      DIS2 = ABAP_FALSE.
      DIS3 = ABAP_TRUE.
      lo_nd_structure->set_attribute(
       name =  `INV3`
      value = DIS3 ).
    ENDMETHOD.
    Thanks,
    Madhan.

    Hey Madhan,
    Try is like below.
    DATA lo_nd_structure TYPE REF TO if_wd_context_node.
    DATA lo_el_structure TYPE REF TO if_wd_context_element.
    DATA ls_structure TYPE wd_this->Element_structure.
    data lt_structure type wd_this->Elements_structure.
    * navigate from <CONTEXT> to <STRUCTURE> via lead selection
    lo_nd_structure = wd_context->get_child_node( name = wd_this->wdctx_structure ).
    ls_structure-month1 = First Month.
    ls_structure-INV1 = ABAP_TRUE.
    ls_structure-INV2 = ABAP_FALSE.
    ls_structure-INV3 = ABAP_FALSE.
    APPEND ls_structure TO lt_structure.
    ls_structure-month2 = Sec Month.
    ls_structure-INV1 = ABAP_FALSE.
    ls_structure-INV2 = ABAP_TRUE.
    ls_structure-INV3 = ABAP_FALSE.
    APPEND ls_structure TO lt_structure.
    ls_structure-month3 = Third Month.
    ls_structure-INV1 = ABAP_FALSE.
    ls_structure-INV2 = ABAP_FALSE.
    ls_structure-INV3 = ABAP_TRUE.
    APPEND ls_structure TO lt_structure.
    lo_nd_structure->bind_table( new_items = lt_structure set_initial_elements = abap_false ).
    ENDMETHOD.
    Thanks
    sarbjeet singh

  • How to Enable and Disable column in Table Control.

    Hi all,
    I want to make certain column of Table control as Enable or Disable on Button action.
    Enable means ready for input and Disable means not ready for input.
    Please send me sample code.
    Thanks in advance.

    Hi Vipin,
        You have to loop through the table columns to set the properties in the PBO of your screen.
    Here is the sample solution.
    delcare a workarea for the columns in the table control in your top include.
    Table Control .
    CONTROLS: TAB1 TYPE TABLEVIEW USING SCREEN '0100'.
    DATA: WA_COLS LIKE LINE OF TAB1-COLS.
    in your screen
    PROCESS BEFORE OUTPUT.
      MODULE INTIALISE_100.
    *&      Module  0100_INTIALISE  OUTPUT
    MODULE INTIALISE_100 OUTPUT.
        LOOP AT TAB1-COLS INTO WA_COLS.
          WA_COLS-SCREEN-INPUT = 1.
          MODIFY TAB1-COLS FROM WA_COLS TRANSPORTING SCREEN-INPUT.
        ENDLOOP.
    ENDMODULE.                 " 0100_INTIALISE  OUTPUT
    modify the screen-input property as required for the table control columns.
    Please provide points if helpfull.....
    Thanks,
    Karthik
    Message was edited by: Karthik
            Karthikeyan K

  • How to get sum of quantity column in table control

    Hi, expert ,
    Someone can guide me how to get som of qty column in table control ?
    I created a screen with a table control  and has a  qty quantity field .
    I want to show total of qty  in a  field .
    my code like this ...
    PROCESS AFTER INPUT.
      LOOP AT I_tab.
        CHAIN.
           FIELD I_tab-COUNTQTY MODULE  caculate_total_qty .
        endchain.
        MODULE UPDATE_TOTAL_QTY  .
      ENDLOOP.
    but, when I Back to the previous screen
    It's caculate again so I always get wrong Total quantity .
    anyone can help me ...

    Hi , Dhina
    I have another question .
    I use internal table data in table control to update  database table .
    The data in the db will be change ,
    but each record I want to delete in table control , it's still exist in database .
    my code is
    WHEN 'SAVE'
         MODIFY YDSGBT53 FROM TABLE I_YDSGBT53 .
         COMMIT WORK .
      END CASE
    How  to fix my code and let it can change and delete data in database  ?
    or
    when I delete record  in table control I must to delete data in the database too .
    Edited by: TitusFang on Jun 16, 2011 3:21 AM

  • Editable columns in table don't select the whole row

    I am new to the forums and posted this to the wrong one the first time and I am not sure how to move it so I am just reposting it here. Sorry.
    I have a table with 7 columns. 2 of them are non-editable and the rest are either radio buttons or check boxes. When I click on the 2 non-editable columns, the whole row gets highlighted. When I click on any of the editable columns, the button is selected, but the whole row is not highlighted. If I made the editable columns non-editable then the whole row gets highlighted when the column is clicked on. I want the button selected and the row highlighted when the editable columns are clicked on. Here is some relevant code:
    class PackageTable extends JPanel
        public PackageTable(String pathfile)
           fieldsok = true;
           errorfield = new JTextField(250);
           startfield = new JTextField(250);
           stopfield = new JTextField(250);
           tableModel = new MyTableModel();
           table = new JTable(tableModel)
             public Component prepareRenderer(TableCellRenderer renderer, int rowIndex, int vColIndex)
               Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
               if (vColIndex == 0)
                 c.setBackground(new Color(238,238,238));
               else
                 c.setBackground(new Color(255,255,255));
               boolean selected = isRowSelected(rowIndex);
               if (selected)
                 c.setBackground(Color.yellow);
               return c;
           table.setPreferredScrollableViewportSize(new Dimension(300, 1000));
           table.setRowSelectionAllowed(true);
           table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
           TableColumn column = null;
           for (int col = 0; col < 7; col++)
              column = table.getColumnModel().getColumn(col);
              if (col == 0)
                column.setPreferredWidth(30);
              else if (col == 1)
                column.setPreferredWidth(300);
              else if (col == 2)
                column.setPreferredWidth(10);
                column.setCellRenderer(new RadioButtonRenderer());
                column.setCellEditor(new RadioButtonEditor(new JCheckBox()));
              else if (col == 3)
                column.setPreferredWidth(10);
                column.setCellRenderer(new RadioButtonRenderer());
                column.setCellRenderer(new RadioButtonRenderer());
                column.setCellEditor(new RadioButtonEditor(new JCheckBox()));
              else if (col == 4)
                column.setPreferredWidth(10);
                column.setCellRenderer(new RadioButtonRenderer());
                column.setCellEditor(new RadioButtonEditor(new JCheckBox()));
              else if ((col == 5) || (col == 6))
                column.setPreferredWidth(10);
      class RadioButtonRenderer implements TableCellRenderer
        public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column)
          if (isSelected)
            setForeground(table.getSelectionForeground());
            setBackground(table.getSelectionBackground());
          else
            setForeground(table.getForeground());
            setBackground(table.getBackground());
          if (value == null)
            return null;
          return (Component) value;
      class RadioButtonEditor extends DefaultCellEditor implements ItemListener
        private JRadioButton button;
        public RadioButtonEditor(JCheckBox checkBox)
          super(checkBox);
        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
          if (value == null)
            return null;
          button = (JRadioButton) value;
          button.addItemListener(this);
          return (Component) value;
        public void addCellEditorListener(CellEditorListener listener)
          listenerList.add(CellEditorListener.class, listener);
        public void removeCellEditorListener(CellEditorListener listener)
          listenerList.remove(CellEditorListener.class, listener);
        protected void fireEditingStopped()
          CellEditorListener listener;
          Object[] listeners = listenerList.getListenerList();
          for (int i = 0; i < listeners.length; i++)
            if (listeners[i] == CellEditorListener.class)
              listener = (CellEditorListener)listeners[i+1];
              listener.editingStopped(changeEvent);
        protected void fireEditingCanceled()
          CellEditorListener listener;
          Object[] listeners = listenerList.getListenerList();
          for (int i = 0; i < listeners.length; i++)
            if (listeners[i] == CellEditorListener.class)
              listener = (CellEditorListener)listeners[i+1];
              listener.editingCanceled(changeEvent);
        public void cancelCellEditing()
          fireEditingCanceled();
        public boolean stopCellEditing()
          fireEditingStopped();
          return true;
        public Object getCellEditorValue()
          return button;
        public boolean isCellEditable(EventObject event)
          return true;
        public boolean shouldSelectCell(EventObject event)
          return true;
        public void itemStateChanged(ItemEvent e)
          super.fireEditingStopped();
      class MyTableModel extends AbstractTableModel
        String[] columnNames = {"","Configuration Files","Sorts","Plots","Both","Print","Alerts"};
        public MyTableModel() { }
        public int getColumnCount()
          return columnNames.length;
        public int getRowCount()
          return totaldata.size();
        public String getColumnName(int col)
          return columnNames[col];
        public Object getValueAt(int row,int col)
          return(((Vector)totaldata.get(row)).get(col));
        public Class getColumnClass(int c)
          return getValueAt(0, c).getClass();
        public boolean isCellEditable(int row, int col)
          if ((col == 0) || (col == 1))
            return false;
          else
            return true;
        public void setValueAt(Object value, int row, int col)
          Vector v1 = new Vector();
          v1 = (Vector)totaldata.get(row);
          v1.set(col,value);
          if (col == 1)
             if (((String)value).indexOf("/") == -1)
               JOptionPane.showMessageDialog(pdsframe, "The CONFIG file that was entered on line " + (row+1) + " is not valid.");
               v1.set(col,(Object)"");
               return;
          fireTableCellUpdated(row, col);
          fireTableChanged(new TableModelEvent(this));
        public void addNewRow(Vector newRow)
          totaldata.add(newRow);
          fireTableRowsInserted(totaldata.size()-1, totaldata.size()-1);
        public void deleteRow(int Row)
          totaldata.remove(Row);
          fireTableRowsDeleted(totaldata.size()-1, totaldata.size()-1);
      }I have searched forever to try to find how to do this and I can't seem to get it right. If all the radiobuttons in one column are selected and I click on one of those rows in one of those columns, then the whole row is highlighted.
    Can anyone help me out?
    Thanks.
    esk3 {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Sorry. I didn't know that I had to provide something that could be executed. I am going to try to put enough in so that it can. This is part of a larger program and this frame is called from another frame. Here it is. I hope it works.
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Dimension.*;
    import java.util.*;
    import java.text.*;
    // Java extension packages
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    import javax.swing.JTable.*;
    import javax.swing.JScrollPane.*;
      private JFrame     pdsframe;
      private String printchecked;
      private String alertschecked;
      private JTextField cb;
      private JTextField pf;
      private JScrollPane scrollpane;
      private JTable table;
      private MyTableModel tableModel;
      private Vector totaldata;
      private JLabel startlabel;
      private JLabel stoplabel;
      private JTextField startfield;
      private JTextField stopfield;
      private JTextField errorfield;
      private boolean fieldsok;
      class MyTableModel extends DefaultTableModel
        String[] columnNames = {"","Configuration Files","Sorts","Plots","Both","Print","Alerts"};
        public MyTableModel() { }
        public int getColumnCount()
          return columnNames.length;
        public int getRowCount()
          return totaldata.size();
        public String getColumnName(int col)
          return columnNames[col];
        public Object getValueAt(int row,int col)
          return(((Vector)totaldata.get(row)).get(col));
        public Class getColumnClass(int c)
          return getValueAt(0, c).getClass();
        public boolean isCellEditable(int row, int col)
          if ((col == 0) || (col == 1))
            return false;
          else
            return true;
        public void setValueAt(Object value, int row, int col)
          Vector v1 = new Vector();
          v1 = (Vector)totaldata.get(row);
          v1.set(col,value);
          if (col == 1)
             if (((String)value).indexOf("/") == -1)
               JOptionPane.showMessageDialog(pdsframe, "The CONFIG file that was entered on line " + (row+1) + " is not valid.");
               v1.set(col,(Object)"");
               return;
          fireTableCellUpdated(row, col);
          fireTableChanged(new TableModelEvent(this));
        public void addNewRow(Vector newRow)
          totaldata.add(newRow);
          fireTableRowsInserted(totaldata.size()-1, totaldata.size()-1);
        public void deleteRow(int Row)
          totaldata.remove(Row);
          fireTableRowsDeleted(totaldata.size()-1, totaldata.size()-1);
      class RadioButtonRenderer implements TableCellRenderer
        public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column)
          if (isSelected)
            setForeground(table.getSelectionForeground());
            setBackground(table.getSelectionBackground());
          else
            setForeground(table.getForeground());
            setBackground(table.getBackground());
          if (value == null)
            return null;
          return (Component) value;
      class RadioButtonEditor extends DefaultCellEditor implements ItemListener
        private JRadioButton button;
        public RadioButtonEditor(JCheckBox checkBox)
          super(checkBox);
        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
          if (value == null)
            return null;
          button = (JRadioButton) value;
          button.addItemListener(this);
          return (Component) value;
        public void addCellEditorListener(CellEditorListener listener)
          listenerList.add(CellEditorListener.class, listener);
        public void removeCellEditorListener(CellEditorListener listener)
          listenerList.remove(CellEditorListener.class, listener);
        protected void fireEditingStopped()
          CellEditorListener listener;
          Object[] listeners = listenerList.getListenerList();
          for (int i = 0; i < listeners.length; i++)
            if (listeners[i] == CellEditorListener.class)
              listener = (CellEditorListener)listeners[i+1];
              listener.editingStopped(changeEvent);
        protected void fireEditingCanceled()
          CellEditorListener listener;
          Object[] listeners = listenerList.getListenerList();
          for (int i = 0; i < listeners.length; i++)
            if (listeners[i] == CellEditorListener.class)
              listener = (CellEditorListener)listeners[i+1];
              listener.editingCanceled(changeEvent);
          }      fireEditingStopped();
          return true;
        public Object getCellEditorValue()
          return button;
        public boolean isCellEditable(EventObject event)
          return true;
        public boolean shouldSelectCell(EventObject event)
          return true;
        public void itemStateChanged(ItemEvent e)
          super.fireEditingStopped();
      class PackageTable extends JPanel
        public PackageTable(String pathfile)
           fieldsok = true;
           errorfield = new JTextField(250);
           startfield = new JTextField(250);
           stopfield = new JTextField(250);
           tableModel = new MyTableModel();
           table = new JTable(tableModel)
             public Component prepareRenderer(TableCellRenderer renderer, int rowIndex, int vColIndex)
               Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
               if (vColIndex == 0)
                 c.setBackground(new Color(238,238,238));
               else
                 c.setBackground(new Color(255,255,255));
               boolean selected = isRowSelected(rowIndex);
               if (selected)
                 c.setBackground(Color.yellow);
               return c;
           table.setPreferredScrollableViewportSize(new Dimension(300, 1000));
           table.setRowSelectionAllowed(true);
           table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
           TableColumn column = null;
           for (int col = 0; col < 7; col++)
              column = table.getColumnModel().getColumn(col);
              if (col == 0)
                column.setPreferredWidth(30);
              else if (col == 1)
                column.setPreferredWidth(300);
              else if (col == 2)
                column.setPreferredWidth(10);
                column.setCellRenderer(new RadioButtonRenderer());
                column.setCellEditor(new RadioButtonEditor(new JCheckBox()));
              else if (col == 3)
                column.setPreferredWidth(10);
                column.setCellRenderer(new RadioButtonRenderer());
                column.setCellEditor(new RadioButtonEditor(new JCheckBox()));
              else if (col == 4)
                column.setPreferredWidth(10);
                column.setCellRenderer(new RadioButtonRenderer());
                column.setCellEditor(new RadioButtonEditor(new JCheckBox()));
              else if ((col == 5) || (col == 6))
                column.setPreferredWidth(10);
          JScrollPane scrollPane = new JScrollPane(table);
          scrollPane.setBounds(20,180,1000,300);
          JLabel pflabel = new JLabel("Package File: ");
          pf = new JTextField(pathfile);
          cb = new JTextField(250);
          startlabel = new JLabel("START_TIME = ");
          stoplabel = new JLabel("STOP_TIME = ");
          JLabel typelabel = new JLabel("TYPE OF FORMAT TO OUTPUT");
          JButton savebutton = new JButton("Save and Run");
          JButton jbtAddRow = new JButton("Add New Row");
          JButton jbtUpdateRow = new JButton("Update Row");
          JButton jbtDeleteRow = new JButton("Delete Row");
          JButton cancelbutton = new JButton("Cancel");
          cb.setEditable(false);
          cb.setBounds(130,230,100,30);
          cb.setEnabled(false);
          cb.setVisible(false);
          pflabel.setBounds(20,20,100,30);
          pf.setEditable(false);
          pf.setBounds(130,20,300,30);
          startlabel.setBounds(20,90,100,30);
          startfield.setEditable(false);
          startfield.setBackground(new Color(255,255,255));
          startfield.setBounds(130,90,300,30);
          stoplabel.setBounds(20,120,100,30);
          stopfield.setEditable(false);
          stopfield.setBackground(new Color(255,255,255));
          stopfield.setBounds(130,120,300,30);
          typelabel.setBounds(525,150,400,30);
          savebutton.setBounds(130,500,130,30);
          jbtAddRow.setBounds(280,500,130,30);
          jbtUpdateRow.setBounds(430,500,130,30);
          jbtDeleteRow.setBounds(580,500,130,30);
          cancelbutton.setBounds(730,500,130,30);
          add(scrollPane);
          add(pflabel);
          add(pf);
          add(startlabel);
          add(stoplabel);
          add(startfield);
          add(stopfield);
          add(typelabel);
          add(jbtAddRow);
          add(jbtUpdateRow);
          add(jbtDeleteRow);
          add(savebutton);
          add(cancelbutton);
      public void createAndShowGUI() {
        //Create and set up the window.
        pdsframe = new JFrame("PDS Batch Parameters");
        pdsframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        totaldata = new Vector();
        //Create and set up the content pane.
        PackageTable newContentPane = new PackageTable(pathfile);
        newContentPane.setOpaque(true); //content panes must be opaque
        pdsframe.setContentPane(newContentPane);
        //Display the window.
        pdsframe.setLayout(null);
        pdsframe.setSize(1100,700);
        pdsframe.setLocationRelativeTo(null);
        pdsframe.setFocusableWindowState(true);
        pdsframe.setVisible(true);
        pdsframe.show();
        pdsframe.setAlwaysOnTop(true);
        pdsframe.requestFocus();
    public void main()
        Toolkit.getDefaultToolkit().beep();
        createAndShowGUI();
    }Does this help? I hope it works. These are the relevant parts. Thanks.
    esk3

  • Hiding columns in table control

    Hi Experts,
    I have requirement to hide certain columns in table control. I have tried my best to use SCREEN structure with ACTIVE, INVISIBLE, INPUT, OUTPUT options, but not working properly.
    The table control has nearly 10 columns with DATE as the first one. Once the screen appears after executing program, the second and third columns should be hidden and when double clicked on any date value from the basic list, the hidden columns should be visible with its values in the next level.
    I am not able to hide columns in table control. By the way, suggest me options for double clicking in table control too.
    Thanks.

    Hi,
    The value of sy-ucomm when user double clicks is /CS
    To get the details of field name and value use:-
    GET CURSOR FIELD g_cs_field VALUE g_cs_value.
    Now you can code in PAI to display those two columns initially hidden by the user:-
    CASE sy-ucomm.
      WHEN '/CS'.
        IF g_cs_field = '<field1_name>'.
          LOOP AT SCREEN.
            IF screen-group1 = 'ABC'.
              screen-invisible = 0. "display control
              screen-active = 1.
            ENDIF.
            MODIFY SCREEN.
          ENDLOOP.
        ENDIF.
    ENDCASE.
    Remember that in PBO of screen you have written a code to hide these same columns initially, so make sure that the code is not executed when user double clicks to display those columns.
    Try this code for hidding the columns in table control initially.
    MODULE status_8001.
      LOOP AT SCREEN.
        IF screen-group1 = 'ABC'.
          screen-invisible = 1. "hide control
          screen-active = 0.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    ENDMODULE.
    Hope this helps you.
    Regards,
    Tarun

  • Default  value for a column in Table Control

    Hi friends, can i set dinamcally a default value for a column in table control?, this column is check type. This default value must appear in empty rows,
    thanks

    ADD A MODULE AS Module yyyy In ur PAI.
    as
    In PAI.
    LOOP at  itab.
    Module YYYY
    ENDLOOP.
    Module YYYY.
    LOOP AT SCREEN.
        IF SCREEN-NAME = 'ITAB-VAL’.
          ITAB-VAL = 'XXXXXXXX'        "(DEFAULT VALUE)
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
        ENDIF.
    ENDLOOP.
    End module.
    *note
    make this event work only if the previous column is filled okay.
    the display will be in display mode on the screen as screen-input = 0.
    see that in the table control u can get the table field for all the rows even though you are processing on some fields .
    so what u do is make that particular filed masked(no i/p field and populate the field that will be better instead of populating all the columns okay.
    hope this helps you out ,
    regards,
    vijay.

  • Reg:How to delete the column in table control also from database table.

    Hi Experts,
    Once again thank u all for giving the responses.
    one more doubt is how to delete the columns of table control and also the record shold delete from ztable.
    With Regards,
    Saroja.P.

    Hi,
    If you want to delete the rows in the table control and simultaneously delete it from the database table, then you can implement a 'DELETE' functionality specific to your table control. Have a MARK field (you will find that in the screen attributes of the table control -> give a name for the MARK field, you will find an additional MARK column at the beginning of your table control). You can check whatever rows you want to delete from the table control, call the delete module.
    "This portion of code inside the LOOP...ENDLOOP.
    IF sy-ucomm eq 'F_DELETE'.
       gt_itab2-check = mark.  " Store the MARK field status into your internal table's correspoding field 'check'
      MODIFY gt_itab INDEX tabcontrol-current_line.
    ENDIF.
    iF sy-ucomm eq 'DELETE1'.
      DELETE gt_itab WHERE check eq 'X'. "Your internal table does not have rows that you want to delete
    ENDIF.
    Now you can modify your database table using the MODIFY statement.
    MODIFY ZDB FROM TABLE gt_itab.

  • How to add column in table control for transaction APPCREATE

    Hi All,
    How can i add the additional column in table control for transaction APPCREATE.
    There is structure PT1045_EXT present behind table control. But not found any customer exit or badi to display on screen.
    Please help...

    You can add new columns
    If you add new columns in tr. PHAP_CATALOG

  • How to find out the selected column in Table Control

    Hi all,
          How to find out the selected column in Table Control?
    Thanks & Regards,
    YJR

    Hi,
    Let your table control name in Screen painter be TC1.
    READ TABLE TC1-COLS INTO WA_COLS (some wok area)
                 WITH KEY SELECTED = 'X'.
            IF SY-SUBRC = 0.
              CLEAR: W_DUMMY, W_COL_NAME.
              SPLIT WA_COLS-SCREEN-NAME AT '-' INTO W_DUMMY
                                                   W_COL_NAME.
            endif.
    W_COL_NAME gives you the column name.
    Hope it helps.
    cheers
    sharmistha

  • How to add a column in table control

    Hi ,
       Can any one tell me how to add a column in table control? My requirement is to add two columns ( custom fields ) into table control ( It is a standard program). I have added the column in the table and also in the table control. But when I am running the standard program, The newly added column is not there. But I have added in the perticular screen. Change is not reflected.
       Can anyone help me on this please.
    Thanks in advance.
    Regards,
    Lakshmi.

    Hi,
    Ensure the following :
    1. After adjusting the database, you`ll have to use the database utility and activate the table.
    2. If you have changed the standard screen, in tcode se80 -- right click on the program and click activate all. This activates all objects related to that program.
    Now execute the program.
    Reward if helpful.
    Regards

  • How can we do the validation for non visible records in table control.

    Hi Experts,
      I have a table control which displays list of material details. I have a button to upload the material details from excel file to table control directly. I have to validate all the customers which are exist in the table. But my item (Material) table control displays only 5 rows i.e only 5 entries are visible in module pool screen. The validation is done for 5 records only in PAI event, but i need to do validation for rest of the records too (Which are not visible on items table), if validation fails then needs to display error message.
      How can we do the validation for non visible records in table control.
    Regards,
    Bujji

    Hi,
    try validating material before displaying it in table control...'
    Rgds/Abhhi

  • Push button in one of the columns of Table Control

    Hi,
    I have a requirement, where i have to display a push button in one of the columns of table control for long text. When user clicks on the control, a pop up has to be appeared in which user should be able to enter some meaning ful description and save it. please suggest me how to do this requirement.
    Best Regards,
    Phani Kumar. S

    Hai,
      You can drag n drop a button to the required column in the table control and give the required parameters like ok_code , name etc.
    You can now place a text field as the heading of the column.
    Now when the user clicks the the button in a row, read the corresponding line in which he has clicked.For that u can use
    get cursor lines wrk_line.
    now u'll  get the data in that row using
    Read table it_tab into wa_tab index wrk_line.
    now u can call the text editor (using FM's READ_TEXT ,EDIT_TEXT and CREATE_TEXT in which the user can enter the meaningful description and save it.
    When u save the text entered save it with a key part of the row that was read earlier(keep it as the text name).
    So now if u need to get the description which was entered earlier u can easily read the text (using READ_TEXT ).
    I hope this will be helpful for u .
    Thanks
    Neeraj

  • Disable some columns in table control?

    Hi
    How to disable some columns in table control.
    For Ex: Table contains 8 columns.
    In first row i want to disable first 4 columns.
    in second row i want to disable last 4 columns.
    In third row i want to disable first 2 and last 2 columns.  How can we achieve this?
    Cheers,
    Venkys.

    HI
    Create three attribute in the node which is bound to the table as data source.
    say pro1, pro2, and pro3 of type wdy_boolean.
    now bind the enabled property of first four column editors to pro1, last 4 to pro2, and pro3 to first 2 and last 2.
    then go to the eventhandler of the dropdown 's on select event and write the code to update the values of these attribute
    according to the selected value.
    here is the sample code.
    DATA lo_nd TYPE REF TO if_wd_context_node.
        DATA lo_el TYPE REF TO if_wd_context_element.
            DATA lv_VAL LIKE ls_dealer1-name.
        lo_nd = wd_context->get_child_node( name = 'DEALER1').
      lo_el = lo_nd->get_element(  ).
        lo_el->get_attribute(
          EXPORTING
            name =  `NAME`
          IMPORTING
            value = lv_VAL ).
         DATA PR1 TYPE WDY_BOOLEAN.
         DATA PR2 TYPE WDY_BOOLEAN.
         DATA PR3 TYPE WDY_BOOLEAN.
      PR1 = ABAP_TRUE.
    PR2 = ABAP_TRUE.
    PR3 = ABAP_TRUE.
    IF LV_VAL EQ 'A'.
    PR1 = ABAP_FALSE.
    PR2 = ABAP_TRUE.
    PR3 = ABAP_TRUE.
       ELSEIF LV_VAL EQ 'B'.
    PR1 = ABAP_TRUE.
    PR2 = ABAP_FALSE.
    PR3 = ABAP_TRUE.
    ELSEIF LV_VAL EQ 'C'.
      PR1 = ABAP_TRUE.
    PR2 = ABAP_TRUE.
    PR3 = ABAP_FALSE.
      ENDIF.
       LO_EL->SET_ATTRIBUTE(
       NAME = 'PRO1'
       VALUE = PR1
       LO_EL->SET_ATTRIBUTE(
       NAME = 'PRO2'
       VALUE = PR2
       LO_EL->SET_ATTRIBUTE(
       NAME = 'PRO3'
       VALUE = PR3
    thanks
    sarbjeet singh

  • SHDO - add column in table control in CRMD_ORDER

    Hi,
    is it possible to add a EEWB generated column to table control (on the first screen)
    in TCODE CRMD_ORDER ?
    did anyone ever do that ?
    thank you,
    Regards,
    michal

    hehe
    it would be great to get feedback on everything here but I'd better obey the forum rules
    too many opened forums and I sometimes get a little lost
    Regards,
    michal

Maybe you are looking for