How to add a checkbox coulmn to my Data Grid row?

Dear All ,
I have a Data Grid which have lets says 6 columns. I want to add anew column which allow the user to select it or not. Meaning if the user select the box a hack will be shown.
I want to you this coz I have a function which send an email to the user if the line (Invoice line) if selected. Now if there is more than one invoice (Line) I want the user to first select the checkbok and send press the send function button.
Later on I will create a loop in the Send function which will only send mails if the line check box is checked.
Would you please help me :)
Ps: I am using ligth switch 2008   (C#)
Thanks,
Zayed

Hello Zayed
I would recommend that you read through this brilliant article by
Paul van Bladel here or even look at a post on
this forum by Sven Elm. I have looked at and followed these in the past and it works perfectly.
If you found this post helpful, please mark it as helpful. If by some chance I answered the question, please mark the question as answered. That way you will help more people like me :)

Similar Messages

  • How to add a checkbox to dynamic itab  so that i can select some records

    How to add a checkbox to dynamic itab  so that i can select some records in the alv and can display them in another alv using a button
    I have requirement where i have to display the dynamic itab records in an alv ....Some records from this alv output has to be selected through checkbox  provided in the first column .( I will get to know the structure of the itab only at runtime ,so iam using dynamic itab)

    Hi,
       I tried and finally i got it , Just try for it.
    type-pools : slis.
    PARAMETERS : p_tab type dd02l-tabname.
    data : ref_tabletype  type REF TO cl_abap_tabledescr,
           ref_rowtype TYPE REF TO cl_abap_structdescr.
    field-symbols  : <lt_table>  type   standard TABLE ,
           <fwa> type any,
           <field> type abap_compdescr.
    data : lt_fcat type lvc_t_fcat,
           ls_fcat type lvc_s_fcat,
           lt_fldcat type SLIS_T_FIELDCAT_ALV,
           ls_fldcat like line of lt_fldcat.
    data : ref_data type REF TO data,
            ref_wa type ref to  data.
    ref_rowtype ?= cl_abap_typedescr=>DESCRIBE_BY_name( p_name = p_tab ).
    TRY.
    CALL METHOD cl_abap_tabledescr=>create
      EXPORTING
        p_line_type  = ref_rowtype
      receiving
        p_result     = ref_tabletype.
    CATCH cx_sy_table_creation .
    write : / 'Object Not Found'.
    ENDTRY.
    *creating object.
    create data ref_data type handle ref_tabletype.
    create data ref_wa type handle ref_rowtype.
    *value assignment.
    ASSIGN ref_data->* to <lt_table>.
    assign ref_wa->* to <fwa>.
    loop at ref_rowtype->components ASSIGNING <field>.
      ls_fcat-fieldname = <field>-name.
      ls_fcat-ref_table = p_tab.
      append ls_fcat to lt_fcat.
    if lt_fldcat[] is  INITIAL.
        ls_fldcat-fieldname = 'CHECKBOX'.
        ls_fldcat-checkbox = 'X'.
        ls_fldcat-edit = 'X'.
        ls_fldcat-seltext_m = 'Checkbox'.
        append ls_fldcat to lt_fldcat.
      endif.
      clear ls_fldcat.
      ls_fldcat-fieldname = <field>-name.
      ls_fldcat-ref_tabname = p_tab.
      append ls_fldcat to lt_fldcat.
    endloop.
    loop at lt_fldcat into ls_fldcat.
      if sy-tabix = 1.
        ls_fldcat-checkbox = 'X'.
        ls_fldcat-edit = 'X'.
    modify lt_fldcat FROM ls_fldcat
        TRANSPORTING checkbox edit.
    endif.
    endloop.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog           = lt_fcat[]
      IMPORTING
        ep_table                  = ref_data.
    assign ref_data->* to <lt_table>.
    select * FROM (p_tab) into table <lt_table>.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       IT_FIELDCAT                       = lt_fldcat[]
      TABLES
        t_outtab                          = <lt_table>.
    Thanks & Regards,
    Raghunadh .K

  • PLz Help me its urgent, how to add new field in mm01 basic data screen

    Hi everyone,
         plz tell me how to add new field in mm01 basic data screen,i added that field in basic data screen but when i create a material the data for that field will not save in database table.
    Thanks,
    murali.

    Hi Murali,
    when created added a field on the screen by using user exit then after that you have add the field in main table where you will be getting these table in the userexit only, please make sure about this. And i am sure defenitly it will get updated in to the table.
    reward if useful.
    thanks
    abdulsamee.

  • How to Add 15 Days to the current Date in eCATT

    Hello eCATT Guru's,
    How to add 15 days to the current date in eCATT.
    I have changed the Date format to mm/dd/yyyy.
    now i want to add 15 days to the sy-datum.
    How to do that.do any one know?
    Thanks in Advance,
    Raj

    Check out this link -
    http://help.sap.com/saphelp_46c/helpdata/en/d7/e21a50408e11d1896b0000e8322d00/frameset.htm
    It gives details about DATE variables in CATT. Hope this will help you out.
    ashish
    Reward points if you find this helpful.
    Message was edited by: Ashish Gundawar

  • How to add a button to the grouped data in an AdvancedDataGrid?

    Hi,
    Can anyone please suggest how to add a button to the grouped data in the AdvancedDataGrid?
    I have tried extending the AdvancedDataGridGroupItemRenderer and using it as the groupItemRenderer but its not reflecting.
    For the leaf node the itemRenderer property works just fine.
    Please help!

    HI ,
    I want to add a push button on the ALV list out put which is comming as a pop up and I want this using classes and methods.
    I have got a method IF_SREL_BROWSER_COMMANDS~ADD_BUTTONS from class cl_gos_attachment_list  but still I am unable to get any additional button on the output ALV popup.
    Please help.
    Regards,
    Kavya.

  • How to add a push button on an ALV grid  ?

    Hi,
    How to add a push button on an ALV grid, using ON_TOOLBAR, ON_USERCOMMAND Methods. Clicking on that push button, a new screen has to be displayed.

    Hi,
            Assuming that you want to have a "push-button" column, i.e. push-buttons within an ALV grid then you need to implement the following steps:
    (1) Set the style of the column as button
      ls_fcat-style = CL_GUI_ALV_GRID => MC_STYLE_BUTTON.
    (2) When the user pushes the button event BUTTON_CLICK is triggered. Thus, define an appropriate event handler method.
    <b>Reward points</b>
    Regards

  • Please Help: How to add a Checkbox field to a JTable

    Hi,
    I am trying to add a checkbox filed to a JTable with DefaultTableModel.
    I have tried fro hours. Just Does not work.
    Here is my sample code:
    DefaultTableModel model = new DefaultTableModel();
    JTable table = new JTable(model);
    Object[] data;
    data = new Object[2];
    data[0]= "string"
    data[2] = new Boolean(false)
    model.addRow(data);     
    What is missing in here?
    Thanks,
    Tara

    you can do that with the help of DefaultTableModel alone
    if u r so determined to use DefaultTableModel u need to have a subclass of it
    following sample may satisfy u ...
    import javax.swing.*;
    import java.awt.*;
    import java.beans.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    public class MyTable extends JApplet{
         Object o[] = {"Name","Address","city","Vegetarian"};
         Object data[][] = {
              {"a","a","pune",new Boolean(true)},
              {"Alison", "Huml","mumbai",new Boolean(true)}
         class model extends DefaultTableModel
              model(Object[][] data,Object[] cn)
                   super(data,cn);
              public Class getColumnClass(int i)
                   return getValueAt(0,i).getClass();
              public Object getValueAt(int i,int j)
                   return data[i][j];
         model m = new model(data,o);
         JTable t1 = new JTable(m);
         public void init()
              Container c1 = new Container();
              c1 = getContentPane();
              c1.add(t1);
              TableColumn tc = t1.getColumnModel().getColumn(2);
              JComboBox jc = new JComboBox();
              jc.addItem("Pune");
              jc.addItem("Mumbai");
              jc.addItem("Madras");
              tc.setCellEditor(new DefaultCellEditor(jc));
    bye
    Amol

  • How to add get Day value in a Date object?

    Hi,
    I am writing a sql statement that has two date values. One I am getting it from the database. The format in the database is MM/DD/YYYY. My first question is how do I convert the format into the java date format, YYYY-MM-DD. The second question is I need to find out what the day is and add 1 to it. How do I get Day value in a Date object?
    Thanks.

    Look at "SimpleDateFormat" and "parse" in the archives.

  • How to Add a new Currency in HFM Data form and grid (Rates)

    Hi Gurus,
    Am very new to this forum.
    Can someone explain me how to add a new currency to the existing data for or grid in the Workspace.
    Regards,
    Vinod

    Hi Sandeep,
    To add a new currency in Metadata, just add in Currencies dimension, and to add in Data form-just send the script what you are using as of now for rest of the currencies, or follow the same steps as specified above. or just add the script A#CLORATE.w#Periodic.C2#XYZ in rows of your data form (where XYZ- is the new currency).
    To add a new location in FDM login to FDM web client- click on Metadata--> locations and select the Controls review location where you want to add the data load location, right click and add the new location.

  • How to add new fields in asset master data

    Hello,
    i was wonder if anyone knows how to add new fields that arent defined in the asset master data.
    Thanks.
    Pedro

    Hi Pedro,
    SAP allows entering upto 8 fields on the asset master. These fields are called 'Evaluation group'. Out of 8, 4 are four character long and others are 8 character long.
    You can configure them @ the following 3 nodes in IMG:
    Financial Accounting>Asset Accounting>Master Data-->User Fields: Define 4-Character Evaluation Groups & Define 8-Character Evaluation Groups & Change Key Words in the Evaluation Groups.
    Regards,
    Vishal Thakur

  • How to add 15 days to the current date

    Hi everyone,
    I have the following doubt.
    I stored the current system date in to a variable.Now I want to store the date which is 15 days after the current date in to a new variable.
    ie current date:1-aug-09
    later date:1-aug-09 + 15 days ie 16-aug-09.
    Plz help me in solving this problem.
    Thanks & Regards,
    srinivas

    jaligamasrinivas wrote:
    I used String variable to store the current Date.
    Now in new string variable i want to store the date after 15 days from current dateSee reply #2. String is not the right type, to be doing date arithmetic, just like it wouldn't be the right type to do numeric arithmetic. You wouldn't store integer values as strings and ask how to add them up, would you?

  • How to add the REFRESH button in OOPs ALV grid

    how to add the REFRESH button in OOPs ALV grid

    Hi Naidu.
    Check the below code:
    Local Class Definition and implementation For events handeling
    CLASS LCL_EVENT DEFINITION .
      PUBLIC SECTION.
        METHODS :TOOLBAR FOR EVENT TOOLBAR OF  CL_GUI_ALV_GRID
                         IMPORTING E_OBJECT,
                 USER_COMMAND FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
                         IMPORTING E_UCOMM.
    ENDCLASS.    
    CLASS LCL_EVENT IMPLEMENTATION.
      METHOD TOOLBAR.
        WA_TOOL-FUNCTION = 'ZFC1'.
        WA_TOOL-TEXT     = 'TEST'.
        WA_TOOL-ICON     = '@EA@'.
        APPEND WA_TOOL TO E_OBJECT->MT_TOOLBAR.
      ENDMETHOD.             "DISPLAY
      METHOD USER_COMMAND.
        IF E_UCOMM = 'ZFC1'.
              ENDIF.
      ENDMETHOD.                    "USER_COMMAND
    ENDCLASS.                    "LCL_EVENT IMPLEMENTATION
    MODULE STATUS_0200 OUTPUT.
      SET PF-STATUS 'ZALV_BTON'.
      SELECT * FROM VBAK INTO TABLE GT_VBAK
               UP TO 30 ROWS.
    **** CREATE CONTAINER OBJECT
      CREATE OBJECT MY_CONTAINER
        EXPORTING
          CONTAINER_NAME              = 'CC1'
         EXCEPTIONS
          CNTL_ERROR                  = 1
          CNTL_SYSTEM_ERROR           = 2
          CREATE_ERROR                = 3
          LIFETIME_ERROR              = 4
          LIFETIME_DYNPRO_DYNPRO_LINK = 5
          OTHERS                      = 6 .
    ****** GRID TO CONTAINER
      CREATE OBJECT ALV
          EXPORTING
          I_PARENT          = MY_CONTAINER
         EXCEPTIONS
          ERROR_CNTL_CREATE = 1
          ERROR_CNTL_INIT   = 2
          ERROR_CNTL_LINK   = 3
          ERROR_DP_CREATE   = 4
          OTHERS            = 5.
      CREATE OBJECT OBJ.
      SET HANDLER : OBJ->TOOLBAR FOR ALV.
      SET HANDLER : OBJ->USER_COMMAND FOR ALV.
    ****** ALV DISPLAY
      CALL METHOD ALV->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          I_STRUCTURE_NAME              = 'VBAK'
        CHANGING
          IT_OUTTAB                     = GT_VBAK[]
        EXCEPTIONS
          INVALID_PARAMETER_COMBINATION = 1
          PROGRAM_ERROR                 = 2
          TOO_MANY_LINES                = 3
          OTHERS                        = 4.
    ENDMODULE.                 " STATUS_0200  OUTPUT
    *&      Module  USER_COMMAND_0200  INPUT
    *       text
    MODULE USER_COMMAND_0200 INPUT.
      IF SY-UCOMM EQ 'BACK'.
        LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.                 " USER_COMMAND_0200  INPUT
    Regards
    Kumar M

  • How we add Grace days to net due date

    Hi,
    How we add grace days (eg one week) to net due date? This is only for particular customers.
    Regards,
    Shaik

    Hi Azeen
    Try this way. I assume that you want to know how much is due from customers as on a particular future date, that should come between today and that date. For preparing the liquidity forecast for the month, I use the following method for estimating the recoveries from the Customers and payments to Vendors and it works quite well for me.
    Let's say for Customers you want to forecast the collections that would come in the month of Jan from today until 31 Jan'09. Use the FBL5N Report, using the 'Open Item Key Date' as a future date, in our example - 31 Jan'09. Change the layout of the report by including the feilds 'Net Due Date' and 'Arrears after Net Due Date'. Sort the report on the Document Date, this being the baseline date. Now in the 'Arrears after Net Due Date' you will find the overdue days, which would be equal to the difference between the Date of the Report (31 Jan'09) and the Net Due Date of the Open Item. Thereafter, use the filter for 'Arrears after net due date' and click on the icon for 'multiple values'. Exclude the range of days, by assigning the lower and the upper limits. Lower Limit will be in minus, for those invoices that would still not be due upto 31 Jan'09 and the upper limit will be 7, since you would be granting a grace period of one week and consider all those invoices as not due upto 31 Jan. Once the filter is set, the report will exclude the open items as per the filter and provide you with a fairly accurate estimate of collections for the period/month.
    Let me know if it works for you.
    Regards

  • CheckBox Item Renderer checks wrong grid row after sorting

    I have an advanced Data Grid that has a checkBox ItemRenderer. The underlying object being displayed (Server) in the dataGrid is being bound to the checkBox with a selectedForDeployment:Boolean property.
    I had this working just fine until the datagrid is sorted. After the grid is sorted I can click on the checkBox in row 2 and the checkBox in row 8 will be selected for instance. Or in some cases all checkBoxes will become checked. Also, if I have some already checked and then sort, the checkBox will become unchecked.
    I have an example of my itemRender below. Any idea on how I can get this to work:
    public class CheckBoxRenderer extends CheckBox
            override public function set data(value:Object):void {
                if(value){
                    super.data = value;
                    Server(super.data).addEventListener("setSelectionChanged", valueChange);
                    this.selected = value.selectedForDeployment;
            public function CheckBoxRenderer(){
                focusEnabled = false;
                BindingUtils.bindSetter(selectionChange, this, "selected");
            //this method occurs the checkbox is clicked
            public function selectionChange(value:Boolean):void{
                trace(value);
                this.selected = value;
                if(this.data){
                    this.data.selectedForDeployment = value;
            //This method occurs when the selectedForDeployment boolean in the object changes
            public function valueChange(event:Event):void{
                this.selected = event.target.selectedForDeployment;
            /* center the checkbox if we're in a datagrid */
            override protected function updateDisplayList(w:Number, h:Number):void
                super.updateDisplayList(w, h);
                if (listData is DataGridListData)
                    var n:int = numChildren;
                    for (var i:int = 0; i < n; i++)
                        var c:DisplayObject = getChildAt(i);
                        if (!(c is TextField))
                            c.x = (w - c.width) / 2;
                            c.y = (h - c.height) / 2;

    This usually works for me:
    package renderers
        import flash.events.Event;   
        import mx.controls.CheckBox;
        public class CheckBoxRenderer extends CheckBox
            public function CheckBoxRenderer()
                super();
                addEventListener(Event.CHANGE, handleChange);
            override public function set data(value:Object):void {
                if(value){
                    super.data = value;
                    selected = value.selectedForDeployment;
            private function handleChange(event:Event):void{
                data.selectedForDeployment = event.target.selected;

  • Add Total for a Column in Data Grid Screen Based on Query

    Hi Guys , I have query based on table Payments in which I search By Start Date , End Date  and tenant person [ from drop down List ].
    How to display sum of Payments.[Amount] column in the query screen , which off-course varies for selected person.
    Omar 

    The data grid doesn't support calculating aggregate functions on columns automatically, but you can write a little bit of code to show the total of the payments right beneath the data grid.
    Add a screen member called PaymentsTotal that is the same type as the column that you want to sum.
    Drag out the screen member to be underneath the data grid. You can change the sizing settings (e.g. Horizontal Alignment) so that it aligns with the data grid how you want it.
    Select the Payments collection and select Payments_Changed from the Write Code drop down.
    In the generated method, write the following code:
    partial void Payments_Changed(NotifyCollectionChangedEventArgs e)
    // Total is the name of the property in my Payment entity that I want to sum
    this.PaymentsTotal = this.Payments.Sum(p => p.Total);
    When you run the screen, the PaymentsTotal property will show the total of all of the payments that are shown in the data grid.
    Justin Anderson, LightSwitch Development Team

Maybe you are looking for

  • BlackBerry Presenter + Torch 9860 = World of Pain

    BlackBerry Presenter. Nice idea, eh? Who wouldn't want to save the weight of lugging a PC around when a handheld would do the job? [Except that it doesn't.] Amazon details say Torch 9860 is supported. OS version needs to be above 4.6. Mine is v7.0; I

  • JTable in JCombox

    hi every one. i write a program that puts a Jtable in JComboBox but this not fine work please help me if possible. thanks import javax.swing.*; import java.awt.*; class TableInComboBox extends JFrame{      JPanel panel = new JPanel();      JComboBox

  • Delivery based on salesorder

    Hi there. I've tried to create delivery notes based on sales orders via the DI, with no success. My code is as follows: for (int t = 0; t < salesordersLines->Count; t++){ salesordersLines->SetCurrentLine(t); deliveryLines->BaseEntry = salesordersDoc-

  • JTable resizing the column width

    Have a JTable whose column width's are set using int width = ((String)getDataTbl().getColumnModel().getColumn(0).getHeaderValue()).length() + 32; getDataTbl().getColumnModel().getColumn(0).setPreferredWidth(width); int width1 = ((String)getDataTbl().

  • Is it possibe to create PO with  account assignment catagory "U" and B

    Hi all, Is it possibe to create PO with  account assignment catagory "U" and B combination with material or without material code? if yes then what are the setting requried ? Secondly can we do GR for this combination? if yes what are the setting req