How to enable/disable check boxes in a table.

hi Gurus,
i am new to webdynpro for abap.
the problem i have is.
i have a table with two columns. first one is a check box column and the second one is a value field. the table is populated with data(second field only) upon pressing some button.
while populating data i want to make check box field/row ticked and disabled when second field row value is 'X' . if not leave the check box row/field enabled and unticked ( if i want i can tick the check box later). hope you guys me. this is sort of urgent. please reply with some code.
thanks in advance.
Sree

Hi
Issue what i am facing is,i want to display column of CHECKBOXes in my ALV.
for that i declare atrribute of type CHECKBOX.
And i write the following code.
lr_column_settings ?= l_value.
lt_columns = lr_column_settings->get_columns( ).
loop over table - in each loop another column can be modified
LOOP AT lt_columns INTO ls_column.
IF ls_column-id = 'CHK_BOX'.
CREATE OBJECT lr_chk_box
EXPORTING
checked_fieldname = ls_column-id.
lr_chk_box->set_read_only( ABAP_FALSE ).
lr_chk_box->set_read_only_fieldname( 'ALV_FINAL_STATUS' ).
ls_column-r_column->set_cell_editor( lr_chk_box ).
even i cant able to get checkbox in my ALV.
IT is displaying as general field.
Regards,
Ravi

