Need method to disable checkbox

Hi,
My alv Grid report contains checkbox at end of each row, when ever user select the checkbox , I am taking the particular line  to internal Table by using below code.
DATA cl_gui_alv_grid TYPE REF TO cl_gui_alv_grid.
  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
       IMPORTING
            e_grid = cl_gui_alv_grid.
  CALL METHOD cl_gui_alv_grid->check_changed_data.
My problem is whenever user selects the checkbox the checkbox should go Gray(Disabled).
Is there any method to do this, If so pls give sample code.
I tried with SET_VISIBLE, but not working
I am using version 4.6C
Thanks
kar
Edited by: karthik karthik on Jan 9, 2008 7:52 PM

hi karthik,
this may be helpful to u
You have to have in the Output Table:
Types: begin of lt_io.
include structure mara. " Your Structure
Types: style_table type lvc_t_style.
Types: end of lt_io.
data: lt_io type table of lt_io,
ls_layout type lvc_s_layo,
lt_fcat type lvc_t_fcat,
lo_grid type ref to cl_gui_alv_grid.
field-symbols: <io> type lt_io,
<fcat> type lvc_s_fcat.
... fill your output table ....
ls_layout-stylefname = 'STYLE_TABLE'.
loop at lt_io assigning <io>.
PERFORM set_style USING 'CHECKBOX' "Your Filename
CHANGING <io>.
endloop.
... Fill Your Field Catalog lt_fcat
read table lt_fcat assigning <fcat>
where fieldname = 'CHECKBOX'.
<fcat>-checkbox = 'X'.
create grid control lo_grid.
CALL METHOD lo_grid->set_table_for_first_display
EXPORTING
is_layout = ls_layout
CHANGING
it_fieldcatalog = lt_fcat
it_outtab = lt_io[].
FORM set_style
USING iv_fieldname TYPE lvc_fname
CHANGING cs_io TYPE io.
DATA: ls_style TYPE lvc_s_styl,
lt_style TYPE lvc_t_styl.
ls_style-fieldname = iv_fieldname.
if cs_io-checkbox = ' '.
ls_style-style = cl_gui_alv_grid=>mc_style_enabled.
else.
ls_style-style = cl_gui_alv_grid=>mc_style_disabled.
endif.
ls_style-maxlen = 2.
INSERT ls_style INTO TABLE io-style_table.
ENDFORM. "set_style
regards,
sravanthi

