ALV - Problem with checkbox.

Dear All,
I have created an ALV Grid Control and have one column as a check box.
when i tick one checkbox in a line item i pop up a message saying "Do you wish to continue".
If the user selects NO then i automatically want to deselect the checkbox.
I tried clearing the work area of the internal table in the data change event.
But when the alv is refreshed the checkbox is still ticked.What should be done to avoid this.
Is freeing the custom container and creating it again everytime the user selects NO  a good option?
Kindly suggest.
Regards,
Varun

In ALV you put check box like
X_FIELDCAT-FIELDNAME = 'CHK'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
X_FIELDCAT-INPUT = 'X'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-CHECKBOX = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
in between you put logic
IF CHK = 'X'
*---popup_to_continue_yes_no
    PERFORM POPUP_TO_CONT_YES_NO.
endif.
FORM POPUP_TO_CONT_YES_NO .
  CALL FUNCTION 'POPUP_CONTINUE_YES_NO'
    EXPORTING
      TEXTLINE1 = 'Click OK to leave program'
      TITEL     = 'POPUP_CONTINUE_YES_NO'
    IMPORTING
      ANSWER    = ANS.
  IF ANS = 'J'.
    LEAVE PROGRAM.
  ENDIF.
ENDFORM.                    " POPUP_TO_CONT_YES_NO