Similar Messages

  • How to enable a check box using the table LVC_S_FCAT

    hi,
    I am working on reports. I have to have a check box and i am using the table LVC_S_FCAT to get the check box, i am getting the check box. how to enable it.

    Hi Preethi,
    try to set default the check-box with the
    value '0', '1', '-', ' ' and 'X' (0/1 -> only display,
    '-' field is not shown, ' ' and 'X' is normal)
    and see the differences.
    Hope it helps.
    Regards, Dieter
    Sorry, i thought you meen enable not editable.
    Message was edited by: Dieter Gröhn

  • How to enable the check box using cl_salv_table?

    Hi Experts,
                 what code will change for to enable the check box in the following Report program?
    REPORT  ZMA_ALV_OOPS2.
    TABLES:MARA.
    TYPES:BEGIN OF T_MARA,
          SEL   TYPE C,
          MATNR TYPE MARA-MATNR,
          WERKS TYPE MARC-WERKS,
          LGORT TYPE MARD-LGORT,
          LABST TYPE MARD-LABST,
         END OF T_MARA.
    DATA:TB_MARA TYPE STANDARD TABLE OF T_MARA,
         WA_MARA TYPE T_MARA.
    DATA: GR_TABLE TYPE REF     TO CL_SALV_TABLE.
      DATA: GR_FUNCTIONS TYPE REF TO CL_SALV_FUNCTIONS.
      DATA: GR_DISPLAY TYPE REF   TO CL_SALV_DISPLAY_SETTINGS.
      DATA: GR_COLUMNS TYPE REF   TO CL_SALV_COLUMNS_TABLE.
      DATA: GR_COLUMN TYPE REF    TO CL_SALV_COLUMN_TABLE.
      DATA: GR_SORTS TYPE REF     TO CL_SALV_SORTS.
      DATA: GR_AGG TYPE REF       TO CL_SALV_AGGREGATIONS.
      DATA: GR_FILTER TYPE REF    TO CL_SALV_FILTERS.
      DATA: GR_LAYOUT TYPE REF    TO CL_SALV_LAYOUT.
      DATA: GR_PRINT TYPE REF     TO CL_SALV_PRINT.
      DATA: GR_SELE TYPE REF      TO CL_SALV_SELECTIONS.
      DATA: GC_TRUE TYPE SAP_BOOL VALUE 'X'.
      DATA: GR_ITEM TYPE REF      TO  CL_SALV_ITEM.
      DATA: COLUMNNAME TYPE REF TO LVC_FNAME.
    top of list for CCL
      DATA: GR_CONTENT_CCL TYPE REF TO CL_SALV_FORM_ELEMENT.
      DATA: GR_COL TYPE REF TO CL_SALV_COLUMN.
      DATA: LT_SORT TYPE SALV_T_SORT_REF,
            LS_SORT TYPE SALV_S_SORT_REF,
            L_SEQUENCE TYPE SALV_DE_SORT_SEQUENCE,
            T_SORT TYPE REF TO SALV_T_SORT_REF.
      DATA: KEY TYPE SALV_S_LAYOUT_KEY.
      DATA: COLOR TYPE LVC_S_COLO.
      DATA: GR_EVENTS TYPE REF TO CL_SALV_EVENTS_TABLE.
      DATA: GR_SELECTIONS TYPE REF TO CL_SALV_SELECTIONS.
    **--Selection screen
    SELECT-OPTIONS:S_MATNR FOR MARA-MATNR.
    SELECT MATNR WERKS LGORT LABST
             FROM MARD
             INTO CORRESPONDING FIELDS OF TABLE TB_MARA
             WHERE MATNR IN S_MATNR.
    TRY.
          CALL METHOD CL_SALV_TABLE=>FACTORY
            IMPORTING
              R_SALV_TABLE = GR_TABLE
            CHANGING
              T_TABLE      = TB_MARA.
        CATCH CX_SALV_MSG.
      ENDTRY.
      GR_TABLE->SET_SCREEN_STATUS(
                  PFSTATUS = 'SALV_TABLE_STANDARD'
                  REPORT = SY-REPID
                  SET_FUNCTIONS = GR_TABLE->C_FUNCTIONS_ALL ).
    GR_FUNCTIONS = GR_TABLE->GET_FUNCTIONS( ).
      GR_FUNCTIONS->SET_ALL( ABAP_TRUE ).
      GR_DISPLAY = GR_TABLE->GET_DISPLAY_SETTINGS( ).
      GR_SELE = GR_TABLE->GET_SELECTIONS( ).
      GR_SELE->SET_SELECTION_MODE(  ).
      GR_TABLE->SET_TOP_OF_LIST( GR_CONTENT_CCL ).
    *--- To change the column headings
      GR_COLUMNS = GR_TABLE->GET_COLUMNS( ).
      GR_COLUMNS->SET_OPTIMIZE( GC_TRUE ).
      GR_SORTS = GR_TABLE->GET_SORTS(  ).
      TRY.
          GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( 'SEL' )  .
          GR_COLUMN->SET_CELL_TYPE( IF_SALV_C_CELL_TYPE=>CHECKBOX ).
          GR_COLUMN->SET_LONG_TEXT( 'CHECKBOX' ).
        CATCH CX_SALV_NOT_FOUND.
      ENDTRY.
      GR_COLUMN->SET_CELL_TYPE( 6 ).
      GR_COLUMN->SET_SHORT_TEXT( 'Check Box' ).
      GR_COLUMN->SET_LONG_TEXT( 'Check Box' ).
    ******Check box edit
      TRY.
          GR_SORTS->ADD_SORT( COLUMNNAME = 'MATNR' SEQUENCE =
          IF_SALV_C_SORT=>SORT_UP ).
        CATCH CX_SALV_DATA_ERROR
              CX_SALV_NOT_FOUND
              CX_SALV_EXISTING.
      ENDTRY.
      GR_LAYOUT = GR_TABLE->GET_LAYOUT( ).
      KEY-REPORT = SY-REPID.
      GR_LAYOUT->SET_KEY( KEY ).
      GR_LAYOUT->SET_SAVE_RESTRICTION( CL_SALV_LAYOUT=>RESTRICT_NONE ).
      TRY.
          GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( 'MATNR' ).
        CATCH CX_SALV_NOT_FOUND.
      ENDTRY.
      COLOR-COL = '8'.
      COLOR-INT = '0'.
      COLOR-INV = '1'.
      GR_COLUMN->SET_COLOR( COLOR ).
      GR_TABLE->DISPLAY( ).
    Thanks,
    Mahesh.

    Hi,
    You can use the method set_selection_mode to automatically show the checkbox for each row..and use the method get_selected_rows to get the rows selected..
    Check this sample report..
    TYPES: BEGIN OF type_output,
             matnr TYPE matnr,
           END OF type_output.
    DATA:lt_output   TYPE STANDARD TABLE OF type_output,
         lwa_rows    TYPE int4,
         lwa_output  TYPE type_output,
         lt_rows     TYPE salv_t_row.
    * Local declarations.
    DATA: lr_table      TYPE REF TO cl_salv_table,
          lr_selections TYPE REF TO cl_salv_selections.
    DATA: lr_columns    TYPE REF TO cl_salv_columns_table.
    START-OF-SELECTION.
    * Prepare data.
      lwa_output-matnr = 'TEST1'.APPEND lwa_output TO lt_output.
      lwa_output-matnr = 'TEST2'.APPEND lwa_output TO lt_output.
      lwa_output-matnr = 'TEST3'.APPEND lwa_output TO lt_output.
    * Call the factory method
      TRY.
          cl_salv_table=>factory(
            EXPORTING
              list_display = 'X'
            IMPORTING
              r_salv_table = lr_table
            CHANGING
              t_table      = lt_output ).
        CATCH cx_salv_msg.                                  "#EC NO_HANDLER
      ENDTRY.
    * Column selection
      lr_selections = lr_table->get_selections( ).
      lr_selections->set_selection_mode( if_salv_c_selection_mode=>row_column ).
      lr_columns = lr_table->get_columns( ).
      lr_columns->set_optimize( abap_true ).
    * Display
      lr_table->display( ).
    * Get the selected rows.
      lt_rows = lr_selections->get_selected_rows( ).
    * Display the selected rows.
      LOOP AT lt_rows INTO lwa_rows.
        READ TABLE lt_output INTO lwa_output INDEX lwa_rows.
        WRITE: / lwa_output-matnr.
      ENDLOOP.
    Thanks
    Naren

  • Programatically enable-disable check box"play user interface sound effects"

    Hello All,
    I have been Working on something where i need to disable the "play user interface sound effects" check box ( Under System preferences under sound panel ) for few seconds and then enable the same programically without any user interface appearing on the screen. I know something related using the Applescript however there is a user interface appearing there which doesn't serve the purpose please help with some solution.If you could provide the exact location of the plist file which holds this information then that could help as well.

    Hi !
    I too have been working with the sounds ( Which i think is relates to @mit's query ) in an application and the problem is that when ever that application moves something to trash there is a sound which comes the sound of "throwing things in the trash". This is very annoying and i want to do something so that I can suppress that sound atleast for the time this application is on. Now is there some way where I can do this Programically . It would even be fine if I could turn off the user interface sounds completely for sometime and then bring them back on.
    Thanks In Advance !
    Looking Forward To Some response soon !
    iMAC G4   Mac OS X (10.4)   Power PC 256 MB RAM

  • How to add a check box to a table?

    I'm new to the Swing portion of Java. Most of the stuff we write is for backend processing and does not require any GUI's. However, I need to write a screen that needs to have a table and that table needs to have a checkbox. How do I add a checkbox for a column in the DefaultTableModel? Does anyone have any examples?
    Thanks

    [http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]
    If the TableModel's column class is Boolean, you'll get the column rendered with checkboxes. Take a look at some of the examples in the tutorial.

  • Input disabled check box

    how to display input disabled check box in selection screen.
    plz give me sample code.i think we have to use at selection-screen output. so using it how we have to build code

    Below is the code we can use:
    REPORT zrjntrial_tree LINE-COUNT 65
    LINE-SIZE 80
    NO STANDARD PAGE
    HEADING.
    TABLES : vbrk.
    PARAMETERS : p_radio AS CHECKBOX USER-COMMAND opt1.
    SELECT-OPTIONS : s_vbeln FOR vbrk-vbeln,
                     s_fkdat FOR vbrk-fkdat.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name = 'P_RADIO'.
            screen-input = 0.
            screen-output = 1.
            MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    Regards,
    Himanshu

  • Enable the check box in change layout in a report

    Hi all,
    I have a requirement ie after i run a repot we get a change layout icon in that icon there r tab's in it like coloums, sort order....,display.
    In the dispaly tab i have a check box named printout with date,title and page number .so i would like to enable the check box .
    can anybody tell me how can i do it using ALV's
    Thanks,
    Sri

    check FM Reuse_alv_grid_display.
    i_SAVE = 'A/U/'.
    FU REUSE_ALV_LIST_DISPLAY        I_SAVE
    Text
    Variants can be saved
    Description
    Controls the storage mode
    Prerequisite:
    The IS_VARIANT parameter has the appropriate value.
    See also the documentation of the IMPORTING parameter IS_VARIANT.
    Value range
    ' ' = display variants cannot be saved
    Defined display variants (e.g. delivered display variants) can be selected for presentation independently of this flag.
    Changes can not be saved.
    'X' = standard save
    Display variants can be saved as standard display variants.
    User-specific saving is not possible.
    'U' = only user-specific saving
    The user can only save display variants user-specifically
    'A' = standard and user-specific saving
    The user can save a display variant user-specifically and
    as standard display variant. The user chooses in the display variant
    save popup.
    Default
    SPACE
    Function Module
    REUSE_ALV_LIST_DISPLAY
    Regards
    Prabhu

  • How to name the Check Box as "Want Free Gift" using PARAMETERS statements

    Hi all,
    I am new to check boxes. I have a existing report where I have to add a check box to the selection screen.
    So i said
    PARAMETERS: p_cncldc AS CHECKBOX.
    everythibng is fine and I get the check box on the selection screen. when i execute the report i get the name of check box as p_cncldc. but i want the name of the check box as "Want Free Gift".
    How to name the check box as "Want Free Gift".
    if i am saying
    PARAMTERS: Want Free Gift AS CHECKBOX. it says a syntax error saying it canot be more that 8 chars.
    Some one please help. I am new to Check boxes
    Regards,
    Jessica Sam
    Edited by: jessica sam on Mar 31, 2009 10:37 PM

    Text on the Right hand side of check box.
    selection-screen begin of block b1.
    selection-screen begin of line.
    parameters: w_check as checkbox.
    selection-screen: comment  4(30) TEST .
      selection-screen end of line.
    selection-screen end of block b1.
    INITIALIZATION.
    test = 'Want Free Gift AS CHECKBOX'.
    Text on the Left hand side of check box.
    selection-screen begin of block b1.
    selection-screen begin of line.
    selection-screen: comment  2(30) TEST .
    parameters: w_check as checkbox.
      selection-screen end of line.
    selection-screen end of block b1.
    INITIALIZATION.
    test = 'Want Free Gift AS CHECKBOX'.
    OR:
    GOTO(Menubar)>Text Elements>Selection Texts
    Regards,
    Gurpreet

  • How to insert check box value in table?

    Hi all
    kindly help me how to insert check box value in database. what code i have to use as i am new in programing.
    thanx in advance

    Hi,
    There is no "Check box" in a table, a check box is a GUI (Graphical user interface) item.
    What you want is to store a boolean value in a table. For that you can use the varchar2(1) datatype and store Y or N. (or anything else)
    (you cannot define boolean as a datatype for a column).
    If you're using a front-end application like apex then it might be useful for you to read the documentation about chekc boxes :
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/check_box.htm#CHDDFBFH
    (for the rest if it's Oracle Forms then everything is already said).
    Edited by: user11268895 on Aug 17, 2010 10:44 AM

  • How to Create Check Box in Dynamic Table

    Hi Friends,
    I've Created one Dynamic Table there i want to display 2 columns as Check Box.
    How to Add this check box as column cell variant.
    Looping the columns. In this One method SET_TABLE_CELL_EDITOR is ter. But i'm getting how to use this method. Kindly help in this Issue.
    Regards,
    jack.

    Hi upendra
    There are slight changes in the sivas code.Where is the data coming into the table.If its from a Model Node then iterate each element of the source node get that value compare and set the corresponding value in the element of the node binded to table.
    Create a boolean attribute "select" in the table node and bind it to checked property of the check box.
    for(int i=0;i<wdContext.node<tablenode>()..size();i++)
    if(wdContext.node<tablenode>().get<tablenode>ElementAt(i).select())
    wdContext.node<tablenode>().get<tablenode>ElementAt(i).set<yourattribute>(true);
    else
    wdContext.node<tablenode>().get<tablenode>ElementAt(i).set<yourattribute>(false);
    See the attribute is boolean so pass true or false as a values in setter methods.
    Regards
    Kalyan

  • How to activate the Check box in Purchase Order after Goods Receipt

    Hi All,
    How to activate the check box after Goods receipt of Purchase order in Item view (Goods Receipt is completed).
    Where t make the settings in SPRO.
    Regards,
    Shailendra Hadkar

    Hi
    SPRO - SAP IMG- Material management - Inventory management and physical inventory - Goods receipt - create purchase order automatically - activate auto Po creation for movement type.
    Then activate the auto PO creation in Vendor master - Purchasing view
    Check it out.
    Regards,
    raman

  • How to handle the check box in the alv tree display

    Hello,
    in my ALV Tree Report i have a check box in the output.
    I have one check box in the selection screen as select all .
    if this is selected then all the check boxes in the output must be selected that is (X).
    am using CL_GUI_ALV_TREE  for this.
    Please give me some input how to make that check boxes 'X' in the above mentioned case.
    With Regards,
    Sumodh.P

    Sumodh,
    check this
    Re: Select all checkbox in ALV tree
    please search before posting
    Thanks
    Bala Duvvuri

  • How to get a check box on the selection screen

    Hi all
    can any body tell me how to get a check box on the selection screen

    parameter: pa_check   as checkbox.
    To define the input field of a parameter as a checkbox, you use the following syntax:
    PARAMETERS <p> ...... AS CHECKBOX ......
    Parameter <p> is created with type C and length 1. In this case, you may not use the additions TYPE and LIKE. Valid values for <p> are ' ' and 'X'. These values are assigned to the parameter when the user clicks the checkbox on the selection screen.
    If you use the TYPE addition to refer to a data type in the ABAP Dictionary of type CHAR and length 1 for which 'X' and ' ' are defined as valid values in the domain, the parameter automatically appears as a checkbox on the selection screen.
    REPORT DEMO.
    PARAMETERS: A AS CHECKBOX,
    B AS CHECKBOX DEFAULT 'X'.

  • How to default a check box?

    Hi,
      How to default a check box?
    Regards,
    Jaya

    Hi
    DATA :
       w_c type c value 'X'.
    WRITE :
       w_c as CHECKBOX , 'XYZ'.
    Regards
    Pavan

  • How to keep a check box in script

    hi
    how to keep a check box in script

    Hi,
    go to sapscript editor
    Change the editor to 'PC Editor' and take the menu.
    Include -> Characters -> SAP Symbols
    whether this will not be visible in the print preview.
    other wise..
    Just keep it like <697> in your text element.
    Telephone <697> : &W_TAB-TEL&
    Corresponding symbol will be printed in the paper.
    Note: It will not be displayed in the print priveiw.
    Regards,
    Shiva k

Maybe you are looking for