Similar Messages

  • Disable Checkbox in OO ALV

    hi experts,
    after some processing of my alv, for records that are flagged, i will need to diable the checkbox.
    LOOP AT gt_rec_item INTO ls_alv WHERE locked_flag = 'X'.
          l_tabix = sy-tabix.
          REFRESH lt_celltab.
          ls_celltab-fieldname = 'CHECKBOX'.
          ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
          INSERT ls_celltab INTO TABLE lt_celltab.
          INSERT lines of lt_celltab INTO TABLE ls_alv-celltab.
          MODIFY gt_rec_item FROM ls_alv.
        CALL METHOD g_grid->refresh_table_display.
    by using the above codes, it does change the checkbox to be disabled, but it doesnt show in my alv.

    Hi Weishan,
    I think that you are forgetting to update your main data table.
    You are building new style tables, but you have to reapply these style tabs to the corresponding rows of your internal table, and <i>then</i> call refresh_table_display.
    Hope this helps...
    Phil

  • Bug : Datatable with disabled checkboxes

    Hello,
    I was able to implement a datatable with modify, delete links for each row.
    The following code works:
    <h:data_table id="DataTable" value="#{DataScreen.records}" var="record">
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.modifyAction}">
           <h:output_text value="#{DataScreen.modifyLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.deleteAction}">
           <h:output_text value="#{DataScreen.deleteLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column1_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column1}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column2_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column2}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
    </h:data_table>But, I added a third column of type boolean, which is displayed as a disabled checkbox.
    The table is displayed properly in the browser. But, when I click on the modify, delete links,
    the corresponding action method (DataScreen.modifyAction() or DataScreen.deleteAction())
    is not called.
    <h:data_table id="DataTable" value="#{DataScreen.records}" var="record">
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.modifyAction}">
           <h:output_text value="#{DataScreen.modifyLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.deleteAction}">
           <h:output_text value="#{DataScreen.deleteLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column1_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column1}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column2_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column2}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column3_Header" /></f:facet>
         <h:selectboolean_checkbox value="#{DataScreen.column3}" disabled="true" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
    </h:data_table>I would be glad to know if there is any workaround.
    Thanks,
    Ajay

    I forgot to mention that there is no error message in the log file. The same page is displayed again
    after clicking on the Modify or Delete Link.
    If I remove the third column (disabled checkbox), the modify and delete links work fine.

  • Disable checkbox in output report

    hi gurus
    I have display checkbox with tick in front of row in output at simple report program. My query is that I want to do disable checkbox whose are on tick in output screen.
    Please suggest me how can I do ?
    Best Regards.
    Pravin

    hey pravin    tryout this code and each time u select checkbox press f8 .
    REPORT  hide_unhide_box
    selection-SCREEN : begin of block b2 with frame.
      PARAMETERS: chk1 as CHECKBOX MODIF ID M1,
                  chk2 as CHECKBOX MODIF ID M1  DEFAULT 'X'.
    SELECTION-SCREEN:END OF BLOCK b2.
    AT SELECTION-SCREEN OUTPUT.
       if  chk1 eq 'X'.
         loop AT SCREEN.
             if screen-group1 = 'M1'.
                screen-invisible = 1.
            endif.
            MODIFY SCREEN.
         ENDLOOP.
        endif.
    If usefull please reward with points .
    thanks and regards
    Anoop Gupta

  • After selecting the value from the list box, want to disable checkbox

    hi guru,
    After selecting the value from the list box, want to disable checkbox and custom control textbox(container) in module pool.
    so please help me on this.
    thanx,
    man

    in PBO,
    loop at screen.
      if screen-name = your textbox's name.
        screen-input = 0.
        modify screen.
      endif.
    endloop.

  • Disable checkbox for some records in a datasource

    Hi,
    I am having a datatable which is binded to a datasource. There is a check box for every record in the list. Check on some records and click the submit button. After that i want the records i have already submitted to be disabled(checkbox disabled) when the page is refreshed. Is there any way to do it. plz help. Thanks in advance

    I would have a table field to store the submitted items, so that when you open the page you can compare with that field and use <html:checkbox disabled="true"....> for the submitted records. I think it will work out. Is this only just for that session?

  • What is the method to disable the Parameters button

    Hi Ted,
    What is the method to disable the Parameters button ("Show/Hide Parameters Panel")?
    I can't find it in the API.
    Thanks,
    Tuan

    With XI 3.0, the left-hand panel is tri-state:
    [https://boc.sdn.sap.com/node/17983#setToolPanelViewType|https://boc.sdn.sap.com/node/17983#setToolPanelViewType]
    Sincerely,
    Ted Ueda

  • Need some help for checkbox

    Hi and Evening to Everybody,
    I have a Scenario where i need to select an entire row using the check box. Let me first define the Situation. I created a Simple Sql-report where the first column is a Simple Checkbox and the second column is a display only name and followed by the rest 5 columns as a checkbox.
    my table structure is :
    **create table satt (SELECT_ALL VARCHAR2(10), Name VARCHAR2(50), Object1 VARCHAR2(10), Object2 VARCHAR2(10), Object3 VARCHAR2(10), Object4 VARCHAR2(10), Object5 VARCHAR2(10));**
    Now i had a requirement where i need to Check All or Uncheck All Checkbox by clicking SELECT_ALL column header and i made it using
    simple java-script :
    "<input type="Checkbox" onclick="$f_CheckFirstColumn(this)">"
    Now i need to Check all checkbox in a row by clicking any of the SELECT_ALL check boxes. (Say i have 5 checkboxes in SELECT_ALL column and if i click 3rd checkbox... i need the entire 3rd row checkbox to be checked on click of that 3rd check box).
    I hope i was clear with my question. i did my best. Please help me out with this... Im eagerly lookin for the solutions.
    Thanks & Regards,
    - The Beginner.
    Edited by: 854477 on Jul 18, 2011 1:50 AM

    Dear BEGINNER..
    Assuming that you're using a standard table based layout for the report, what you need to do is add some code in the HTML attributes of the checkbox in the first column..
    The following javascript would set all other checkboxes in the same ROW as the first checkbox to the same state as it is.
    onclick="if (this.checked) {$f_CheckAll(this.parentNode.parentNode, true);} else {$f_CheckAll(this.parentNode.parentNode, true);}"NOTE: that this will only fire if the first checkbox on the row is actually clicked by the mouse. It won't fire if the first checkbox in the row is set by the CHECK_ALL in the column header.
    Hope this helps.
    Doug gault
    www.sumneva.com

  • Setting the color of a disabled checkbox...

    Hi,
    how do I set the color of a (disabled) JCheckBox because the following code does not work for me:
    jCheckBox1.setForeground(Color.BLACK);The background is that I don't want to have the checkbox in this grey (disabled) style, instead it should look like a "normal" checkbox (but disabled).
    Any ideas?
    Best regards
    - Stephan

    WindowsLookAndFeel uses native APIs to draw most of the controls. So, a disabled checkbox under Windows LAF will use the same API as the native disabled checkbox. You can install a custom JXLayer on that checkbox to prevent all the events from being passed to it - not the cleanest solution, but it will get you there (and make your users annoyed that they can't click on that checkbox).

  • Do In need to manually disable JAVA in LION to protect from FlashBack?

    Do I need to manually disable JAVA in a new installation of LION to protect from FLASHBACK or does it install with JAVA disabled by default?

    It's disabled by default.  But that's assuming a new installation or on a new Mac.
    It's easy enoug to double check in Safari>Preferences>Securtity.
    Also, double check Java prefernces systme wide by launching the Java Preferences from the Utilities folder inside the Applications.
    If it asks you to first install Java then click Not Now.  If it does open prefernes, make sure they are unchecked in the General tab.
    Here's a good overview that OSX Daily published a while back.
    http://osxdaily.com/2012/04/07/tips-secure-mac-from-virus-trojan/
    Matt
    Message was edited by: Matthew Morgan

  • SNMP need ot be disable so the printers can show online

    I have an old question:
    I had to disable SNMP in printer port configurations so the printers can be not offline.
    Why and what caused these issues? We have tons of printer devices , only few are shown offline and need to manually disable SNMP in the tcp port settings to make them online.

    Hi,
    Please make sure that you have the same SNMP configuration on the printer device with what you have on the port used on the print server.
    Also, make sure that the SNMP community name is "public".
    Similar threads:
    Windows 2008 R2 - Printer "Offline" SNMP issue.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/be2d661d-1595-40d7-bdd1-5372085bf810/windows-2008-r2-printer-offline-snmp-issue?forum=winserverprint
    Printers offline in windows 2008 R2
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/80b06f0d-3b81-4cc6-95ad-aabc781d1eb0/printers-offline-in-windows-2008-r2?forum=winserverprint
    Thanks.
    Jeremy Wu
    TechNet Community Support

  • Checkbox in SALV needs to be disabled

    All,
    I am using a column in SALV report as checkbox. currently all rows of that column (checkbox) is enabled.. But my requirement to is on the basis of another column value in the output table i need to disable  check box in some rows.
    my code for creating check box is
    * Get the Editable Checkbox
      DATA: lo_cols_tab TYPE REF TO cl_salv_columns_table,
            lo_col_tab  TYPE REF TO cl_salv_column_table.
    *   get Columns object
      lo_cols_tab = o_alv2->get_columns( ).
    *   Get VBELN column
      TRY.
          lo_col_tab ?= lo_cols_tab->get_column( 'CHK' ).
        CATCH cx_salv_not_found.
      ENDTRY.
    *   Set the HotSpot for VBELN Column
      TRY.
            CALL METHOD LO_COL_TAB->SET_CELL_TYPE
              EXPORTING
                VALUE = IF_SALV_C_CELL_TYPE=>CHECKBOX_HOTSPOT.
      ENDTRY.
    Courtesy Naimesh Patel

    Hi a®s,
    same old SALV story - no standard functionality to make it editable anyway. If you do it as some people recommend  with inherited objects, you are still limited to columns.
    Maybe it's time for you to go webdynpro - there are special CL_WD_SALV classes and we have cell objects there making everything possible.
    If you got the time you may analyze the WD stuff and start a coding project for this without web dynpro.
    Regards,
    Clemens

  • Need help to disable input selection-screen - very urgent

    Hi SAP experts,
    I have a requirement where in I need to disable ( Grey out ) the input fileds on the selection screen .
    My problem is as I am using ABAP query I am not able to use any events ( AT SELECTION-SCREEN OUTPUT ).
    My selection screen looks like this
    MATERIAL NUMBER ( SELECT-OPTIONS)
    MATERIAL TYPE ( PARAMETERS )
    Now I want to add one more check box below the above fields on the selection-screen.When I click on the check-box,the MATERIAL NUMBER  must be greyed out and MATERIAL TYPE should remain the same.
    Please let me know the coding for the same. All answers would be rewarded.
    Thanks in Advance,
    Suresh.

    Hi,
    Check out these codes.
    1.
    TABLES : mara, makt.
    parameter: p_matnr type mara-matnr,
               p_maktx type makt-maktx.
    at selection-screen output.
    select single maktx
    from makt
    into p_maktx
    where matnr = p_matnr
    and spras = 'EN'.
    loop at screen.
      if screen-name = 'P_MAKTX'.
        screen-input = 0.
        modify screen.
      endif.
    endloop.
    2.
    TABLES : mara, makt.
    TYPES:BEGIN OF tp_maktx,
          maktx TYPE makt-maktx,
          END OF tp_maktx.
    DATA:t_maktx TYPE STANDARD TABLE OF tp_maktx,
         wa_maktx TYPE tp_maktx.
    SELECT-OPTIONS: s_matnr FOR mara-matnr.
    SELECT-OPTIONS: s_maktx FOR makt-maktx.
    INITIALIZATION.
      REFRESH s_maktx[].
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name = 'S_MAKTX-LOW' or screen-name = 'S_MAKTX-HIGH'.
          screen-input = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
      REFRESH s_maktx[].
      if s_matnr[] is not initial.
      SELECT maktx FROM makt
      INTO TABLE t_maktx
      WHERE matnr IN s_matnr
      AND spras = 'EN'.
      endif.
      LOOP AT t_maktx INTO wa_maktx.
        s_maktx-low = wa_maktx-maktx.
        APPEND s_maktx.
        CLEAR:wa_maktx.
      ENDLOOP.
    3.
    TABLES : mara, makt.
    parameter p_cb1 type c as checkbox.
    parameter p_cb2 type c as checkbox.
    parameter p_cb3 type c as checkbox.
    initialization.
    loop at screen.
    if screen-name = 'P_CB3'.
    screen-invisible = 1.
    modify screen.
    endif.
    endloop.
    at selection-screen output.
    *loop at screen.
    *if screen-name = 'P_CB3'.
    *screen-invisible = 1.
    *modify screen.
    *endif.
    *endloop.
    loop at screen.
    if p_cb1 = 'X'.
      if screen-name = 'P_CB2'.
      screen-invisible = 1.
      modify screen.
      endif.
      if screen-name = 'P_CB3'.
      screen-invisible = 0.
      modify screen.
      endif.
    endif.
    if p_cb2 = 'X'.
      if screen-name = 'P_CB3'.
      screen-invisible = 1.
      modify screen.
      endif.
      if screen-name = 'P_CB1'.
      screen-invisible = 0.
      modify screen.
      endif.
    endif.
    if p_cb3 = 'X'.
      if screen-name = 'P_CB1'.
      screen-invisible = 1.
      modify screen.
      endif.
      if screen-name = 'P_CB2'.
      screen-invisible = 0.
      modify screen.
      endif.
    endif.
    endloop.
    Reward if helpful..
    Regards.

  • ALV Grid - Hiding the values of a feild and disabling checkboxs

    Hello,
    I have a report that requires the need to hide certain fields in an ALV report as well as checkbox in certain rows.
    So example I want to turn the ALV's output from ....
    PO Number
    PO Item
    450000001
    001
    450000001
    002
    450000001
    003
    450000002
    001
    450000002
    002
    [   ] = checkbox
    to the desired output below ...
    PO Number
    PO Item
    450000001
    001
    002
    003
    450000002
    001
    002
    so baically I want to do 2 things
    1. Hide the values of certain fields if the value from the previous row is identital and ...
    2. .... only include checkboxes for each new value of that column by either hiding (preferable) or disabling them.
    Hope to hear from all of you soon.
    Thank you all and good day.

    Hi Chad Cheng,
    U have a variable IT_SORT in the FM REUSE_ALV_GRID_DISPLAY.
    IT_SORT -fieldname = ur fieldname 1.
    IT_SORT-up = 'X' or IT_SORT-Down = 'X'.
    Append it_sort.
    IT_SORT -fieldname = ur fieldname 2.
    IT_SORT-up = 'X' or IT_SORT-Down = 'X'.
    Append it_sort.
    awrd points if helpful
    Bhupal

  • Need code for this checkbox validation

    There are 3 checkboxes on my form cb1,cb2,cb3.I need the code for the below validations..
    if I check the checkbox cb1 then cb2,cb3 should be disabled(grayed, should not allow to
    check). when i unchecked cb1 all 3 boxes should be enabled and then if i check cb2
    then cb1,cb3 should be disabled.
    At any point of time only one checkbox should be checked and
    remaining 2 will be disabled/grayed.
    hope its clear.
    thanks in advance
    Devender

    Hello,
    You can enable/disable your check box items with the:
    Set_Item_Property( 'item_name', ENABLED, PROPERTY_TRUE | PROPERTY_FALSE ) Built-in.
    If Checkbox_Checked( 'chk1' ) Then
       Set_Item_Property( 'chk2', ENABLED, PROPERTY_FALSE ) ;
       Set_Item_Property( 'chk3', ENABLED, PROPERTY_FALSE ) ;
    End if ;
    ...Francois

Maybe you are looking for

  • How to loading the opening stock balance into Infocube 0IC_C03

    Dear Expers, I have referenced SDN a expert's documentation, but I canu2019t go on at page 10 . Check: How Tou2026 [Handle Inventory Management Scenarios in BW|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f83be790-0201-0010-4fb0

  • Action Script 3 Percentage Preloader

    Here is my code: import flash.display.*; this.stop(); var ld:Loader = new Loader(); ld.contentLoaderInfo.addEventListener(Event.COMPLETE, addSWF); ld.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, preloaderHandler); ld.load(new URLRequest

  • How to attach a file in soap

    How to attach a text/xml filel in soap response. can any body explain in detail about this.

  • Is it possible to pass variables from Tidal to the Peoplesoft run controls?

    Does anyoen know •1) Is it possible to pass variables from Tidal to the Peoplesoft run control page such as current date? An example would be updating run control parameters for a PSQUERY. •a) From date •b) To date •c) Business units Thanks, Jay

  • Why cant itunes let me sync my iphone?

    ive got this iphone i got icloud account and everything the only thing is not activated to any company. ive tried to connected to my computer on itunes its reads it and everything when i click on iphone buttom shows a screen saying WERE UNABLE TO CON