Similar Messages

  • Problem with checkbox group in row popin of table.

    In table row popin I have kept Check Box Group.I have mapped  the texts property of checkbox group to the attribute which is under the subnode of the table.the subnode properties singleton=false,selectioncardinality=0-n,and cardinality=0-n.
    if there are 'n' number of records in the table.each record will have its own row popin and in the row popin there is check box group.
    the check box group in the row popin  belongs to that perticular row.
    but the checkboxegroup values in row popins of all the  rows are getting changed to the row which is lead selected.
    The same scenario  (table in the row popin is showing the values corresponding to its perticular row and all the table values in popin are not getting changed to the one lead selected in the main table)is working fine with the table in place of  checkbox group in row popin with datasource property of table  binded to the subnode
    I cant trace out the problem with checkbox group in place of table.
    Please help me in this regard.I have to place check box group in place of table in row popin.
    Thanks and Regards
        Kiran Kumar K

    I have done the same thing successfully with normal check box ui element. Try using check box in your tabel cell editor instead of check box group.

  • Problem with checkbox column in matrix

    Hello.
    I have a little problem with checkbox column in matrix.
    Column is binded to the UserData.
    It has ValOn="Y", ValOff="N".
    I use C++. It is wird problem. In matrix I have 10 columns - scrollbar role and if You want see checkbox column, You must role to the right. If this column is on the screen, and I use:
    checkcell->PutChecked(VARIANT_TRUE);
    then the checkbox is cheched, and if the checkbox isn`t on the screen and I use this comment - it nothing happening.
    I tried to use ValOn="Y", PutChecked...
    The problem i solved if the column is on the screen - if the column is first in matrix or second, but if it`s last I have a big problem.
    My column with checkbox is not editable, but I tried to make it editable, check it, and then make it uneditable - the same efect.
    How can I solve it ?
    Sorry for my english.
    Kamil Wydra

    Hello Kamil,
    I am not sure about your problem, but here is an example of how to use checkbox in UI API.
    First, create the matrix with checkbox column in Screen painter, and the output is an xml file, like this. Type as 121 indicates that it is a check box.
    - <column AffectsFormMode="0" backcolor="-1" description="" disp_desc="0" editable="0" right_just="0" title="Rented" type="121" uid="Rented" val_off="N" val_on="Y" visible="1" width="41">
      <databind alias="U_RENTED" databound="1" table="@VIDS" />
      <ExtendedObject />
    Second, bind the column to table from DB. This is a bug of 2004 Screen Painter, so if you are using 2005 Screen Painter, there is no problem.
    Third, when you open the form, you can check and uncheck the cell.
    BTW, please set the editable of the column to true.
    Hope this helps,
    Nick

  • Problem with checkbox on table component

    Hello i am having a problem with checkbox in table component
    i am developing something like a shopping cart app and i have a checkbox in my table component , i want users to select items from the checkbox to add to thier cart, They can select the items from cartegory combobox , my problem is when they select the items from the checkbox if they select another category the alread selected once do not display in my collection opbject please how can i maintain the state of the already selected items in my collection object

    Hi,
    Please go through the tutorial "Understanding scope and managed beans". This is available at:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/scopes.html
    The details of the selected items need to be stored in an object that is in session scope.
    Hope this helps
    Cheers
    Girish

  • Problem with checkbox value and app.settings.getSetting()

    Hello everyone.
    I`ve got a problem with getting saved settings for checkbox.
    Saved settings doesn`t apply on checkbox value.
    It`s strange, but it always "true".
    So here piece of code:
    checkMe = 11;    //any value for the first time running
    if (app.settings.haveSetting("savea", "chck")) {                           
                          checkMe = app.settings.getSetting("savea", "chck");  // get saved value, else 11
                          alert("checkMe = "+checkMe)
                        if(checkMe == 11){
                            checkMe= false;   //if there is no saved settings, checkbox value will be false/ unchecked
                            alert("You run this script first time, so manual value will be 'false'")
                            }else{
                                checkMe = app.settings.getSetting("savea", "chck");     // if saved settings exist, get true or false
         alert("Yes, checkMe will = "+checkMe)       
    win.checkPanel.chkOne.value = checkMe;  /// checkbox value will equal saved checkMe
    var fff = win.checkPanel.chkOne.value;  // string for alert
    alert("aha! but checkbox value is  = " +fff+ "\n Why so?")     // here we`ve got always "true"
    win.checkPanel.chkOne.onClick  = function () {
        var path11 = win.checkPanel.chkOne.value;  //  checkbox value to variable
        app.settings.saveSetting("savea", "chck", path11);  //saving checkbox value
        alert("Saved this value - " + app.settings.getSetting("savea", "chck"))
    win.checkPanel.chkOne.value is always true.
    Can someone exmplain why and how to get rid of this static value?
    P.S. just in case, here is full code:
    function mainFun()
        this.windowRef = null;
    mainFun.prototype.run = function()
        /*----- UI -----*/
              var retval = true;
              var win = new Window("palette", "Check option", [150, 150, 460, 455]);
              this.windowRef = win;
              win.checkPanel = win.add("panel", [25, 150, 285, 265], "Checkbox");
              win.checkPanel.chkOne = win.checkPanel.add("checkbox", [10, 15, 125, 35], "Checkbox One");
              //win.checkPanel.chkTxtOne = win.checkPanel.add('edittext', [140, 15, 230, 35], '');
         win.quitBtn = win.add("button", [110,275,200,295], "Close");
    checkMe = 11;    //any value for the first time running
    if (app.settings.haveSetting("savea", "chck")) {                           
                          checkMe = app.settings.getSetting("savea", "chck");  // get saved value, else 11
                          alert("checkMe = "+checkMe)
                        if(checkMe == 11){
                            checkMe= false;   //if there is no saved settings, checkbox value will be false/ unchecked
                            alert("You run this script first time, so manual value will be 'false'")
                            }else{
                                checkMe = app.settings.getSetting("savea", "chck");     // if saved settings exist, get true or false
         alert("Yes, checkMe will = "+checkMe)       
    win.checkPanel.chkOne.value = checkMe;  /// checkbox value will equal saved checkMe
    var fff = win.checkPanel.chkOne.value;  // string for alert
    alert("aha! but checkbox value is  = " +fff+ "\n Why so?")     // here we`ve got always "true"
    win.checkPanel.chkOne.onClick  = function () {
        var path11 = win.checkPanel.chkOne.value;  //  checkbox value to variable
        app.settings.saveSetting("savea", "chck", path11);  //saving checkbox value
        alert("Saved this value - " + app.settings.getSetting("savea", "chck"))
              win.quitBtn.onClick = function() {
                  win.close();
        win.center();
              win.show();
              return retval;
    if(typeof(mainFun_unitTest) == "undefined") {
        new mainFun().run();

    Played around with different values, combinations...
    Doesn`t work too:
    checkMe = 111;    //any value for the first time running
    if (app.settings.haveSetting("333", "check")) {                           
                          checkMe = app.settings.getSetting("333", "check");
    alert(checkMe);
                    if(checkMe == 111){
                             win.checkPanel.chkOne.value= false;
                            }else{
                                if (checkMe != false){
                                win.checkPanel.chkOne.value= true;
                                }else{
                                win.checkPanel.chkOne.value= false;
    win.checkPanel.chkOne.onClick  = function () {
        var path11 = win.checkPanel.chkOne.value;
        var path12 = path11.toString();
        app.settings.saveSetting("333", "check", path12);
        alert("Saved value - " + app.settings.getSetting("333", "check"))

  • Problem with checkbox in the selection screen

    Hi guys,
    I have a problem with the check box in the selection screen.When i select a check box then a field in the selection screen should be enabled for entering a value.Again if i unselect the checkbox then the field should be disabled for entering a value.I have written the code in at selection-screen output.
    The problem is when i select the check box ,the field is not enabled.But when i press enter after selecting the checkbox then the field is enabled for input.It is the same when i unselect the checkbox,after i press enter only the field is getting disabled.What could be the problem.Any suggestions please?
    Thanks.

    Hi d p
                 Please try this code . I think this code have some way that you would like.
    REPORT  zdownload_to_application_server.
    TABLES : caufvd, jest.
    I N C L U D E  P R O G R A M                                        *
    *INCLUDE znrpstnd.
    Selection Screen                                                    *
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
    PARAMETERS: p_outb RADIOBUTTON GROUP g1 USER-COMMAND outb DEFAULT 'X' ,
                p_inb RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK b3.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    PARAMETERS : p_werks LIKE caufvd-werks MODIF ID a.        " Plant   "OBLIGATORY
    SELECT-OPTIONS  :  s_auart FOR caufvd-auart MODIF ID a,       " Order Type
                       s_aufnr FOR caufvd-aufnr MODIF ID a.       " Order number
    PARAMETERS: p_path TYPE string DEFAULT 'C:\SchedulerInterface-OutboundTextFile\' MODIF ID a,
                p_actual AS CHECKBOX MODIF ID a.                  " Transfer Actual
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
    PARAMETERS : p_werks2 LIKE caufvd-werks MODIF ID b,   " Plant   "OBLIGATORY
                 p_path2 TYPE string DEFAULT 'C:\SchedulerInterface-InboundTextFile\' MODIF ID b,
                 p_path3 TYPE string DEFAULT 'C:\SchedulerInterface-InboundTextFile\' MODIF ID b,
                 p_sessio TYPE apqi-groupid MODIF ID b.   " BDC Session
    SELECTION-SCREEN END OF BLOCK b2.
    AT SELECTION-SCREEN OUTPUT.
      IF p_outb EQ 'X'.   " Outbound --> Hide inbound
        LOOP AT SCREEN.
          "IF screen-name = '%BT02011_BLOCK_1000'.
          IF screen-group2 = 'BLK'.
            screen-active = 1.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'A'.
            screen-active = 1.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'B'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          "IF screen-name = '%BT01004_BLOCK_1000'.
          IF screen-group3 = 'BLK'.
            screen-active = 1.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'A'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'B'.
            screen-active = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path2.
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          def_path         = 'C:\SchedulerInterface-InboundTextFile\'
          mask             = ',Text Files,.txt,All files,.*.'
        IMPORTING
          filename         = p_path2
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path3.
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          def_path         = 'C:\SchedulerInterface-InboundTextFile\'
          mask             = ',Text Files,.txt,All files,.*.'
        IMPORTING
          filename         = p_path3
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
    TOP-OF-PAGE.
    START-OF-SELECTION.
    Regards
    Wiboon

  • Problem with checkbox selection in Tableview

    Hi All
    I am using table view with 8 columns - in the last 4 columns i have checkboxes for user input - i have a strange problem - when the table has multiple entries - for the last column i can only select the checkbox on line 1 - and i cannot select the checkbox on the remaining entries below - but for the other colums with checkboxes this is not the case
    The selection mode for the table is no line selection - since the table is already displayed with input enabled fields - this is to reduce the no of clicks for user
    Can anyone point out what is going wrong - how can i fix this - what i am doing wrong ?
    Thanks
    Sen

    Hi
    When i click on the checkbox for the 2nd or 3rd rows of the last column - nothing happens - the checkox is still active but nothing happens -
    this is the tableview code
    <htmlb:tableView id              = "Detail"
                     design          = "ALTERNATING"
                     headerText      = "Header Text"
                     onNavigate      = "onMyNavigate"
                     emptyTableText  = "test"
                     onRowSelection  = "onMyRowSelection"
                     fillUpEmptyRows = "false"
                     footerVisible   = "true"
                     visibleRowCount = "5"
                     table           = "<%= DETAILTAB %>"
                     iterator        = "<%= iterator %>" >
    and this is the code for the last column
    <htmlb:tableViewColumn columnName         = "OBSOFLGICON"
                               width               = "3"
                               type                = "user"
                               horizontalAlignment = "CENTER"
                               title               = "Obs" >
          <htmlb:checkbox />
        </htmlb:tableViewColumn>
    Thanks
    Sen

  • Problem with checkbox and Event.stop(event)

    Hello,
    I cannot change the checkbox in a row, if the Event.stop(event) is fired on checkbox. My aim is, that the event OnRowClick is stoped, if I change the checkbox in the row.
    <rich:extendedDataTable id="requestTable" value="#{requestListHandler.normalisedRawRequestList}" var="req"
                             rows="#{requestListHandler.limitRows}" selectionMode="single">
                             <a4j:support event="onRowClick" action="#{requestListHandler.viewRequest}">
                                  <f:setPropertyActionListener value="#{req}"
                                       target="#{requestHandler.selectedRequest}" />
                                  </a4j:support>
                            <rich:column>
                                       <h:outputText value="#{req.offerListSize}">
                                            <f:convertNumber type="number" />
                                       </h:outputText>
                         </rich:column>
                             <rich:column id="checkBoxColumns">
                                       <h:selectBooleanCheckbox onclick="Event.stop(event);"
                                            value="#{req.firstInterpreterTimeChecked}"/>
                         </rich:column>
    </rich:extendedDataTable>I know I am using richfaces, but I have problem with sun-ri component <h:selectBooleanCheckbox..../>.
    Have you any idea?
    Manu
    Edited by: Argonist on Jun 16, 2009 8:27 AM
    Edited by: Argonist on Jun 16, 2009 12:25 PM

    I had the same problem. I read you post and was so disappointed that no one had answered you. But I have a good news for you :) My team leader managed to solve this awkward problem.Add to h:selectBooleanCheckbox style="z-index: 20;" so that it is "above" the table row that fires its own onclick event.

  • Problem with Checkbox that disables/enables other components.

    Hi
    As I show in the title, I have problems with a checkbox that enables/disables another components (three exactly).
    I have done the follow:
    1.- Set property "AutoSubmit" true in the SelectOneChoice
    2.- Set "Disabled" property true or false depending if the SelectOneChoice is selected or not
    (#...selectBooleanCheckbox.value?false:true})
    3.- Set the Partial triggers to the SelectOneChoice in the three components.
    CASE 1: The SelectOneChoice is unmarked. The three components appears disabled and when I mark the SelectOneChoice, this components appears enabled. The thing works ;)
    CASE 2: The SelectOneChoice is marked. The three components appears enabled and when I unmark the SelectOneChoice, the components continue enabled. They don't disable until I press the submit button.
    how can i make that the components appears disabled when i unmark the checkbox?
    i try with de ChangeValueListener, but it only works where the SelectOneChoice changes from unmarked to marked.
    thanks!

    I think the problem is, when the value is null the checkbox return with the selected state, b'coz u r
    returning the checkbox (as it is). so pl'z try with below code (ADDED).
    public Component getTableCellRendererComponent(JTable table, Object value,
    boolean isSelected, boolean hasFocus,
    int row, int column){
    if(value != null){
    Boolean booleanValue = (Boolean)value;
    setSelected(booleanValue.booleanValue());
    else /// ADDED
    setSelected(false);/// ADDED
    return this;
    Nediaph.

  • ALV List with checkboxes

    Hello experts,
    I'm working on an object where in I need to display an ALV List (using Funct Modules) with checkboxes.
    When I select the checkboxes,and click on a button (Eg.Refresh Button) , I need to get all the details of the selected rows (checked rows) in a seperate ALV List (in a Dailog).
    Could any one of u please suggest me about selecting the row which has been checked(Checkboxes in ALV ).
    Thanks in advance.
    Sanghamitra

    Hi sangha,
    1. To get a taste of it,
       just copy paste this program.
    2. It will display alv (t001)
       It will show CHECKBOXES (besides every row)
       TICK some rows,
      and DOUBLE-CLICK ON any row.
    3.  It will display all the row numbers which have been checked/ticked.
    4.
    report abc.
    TYPE-POOLS : slis.
    Data
    DATA : BEGIN OF itab OCCURS 0.
            INCLUDE STRUCTURE t001.
    DATA : flag tyPE c,
           END OF itab.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : alvly TYPE slis_layout_alv.
    Select Data
    SELECT * FROM t001 INTO TABLE itab.
    *------- Field Catalogue
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = sy-repid
        i_internal_tabname     = 'ITAB'
        i_inclname             = sy-repid
      CHANGING
        ct_fieldcat            = alvfc
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.
    Display
    alvly-box_fieldname = 'FLAG'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        it_fieldcat             = alvfc
        i_callback_program      = sy-repid "<-------Important
        i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important
        is_layout               = alvly
      TABLES
        t_outtab                = itab
      EXCEPTIONS
        program_error           = 1
        OTHERS                  = 2.
    CALL BACK FORM
    FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
    slis_selfield.
      data : msg(100) type c.
      LOOP AT itab.
        if itab-flag = 'X'.
          msg = sy-tabix.
          condense msg.
          concatenate 'Row Number ' msg ' ' into msg
          separated by space.
          message msg type 'I'.
        endif.
      ENDLOOP.
    ENDFORM. "ITAB_user_command
    regards,
    amit m.

  • ALV: Problem with toolbar event

    Hi ALV-experts,
    I have a dynpro with a header area where I display an ALV table. Below this I have a subscreen with a tabstrip control and two tabs.
    In the ALV toolbar I defined an own button. This button gets deactivated after pressing this button. I achieved this by the option "disabled" in the structure stb_button within the event handler for the toolbar event.
    This works all fine so far. If I start the dynpro and click on the button in the ALV-toolbar the buttons gets deactivated afterwards. But I have I jump between the tabs before I press the ALV-toolbar button, the button does not get deactivated.
    The debugger does not go into the event handler of the toolbar event. I also did system debugging of the method SET_TOOLBAR of the CL_GUI_ALV_GRID-class. Here I pass in both cases the command
    raise event toolbar e_object = m_cl_toolbar e_interactive = i_interactive.
    but in the second case (when I change the tabs before I press the button) the event handler is not executed and I don't know why. I also tried to register the event handler for all instances of the ALV still with the same result.
    The ALV method set_toolbar_interactive( ) did also not solve the problem.
    I couldn't find any SAP note about an issue for this event.
    Does anybody have an idea or a solution for this problem?
    EDIT:
    Problem solved, it was typo!
    Thanks in advance and regards,
    Martin
    Edited by: Martin Fischer on Jul 7, 2010 4:53 PM

    The problem was a typo!

  • SAP Gui 7.20 PLevel 3, ALV Problems with German Umlauts u00FCu00F6u00E4...

    Hi,
    we have updated our SAP Gui to version 7.20 lately and have some serious problems now with entering German Umlauts 'üöäÜÖÄß' into any editable ALV grid.
    This means when typing in e.g. 'ü', the grid immediately removes this character and replaces it by, well, by nothing. It just ignores this character at all.
    SAP Gui is currently at patch level 3 . The correct version is 7200.1.3.3190, build 1196830. Running German Windows XP clients with service pack 3. ERP is running SAP ECC 6.0.
    Is this a known problem? Has sbdy. a workaround this?
    Edit: Just found the release notes for SAP Gui 7.20 Lvl 3:
    2010/09/02     Texts get garbled while typing umlaut character in ALVGrid, Note 1503081
    This note, however, is not open for public view. OTH this means SAP was aware of this problem and tried to correct it to no avail so far.
    Thanks,
    Michael
    Edited by: Michael Fritz on Nov 19, 2010 11:19 AM

    Hi Martin,
    where did you get this info? Any official SAP note available? Do you encounter similar problems?
    We, too, noticed that uploading and downloading files from directories with German Umlauts, this fails now,too. There may be problems with files, too, however, we did not check this so far. The previous SAP Gui, I guess it was 7.10, didn't have any problems with this.
    I start wondering if SAP Germany have ever tested this? Or do they not use Umlauts anyway

  • Alv Grid With Checkboxes

    HI experts,
         I want to display data in grid with checkboxes.in grid some rows have a negative value and some row have possitive value(means one filed have /-).if row have negative value in that row checkbox must be in disable mode or possitive in that row checkbox must be in enble mode.<Urgency downgraded>+
    Thanks
    V.Venu
    Edited by: Suhas Saha on Nov 14, 2011 4:21 PM

    Thanks Venu For Putting this Question and Thanks Deepak For getting bang on the point.. It Works Perfctlty fine...
    I am Sending Code For Guys Who are suffering from this Problem...
    TYPES: BEGIN OF TY_MARA,
            FLAG  TYPE CHAR1,
            MATNR TYPE MARA-MATNR,
            ERSDA TYPE MARA-ERSDA,
            ERNAM TYPE MARA-ERNAM,
            WESCH TYPE MARA-WESCH,
            STYLE TYPE LVC_T_STYL,
          END OF TY_MARA.
    DATA : IT_MARA TYPE STANDARD TABLE OF TY_MARA.
    DATA : IT_MARA1 TYPE STANDARD TABLE OF TY_MARA,
           WA_MARA TYPE TY_MARA,
           WA_MARA1 TYPE TY_MARA.
    DATA : WA_SETTINGS TYPE LVC_S_GLAY.
    DATA : WA_LAYOUT TYPE LVC_S_LAYO.
    DATA : IT_FIELDCATALOG TYPE LVC_T_FCAT,
            WA_FIELDCATALOG TYPE LVC_S_FCAT.
    DATA REF1 TYPE REF TO CL_GUI_ALV_GRID.
    DATA: LS_EDIT TYPE LVC_S_STYL,
          LT_EDIT TYPE LVC_T_STYL.
    START-OF-SELECTION.
      SELECT MATNR ERSDA ERNAM WESCH
        FROM MARA INTO CORRESPONDING FIELDS OF TABLE IT_MARA
      UP TO 10 ROWS.
      WA_FIELDCATALOG-FIELDNAME = 'FLAG'.
      WA_FIELDCATALOG-OUTPUTLEN =  6.
      WA_FIELDCATALOG-CHECKBOX  = 'X'.           "as checkbox
      WA_FIELDCATALOG-EDIT      = 'X'.
      WA_FIELDCATALOG-SELTEXT = 'Check box'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'MATNR'.
      WA_FIELDCATALOG-OUTPUTLEN =  20.
      WA_FIELDCATALOG-SELTEXT = 'Mat no'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'ERSDA'.
      WA_FIELDCATALOG-OUTPUTLEN =  15.
      WA_FIELDCATALOG-SELTEXT = 'Creation Date'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'ERNAM'.
      WA_FIELDCATALOG-OUTPUTLEN =  20.
      WA_FIELDCATALOG-SELTEXT = 'Creation Time'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'WESCH'.
      WA_FIELDCATALOG-OUTPUTLEN =  20.
      WA_FIELDCATALOG-SELTEXT = 'Quantity'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
      CONSTANTS : LC_X TYPE CHAR1 VALUE 'X'.
      WA_LAYOUT-CWIDTH_OPT = LC_X.
      WA_LAYOUT-ZEBRA             = LC_X.
      WA_LAYOUT-STYLEFNAME = 'STYLE'.
      LS_EDIT-FIELDNAME = 'FLAG'.
      LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
      INSERT LS_EDIT INTO TABLE LT_EDIT.
      INSERT LINES OF LT_EDIT INTO TABLE WA_MARA1-STYLE.
      LOOP AT IT_MARA INTO WA_MARA..
        IF WA_MARA-ERSDA EQ '20060809'.
          MODIFY IT_MARA INDEX SY-TABIX FROM WA_MARA1 TRANSPORTING STYLE.
        ENDIF.
      ENDLOOP.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
       EXPORTING
         I_CALLBACK_PROGRAM                = SY-REPID
         I_CALLBACK_PF_STATUS_SET          = 'F_SET_STATUS'
         I_CALLBACK_USER_COMMAND           = 'F_USER_COMMAND'
         I_GRID_TITLE                      = 'Example of select and deselect'
         IS_LAYOUT_LVC                     = WA_LAYOUT
         IT_FIELDCAT_LVC                   = IT_FIELDCATALOG
      TABLES
          T_OUTTAB                          = IT_MARA.
    FORM F_SET_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STATUS1'.
    ENDFORM.                   
    FORM F_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                            RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN 'ASEL'.
          LOOP AT IT_MARA INTO WA_MARA.
            WA_MARA-FLAG = 'X'.
            MODIFY IT_MARA FROM WA_MARA.
          ENDLOOP.
          RS_SELFIELD-REFRESH = 'X'.
        WHEN 'DSEL'.
          LOOP AT IT_MARA INTO WA_MARA.
            WA_MARA-FLAG = ' '.
            MODIFY IT_MARA FROM WA_MARA.
          ENDLOOP.
          RS_SELFIELD-REFRESH = 'X'.
        WHEN 'DELETE'.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              E_GRID = REF1.
          CALL METHOD REF1->CHECK_CHANGED_DATA.
          DELETE IT_MARA
                   WHERE FLAG = 'X'.
          RS_SELFIELD-REFRESH = 'X'.
        WHEN 'INSERT'.
          CLEAR WA_MARA.
          APPEND WA_MARA TO IT_MARA.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              E_GRID = REF1.
          CALL METHOD REF1->REFRESH_TABLE_DISPLAY.
        WHEN 'SAVEDB'.
      ENDCASE.
    ENDFORM.

  • Problem with checkbox and process

    Hallo,
    I have a checkbox on my page and now I want to create a process that runs when the checkbox is checked.
    What I want to do is: to ckeck wheather the checkbox is check and if this is then to set values.
    I don't know if it is right how I check the status of the checkbox. What I also don't really know how I can decide
    that all field I go through in the loop get the same value from the XYZ-collection. The value should be the last from
    the XYZ-collection.
    Thanks, Jade
    declare
    check integer:=0;
    change integer:=0;
    begin
    check:=:Px_Check;
    if (check <> 0) then change:=1; end if;
    if change = 1 then
    for i in 1..htmldb_application.g_f04.count
    loop
    htmldb_collection.update_member_attribute(p_collection_name=>'XYZ',
    p_seq=>i,
    p_attr_number=>5,
    p_attr_value=>???);
    end loop;
    end if;
    end;

    Hi,
    Taking the two issues separately....
    1 - When dealing with checkboxes, you have to bear in mind that the submit process will only return the values of those checkboxes that have been ticked into the f04 collection (assuming f04 is the column containing your checkboxes). In order to determine which ones they are, you need to get the value (which should be a row number if you've created the checkboxes by using the Row Selector option) and then use that to get to the values on the actual rows. Something like:
    DECLARE
    vITEM NUMBER;
    BEGIN
    FOR i IN 1..HTMLDB_APPLICATION.G_F04.COUNT
    LOOP
      vITEM := HTMLDB_APPLICATION.G_F04(i);
    END LOOP;
    END;Then, within the loop, you can use vITEM as the row number. So, if the user ticked items 1, 4 and 6. G_F04(1) would contain 1, G_F04(2) would contain 4 and G_F04(3) would contain 6. Therefore, for you update statement, you can use vITEM for the sequence number of the item to update.
    2 - When dealing with collections, if you want to get to the last item in the collection, you can get the member count and use that to get to the member:
    DECLARE
    vCOUNT NUMBER;
    vDATA NUMBER;
    BEGIN
    vCOUNT := HTMLDB_COLLECTION.COLLECTION_MEMBER_COUNT ('XYZ');
    SELECT c005 INTO vDATA FROM HTMLDB_COLLECTIONS WHERE COLLECTION_NAME = 'XYZ';
    END;That should get the c005 value for the last item and store it in vDATA. You can then update the ticked items with this value.
    Andy

  • Problem with checkbox column in ALV popup (ABAP)

    Hi, the problem is: I've created the code below for maintaining a popup with an ALV table inside. One of the column is a checkbox field. When I run first time the popup, it run well, when I clode the popup window and then I run for second time the popup, i see all the columns except those with the checkbox. Someone else have encountered the same proble, if yes someone could me explain that? Here's the code:
    method WDDOINIT .
    data: l_ref_cmp_usage type ref to if_wd_component_usage.
      l_ref_cmp_usage =   wd_This->wd_CpUse_ALV( ).
      if l_ref_cmp_usage->has_active_component( ) is initial.
        l_ref_cmp_usage->create_component( ).
      endif.
      DATA: l_ref_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
      l_ref_INTERFACECONTROLLER =   wd_This->wd_CpIfc_ALV( ).
      data:
      l_VALUE type ref to Cl_Salv_Wd_Config_Table.
      data:  l_tabset  type ref to IF_Salv_Wd_Table_SETTINGS.
    l_VALUE = l_ref_INTERFACECONTROLLER->Get_Model( ).
      l_tabset ?= l_value.
      l_tabset->set_read_only( abap_false ).
      l_tabset->SET_VISIBLE_ROW_COUNT( 15 ).
      l_tabset->set_width( '500' ).
      l_tabset->SET_DESIGN( VALUE = CL_WD_TABLE=>E_DESIGN-ALTERNATING ).
    data:
        lr_std_functions type ref to if_salv_wd_std_functions,
        l_table          type ref to if_salv_wd_function_settings.
      lr_std_functions ?= l_value.
      lr_std_functions->SET_EXPORT_ALLOWED( Abap_false ).
      lr_std_functions->SET_VIEW_LIST_ALLOWED( Abap_false ).
      lr_std_functions->SET_PDF_ALLOWED( Abap_false ).
      lr_std_functions->SET_DIALOG_SETTINGS_ALLOWED(  Abap_off ).
      lr_std_functions->SET_DIALOG_SETTINGS_AS_POPUP( Abap_off ).
      lr_std_functions->SET_DISPLAY_SETTINGS_ALLOWED( abap_off ).
      lr_std_functions->SET_EDIT_APPEND_ROWS_ALLOWED( abap_off ).
      lr_std_functions->SET_EDIT_APPEND_ROW_ALLOWED( abap_off ).
      lr_std_functions->SET_EDIT_CHECK_AVAILABLE( abap_off ).
      lr_std_functions->SET_EDIT_DELETE_ROW_ALLOWED( abap_off ).
      lr_std_functions->SET_EDIT_INSERT_ROWS_ALLOWED( abap_off ).
      lr_std_functions->SET_EDIT_INSERT_ROW_ALLOWED( abap_off ).
      lr_std_functions->SET_PDF_ALLOWED( abap_off ).
      data: lr_column   type ref to cl_salv_wd_column.
    instancing check box
      data: lr_checkbox type ref to cl_salv_wd_uie_checkbox.
      create object lr_checkbox
              exporting
                checked_fieldname = 'CHECK'.
      lr_checkbox->set_read_only( value = abap_false ).
      lr_column = l_value->if_salv_wd_column_settings~get_column( 'CHECK' ).
      lr_column->set_cell_editor( lr_checkbox ).
    endmethod.
    Thanks for answers.

    This is just some guessing - but try and set a breakpoint in the wddoinit of your popup.  I'm betting that it isn't being executed on the second call because the original instance is reused. 
    Take a look at the properties on the view for the popup.  You might try  changing the lifetime of the view from "framework controlled" to "when visible".

Maybe you are looking for

  • Spool list recipient in sm37 - email does not have attachment

    good day all, we have successfully upgraded to ecc 6.0 and now we have an issue with this function. in 4.6c, the external email is sent with a attachment of the report, but in ecc 6.0 the external email has the report directly in the email, no attach

  • Configure 3905 on CME 8.5

    Hello everyone, I have to configure a Cisco SIP phone 3905 in CME ver 8.6. I haven't found a way to do this. I tought about doing it with Fast Track (voice register global-type), but it is supported on CME 10 and above. I was thinking about registeri

  • Issue - automatic release block in MRBR for planned costs (tol KW/PP)

    Tolerance key KW is defined for planned costs.  The tolerance is correctly selected in MIRO and invoices are blocked appropriately; there is no issue in MIRO. The block for planned costs is indicated as a price variance in MRBR and the condition is l

  • Disable delete icon in the Materials requirement form

    hi can anyone tell me how to disable the delete icon in the materials requirements form, using form personalization... reply thanks & regards anandc

  • Anyone experienced with scaling flash projectors to large resolutions?

    I have interesting project that I'm hoping won't become a nightmare. I'm building a kiosk for a client that will have a rather simple Flash application running it. The catch is that it is spread across 4 widescreen monitors. I'm planning to have the