Problem in check box validation

Hi All
I have designed a form in screen painter which contains the employee details.
I have kept two check boxes MALE and FEMALE with itemuid as chmale and chfemale.
I wont to do some validation.
It is check box so I can check both of them,so I need to do validation
My code
Case SAPbouiCOM.BoEventTypes.et_CLICK
                                Try
                                    Select Case pVal.ItemUID
                                        Case "chmale"
                                            oCheckFemale = oForm.Items.Item("chfemale").Specific
                                            If oCheckFemale.Checked = True Then
                                                oCheckMale.Checked = True
                                                oCheckFemale.Checked = False
                                            End If
                                        Case "chfemale"
                                            oCheckMale = oForm.Items.Item("chmale").Specific
                                            If oCheckMale.Checked = True Then
                                               oCheckMale.Checked = False
                                                oCheckFemale.Checked = True
                                            End If
                                    End Select
This is not working.
SAP hangs up for some time.

Hi,
You are missing with BubbleEvent=true;
Below is My Code in C# and its working perfactly for the same requirement as yours.
I have Done it on ItemClick BeforeAction
oCheckBox1 = (SAPbouiCOM.CheckBox)oForm.Items.Item("4").Specific;
                oCheckBox2 = (SAPbouiCOM.CheckBox)oForm.Items.Item("5").Specific;
                if (pVal.ItemUID == "4" && oCheckBox1.Checked == false)
                    oCheckBox2.Checked = false;
                if (pVal.ItemUID == "5" && oCheckBox2.Checked == false)
                    if (oCheckBox1.Checked == true)
                        oCheckBox1.Checked = false;

Similar Messages

  • Problem with check box need an idea

    hello i need some help.
    i am tring to make a attendence register as an assignment. what i am tring to do is that i can add student name in a file and then retrive them from a file and then mark there presents or absents.the part i cant get done is how do i mark the attendence. i want to display name and then the teacher can just click in the check box infront of the name to mark the present and when he clicks on the save button it would save the attendence in the file.
    now the problem is the check box have to increase and decrease if a name is add or deleted in the file
    SO does any one have any ideas what i can do to solve this problem

    lets suppose your file contains student name which are seperted by comma or space (what ever).then u can read it and open stringtokenizer with delimater you used to seperate names.count the number of tokens and create your check box on the count of tokens.There may be some good idea too and if any one have i would like to know.

  • Check Box Validation in Offline Form

    Dear Experts,
    I have a requirement in an offline form where I have six check boxes, and out of the six check boxes
    user can only select any three.
    Request you to please suggest how to achieve this.
    Warm Regrads,
    Upendra Agrawal

    Thanks a ton Shaira.
    Full points to you
    Just wondering  what is the "Validation Script Message" for each UI.
    warm regards,
    Upendra Agrawal

  • Vendor Master Upload Problem with Check Box

    Hi All,
    I have a problem with Vendor Master Upload program. In one of the screen of XK01 transaction depending upon the PO Box, Postal Code, Other City and Other Region i have to check the PO Box w/o no check Box. So in my program after i check the PO Box, Postal Code, Other City and Other Region values how to write a code that i can check the PO Box w/o no. Or other wise how can i send value to the Po Box w/o no check box. field
    Thanks in advance.

    The call to the first screen should look something like:
        perform dynpro
          tables bdcdata
          using:
         'X' 'SAPMF02K'     '0105',         "Create Vendor: Initial Screen
          ' ' 'RF02K-BUKRS'             'COCO',
          ' ' 'RF02K-KTOKK'             'YYYY',
          ' ' 'USE_ZAV'                 'X'.
    I'm using screen 105, not 100 here.
    Rob

  • Problem Using Check Box in a Report

    Hi all,
    I have a simple SQL report with a check box.The problem is when paginating forward and backward in the report(Next and Previous),The report region is refreshed and all the check boxes is reset to unchecked.
    P.S: I'm using APEX 4.0.
    Any Help will be appreciated,
    Ola

    Ola,
    If you search the forum, you will find lot of discussions on this issue..
    In nutshell, solution is -
    Case 1: If you have enabled partial refresh for your report ( pagination works through AJAX)
    Then
    a. onClick of any check-box, call JS function, lets say fnSaveState(this);
    b. In JS function, update/store all the checked check-boxes info in JS variable or array.
    c. Bind a JS function, lets say fnSetState() - which will set the check boxes to either checked or un-checked based on JS variable/array value(s) to pagination onClick event.
    Case 2: If you have not enabled partial refresh for your report
    Then
    a. onClick of any check-box, call JS function, lets say fnSaveState(this);
    b. In JS function, store the check-box status in any hidden_item and insert its value into session with dummy AJAX call.
    c. On page load call JS function, lets say fnSetState() - which will set the check boxes to either checked or un-checked based on hidden item value(s) .
    Hope it helps.
    Regards,
    Hari

  • Problem with Check box in WAD

    Hi ,
    I am creating a Check box in WAD which is a selection variable for a characteristic. I am able to get the display of all the values listed.
    Problem is : I want to have the list of values displayed with a check mark and I am not able to see where to make this setting in WAD.
    Any suggestions....
    Thanks

    Hello Raj
    Given the fact that you do not tell us the most important piece of information (namely whether you are using OO-based ALV or not) I assume you are using fm-based ALV lists.
    In this case you probably have defined a USER_COMMAND routine as described in the documentation of the fm.
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
    * define local data
      DATA: ls_outtab  LIKE LINE OF gt_outtab,
                ld_idx       TYPE i.
      LOOP AT gt_outtab INTO ls_outtab
                     WHERE ( chkbox = 'X' ).
        ld_idx = syst-tabix.
        " Call your update function / method / perform
       ls_outtab-chkbox = space.
       MODIFY gt_outtab FROM ls_outtab INDEX ld_Idx
          TRANSPORTING chkbox.
      ENDLOOP.
    " And now trigger refresh of the ALV display:
      rs_selfield-refresh = 'X'.  " <<< !!!
    ENDFORM.
    Regards
      Uwe

  • Problems with check boxes

    I am trying to create a process Register jsp. At first, i use normal jsp method
    try
    //get all the checkboxes values from here     
    //chkno is used only to retrieve the number of checked checkboxes
         String chkno[] = request.getParameterValues("hobbies");
    //using a while loop to retrieve the value + execute it to the database.
    int i = 0;
    int Rs2;
    String statement; //sql statement
    Statement SL2 = Conn.createStatement();
    while (chkno!=null && i < chkno.length)
    //get the specific array item
         String hobbies = request.getParameterValues("hobbies");
    //set up database related area
         try
              statement = "insert into memhobby values ('"+memid+"','"+hobbies+"')";
              Rs2 = SL2.executeUpdate(statement);
                   catch(Exception ex)
                   out.println(ex);
    //increment the i counter
              ++i;
    SL2.close();
    catch(Exception e){
    out.println(e);
    this one to retrieve check boxes values and insert into database. it works
    after that, i created javabean for connection. dbConnection, and dbHobby, which will make use of dbConnection and insert values into database.
    So, i use this method
    try
    //get all the checkboxes values from here     
    //chkno is used only to retrieve the number of checked checkboxes
         String chkno[] = request.getParameterValues("hobbies");
    //using a while loop to retrieve the value + execute it to the database.
    int i = 0;
    while (chkno!=null && i < chkno.length)
    //get the specific array item
         String listhobbies = request.getParameterValues("hobbies")[i];
         int hobbies = Integer.parseInt(listhobbies);
    //set up database related area
         try
              dbHobby.setHobbyMemId(memID);
              dbHobby.setHobbyHobbyId(hobbies);
              dbHobby.insertHobby();
                   catch(Exception ex)
                   out.println(ex);
    //increment the i counter
              ++i;
    catch(Exception e){
    out.println(e);
    it should works the same, but the problem now i having is, only the first check box values will be insert. the loop seem not to work anymore. why is that so?
    can anyone please help me?

    try to initialize all you variable first before parsing any value to it.
    eg:
    String hobby= "";
    hobby = request.getParameterValues("hobbies")!=null?request.getParameterValues("hobbies"):"";
    the nullPointerException due to your field("hobbies") is null and cannot set into String datatype.
    This may help.

  • Problem with check-box

    Hi all,
    I am using flash CS3 and working on flash and ActionScript
    3.0.
    In a flash application(.swf file), I have "3
    images"(converted to movieclips) in 3 different layers, "a
    combo-box"(which displays a specific image upon selection in the
    combo-box) and "a check-box".
    The Functionality of Combo-box is: If we select an image
    from combo-box,then a specific image is viewed on output upon
    selection. Now, if we click on the image appeared, then there
    appears a circle(dot) on the image at (evnt.localX,evnt.localY)
    pixel position [I had written ActinScript 3.0 code for this task].
    This occurs for all the 3 layers(i.e., on selection of the 3
    images).
    The Functionality of Check-box is: If check-box is
    "selected", it shows dots(circles) and if "not_selected" no dots
    are visible(It means, it hides the dots /circles) on the specific
    image.
    " I think you had understood that---- dots/circles placed on
    one image should not be visible when other image is viewed".
    If I change the selection of combo-boxes (i.e., image is
    changed) and when the check-box is selected, then it is showing all
    the dots(circles) of all three images. But, it should show only the
    specific dots(circles) that are obtained when clicked on specific
    image(i.e., specific selection from combo-box).
    Here, instances of our application are as follows(These all
    are Movie-Clip instances):
    Say, for 3 images: mc_image, mc_image2, mc_image3.
    for combo-box: mc_Combobox.
    for check-box: mc_Checkox.
    Here, the functionality of Check-box is what i need. When we
    select the check-box,It must show only the
    dots/circles that are related to the image which is selected
    from combo-box.
    How to do this?
    I am new to flash and ActionScript 3.0. Please help me....
    Thanks in advance.
    Text

    Hi Srihari.Ch,
    I dont know how it should work for only one circle and not
    for others??
    because as per my understanding each time a circle is drawn
    the same code is going to execute so how can it skip the condition
    in the if block for second time onwards.....
    Let me know if there is an understanding gap in your code and
    me...
    Also as a second thaught you can attach the event listener
    for the MouseEvent.CLICK
    only when the check box is clicked... you can track this by
    using a change event for checkboxes
    so your code will be
    myCheckBox.addEventListener(Event.CHANGE, addClickEvent);
    function addClickEvent(evnt:Event)
    //here check and attach mouse event listener for click event.
    if(evnt.target.selected)
    //Consider that myImageHolderMovieClip is the movieclip where
    you //have loaded an Image
    myImageHolderMovieClip.addEventListener(MouseEvent.CLICK,
    drawAcircle);
    else
    myImageHolderMovieClip.removeEventListener(MouseEvent.CLICK,
    drawAcircle);
    Also if this doesn't solve your problem please send me your
    code [fla and AS3 files] on my mail ID [email protected] i
    will try and give the reply as soon as possible.

  • Problem In Check Box

    Hi All
    I have designed a form in screen painter which contains the employee details.
    I have kept two check boxes MALE and FEMALE with itemuid as chmale and chfemale.
    I wont to do some validation.
    It is check box so I can check both of them,so I need to do validation
    My code
    Case SAPbouiCOM.BoEventTypes.et_CLICK
    Try
    Select Case pVal.ItemUID
    Case "chmale"
    oCheckFemale = oForm.Items.Item("chfemale").Specific
    If oCheckFemale.Checked = True Then
    oCheckMale.Checked = True
    oCheckFemale.Checked = False
    End If
    Case "chfemale"
    oCheckMale = oForm.Items.Item("chmale").Specific
    If oCheckMale.Checked = True Then
    oCheckMale.Checked = False
    oCheckFemale.Checked = True
    End If
    End Select
    This is not working.
    SAP hangs up for some time.

    Hi Anto,
    I'm not sure but I think the Checked property of the check box, triggers a Click event. If so, your code is creating an infinite loop.
    Why don't you use two Option buttons grouped together. That way you don't need to code any verification.
    If  you're working with XML forms, you just need the following:
    <action type="add">
         <item uid="Radio1" type="122" left="132" tab_order="0" width="160" top="91" height="14" visible="1" enabled="1" from_pane="0" to_pane="0" disp_desc="0" right_just="1" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
         <AutoManagedAttribute></AutoManagedAttribute>
              <specific caption="Radio 1" AffectsFormMode="1" val_on="Y" val_off="N">
                   <databind databound="1" table="" alias="Radio"></databind>
              </specific>
         </item>
         <item uid="Radio2" type="122" left="132" tab_order="0" width="160" top="106" height="14" visible="1" enabled="1" from_pane="0" to_pane="0" disp_desc="0" right_just="1" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
         <AutoManagedAttribute></AutoManagedAttribute>
              <specific caption="Radio 2" AffectsFormMode="1" val_on="Y" val_off="N">
                   <databind databound="1" table="" alias="Radio"></databind>
              </specific>
         </item>
    </action>
    <action type="group">
         <item uid="Radio1"></item>
         <item uid="Radio2"></item>
    </action>
    By code, when you create the form, include this:
    oForm.Items.Item("Radio1").Specific.GroupWith ("Radio2")
    Regards,
    Vítor Vieira

  • Check box validation

    Hello all,
    I need to perform validations on text field. I have two check boxes and by checking any one or both of them, a combination of text fields appear. I want to write four validations and one of them is shown below. I just have the basic idea, can anyone help me in writing it the correct way and what validation method(sql, item not null, regular exp, etc) to select?
    BEGIN
    IF(check box 1 is checked and check box 2 is unchecked) THEN
    :P3_TEXT_FIELD_1 := required;
    :P3_TEXT_FIELD_2 := required;
    :P3_TEXT_FIELD_3 := null;
    END IF;
    END;
    thanks,
    Toopran

    Hello,
    Thanks for the suggestion. I am having the validation of the type function returning error text and this is the actual code that I am using in my application.
    BEGIN
    IF :P11_WRITING_OBJ_FLAG IS NULL AND :P11_LAB_SCIENCE_FLAG IS NULL THEN
    :P11_NOTE_4 := NULL;
    :P11_NOTE_5 := NULL;
    :P11_NOTE_6 := NULL;
    :P11_NOTE_8 := NULL;
    IF :P11_NOTE_1 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_2 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_3 IS NULL THEN
    return 'enter a value in the text field';
    END IF;
    END IF;
    IF :P11_WRITING_OBJ_FLAG IS NOT NULL AND :P11_LAB_SCIENCE_FLAG IS NULL THEN
    :P11_NOTE_1 := NULL;
    :P11_NOTE_2 := NULL;
    :P11_NOTE_3 := NULL;
    :P11_NOTE_8 := NULL;
    IF :P11_NOTE_4 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_5 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_6 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_7 IS NULL THEN
    return 'enter a value in the text field';
    END IF;
    END IF;
    IF :P11_WRITING_OBJ_FLAG IS NULL AND :P11_LAB_SCIENCE_FLAG IS NOT NULL THEN
    :P11_NOTE_4 := NULL;
    :P11_NOTE_5 := NULL;
    :P11_NOTE_6 := NULL;
    :P11_NOTE_7 := NULL;
    IF :P11_NOTE_1 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_2 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_3 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_8 IS NULL THEN
    return 'enter a value in the text field';
    END IF;
    END IF;
    IF :P11_WRITING_OBJ_FLAG IS NOT NULL AND :P11_LAB_SCIENCE_FLAG IS NOT NULL THEN
    IF :P11_NOTE_1 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_2 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_3 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_4 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_5 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_6 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_7 IS NULL THEN
    return 'enter a value in the text field';
    ELSE IF :P11_NOTE_8 IS NULL THEN
    return 'enter a value in the text field';
    END IF;
    END IF;
    END;
    :P11_WRITING_OBJ_FLAG IS NULL and :P11_LAB_SCIENCE_FLAG are the check boxes and P11_NOTE_1 to P11_NOTE_8 are the 8 text fields that I want to validate based upon which box is checked.
    I am getting this error when I enter some values in the text field and click on SAVE button:
    ORA-06550: line 70, column 4: PLS-00103: Encountered the symbol ";" when expecting one of the following: if The symbol "if" was substituted for ";" to continue. ORA-06550: line 70, column 22: PLS-00103: Encountered the symbol ";" when expecting one of the following: if The symbol "if" was substituted for ";" to continue. ORA-06550: line 70, column 73: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: begin case declare end exit for goto if loop mod null pragm
         Error      ERR-1024 Unable to run "function body returning text" validation.
    Please help.
    thanks,
    Toopran

  • Check box validation using Javascript

    Hi Everyone,
    I am using LiveCycle with my form that have multiple sections in the form that have questions that have a check box yes or  check box no next to it.  The user can either choose yes or no. Note: I am not using radio buttons.   I am looking for a Javascript function or code that when clicking a button I have set up as "regular" can check to see if a user selected either check boxes (yes) or check box (no) and validate that in that section the user has answered all question by selecting either yes or no.  Example; Section (1) has (5) questions with a yes or no check box next to each question.  I want to validate that the user selected 5 check boxes for this section (regardless if yes or no was answered for each)  if only 2 out od the 5 questions were answered with either yes or no.  I generate an error message. 
    I already have a function that searches the form and tells me how many manditory text fields have been left blank and throws an error.  I would like the check box function to be the same.  Any help would be appreciated.
    Thanks
    Jagan

    function validateCheckBox()
    if(document.TestJsp.BONUS.checked)
    return true;
    var len = document.TestJsp.BONUS.length;
    for(i = 0 ; i < len; i++)
    if(document.TestJsp.BONUS.checked)
    return true;
    return false;
    Sorry for the triple post. :=)

  • Checked box validation

    Hi All,
    I am using oracle Forms 10G on windows.
    I need help on how to validate that only one check box is checked in detail block. I have multiple records in the detail block and I have check boxes for each record in the detail block.
    I have a button to select the values from the detail records where the check box is checked. But I want to make sure that only one record is check not more than one.
    And How to move the cursor to the checked record if the focus or cursor is in an unchecked record.
    Thanks,

    One way would be to create a forms level variable (Global, Parameter item, Forms Package Specificaiton, etc) to record the record number of a checked record. Each time a user clicks a check box, you would check your variable to see if it is greater than 0. If its greater than zero then you know the user has already checked a check box and you know which record needs to be unchecked. Another option would be to just pop a message to the user to uncheck any checked records. I like the first option because it is more user friendly. Here is a code sample. I like using Forms Package spec variables because of they have a smaller memory footprint, but you can use a Block item, Parameter, Global, etc to record the record variable.
    /* Sample When-Checkbox-Changed trigger */
    DECLARE
       n_curr_record   NUMBER := 0;
    BEGIN
       IF ( Forms_Var.checked_record > 0 ) THEN
          n_curr_record := :system.trigger_record;
          /* Forms_VAR is a Forms Program Unit Package Specification */
          Go_Record(Forms_VAR.Checked_Record);
          :YOUR_BLOCK.YOUR_CHECKBOX_ITEM := 0;
          /* Assumes you are using 0 = unchecked and 1 = checked */
          Go_Record(n_curr_record);
          /* return to the current record */
       END IF;
    END;Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Problem with check Box in ALV list

    Hi All,
    In my alv list  I am using Check box and if I enabled the check box after pressing that pushbutton its not reflecting in the internal table how can I  resolve it. 
    Please find below the piece of codes
    FORM user_command USING ucomm    LIKE sy-ucomm
                                                 selfield TYPE slis_selfield.      
    sy-ucomm = ucomm.
      CASE ucomm.
      When 'SAVE'.
                I am checking my internal table value here.
               my logic....
      When others.
      Endcase.
    FORM FIELD_CATLOGUE  USING   VALUE(P_tname) "Int.table name
                                  VALUE(P_fname) "Field name
                                  VALUE(P_title) "Column name
                                  VALUE(P_sum)   "Sum
                                  VALUE(P_edit)  "Edit
                                  VALUE(P_Check). " Check box
      CLEAR wa_fcat.
      wa_fcat-tabname = p_tname.
      wa_fcat-fieldname = p_fname.
      wa_fcat-seltext_l = p_title.
      wa_fcat-do_sum    = P_Sum.
      Wa_Fcat-edit      = P_Edit.
      Wa_Fcat-checkbox  = P_Check.
      Append wa_fcat to i_fcat.
      gs_user_command     type slis_formname value 'USER_COMMAND'.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program = sy-repid
            it_fieldcat        = i_fcat
            is_layout          = ilay
            I_DEFAULT          = 'X'
            I_SAVE             = 'A'
            I_CALLBACK_PF_STATUS_SET  = gs_user_status
            i_callback_user_command  = gs_user_command
          TABLES
            t_outtab           = it_data
          EXCEPTIONS
            program_error      = 1
            others             = 2.

    Hi,
    Refer this program:-
    *  internal table and alv declarations
    *   with one field in internal table as
    *   flag(1) type c (for checkbox in alv)
    *          START-OF-SELECTION
    START-OF-SELECTION.
      "your select query to populate data in internal table
    *          END-OF-SELECTION
    END-OF-SELECTION.
    *          FIELD CATALOG FOR FIRST GRID DISPLAY
      PERFORM field_catalog.
    *          SORT W.R.T. WORK ORDER NUMBER FOR FIRST GRID DISPLAY
      PERFORM sort_field.
    *          FOR LAYOUT FOR FIRST GRID DISPLAY
      PERFORM set_layout.
    *          DISPLAY RECORDS IN ALV GRID FOR FIRST GRID DISPLAY
      PERFORM alv_display.
    *&      SUBROUTINE DEFINITIONS
    *&      Form  FIELD_CATALOG
    *       SUB-ROUTINE FIELD_CATALOG USED TO SET THE COLUMNS FOR
    *       THE ALV GRID (OUTPUT FORMAT)
    *       SETS THE COLUMN NAME AND THE OUTPUT LENGTH FOR THE FIELDS
    FORM field_catalog .
      wa_field-fieldname = 'FLAG'.   " name of field from internal table
      wa_field-tabname = 'IT_FINAL'. " internal table name
      wa_field-outputlen = 2.        " output length on screen
      wa_field-checkbox = c_check.   " print as checkbox
      wa_field-edit = c_check.       " make field open for input
      wa_field-seltext_l = ' '.      " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'AUFNR'.  " name of field from internal table
      wa_field-tabname = 'IT_FINAL'. " internal table name
      wa_field-outputlen = 20.       " output length on screen
      wa_field-seltext_l = text-003. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
    ENDFORM.                    " FIELD_CATALOG
    *&      Form  SORT_FIELD
    *       SUB-ROUTINE SORT_FIELD IS USED TO SORT THE RECORDS IN THE
    *       INTERNAL TABLE BASED ON THE GIVEN FIELD AND NATURE OF
    *       SORTING TO BE DONE (ASCENDING OR DESCENDING)
    FORM sort_field .
      wa_sort-spos = 1.             " sort priority
      wa_sort-fieldname = 'AUFNR'.  " field on which records sorted
      wa_sort-tabname = 'IT_FINAL'. " internal table name
      wa_sort-up = c_check.         " sort ascending
      APPEND wa_sort TO it_sort.    " append sort info internal table
      CLEAR wa_sort.                " clear sort info work area
    ENDFORM.                    " SORT_FIELD
    *&      Form  SET_LAYOUT
    *       SUB-ROUTINE SET_LAYOUT IS USED TO SET THE DISPLAY OF THE
    *       ALV GRID LINES IN ALTERNATIVE COLOURS
    FORM set_layout .
      wa_layout-zebra = c_check.    " so set colors of line alternatively
    ENDFORM.                    " SET_LAYOUT
    *&      Form  ALV_DISPLAY
    *       SUB-ROUTINE ALV_DISPLAY IS USED TO SET THE PARAMETERS
    *       FOR THE FUNCTION MODULE REUSE_ALV_GRID_DISPLAY
    *       AND PASS THE INTERNAL TABLE EXISTING THE RECORDS TO BE
    *       DISPLAYED IN THE GRID FORMAT
    FORM alv_display .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = v_rep_id       " report id
         i_callback_pf_status_set          = 'PF'           " for PF-STATUS
         i_callback_user_command           = 'USER_COMMAND' " for User-Command
         is_layout                         = wa_layout      " for layout
         it_fieldcat                       = it_field       " field catalog
         it_sort                           = it_sort        " sort info
        TABLES
          t_outtab                          = it_final      " internal table
       EXCEPTIONS
         program_error                     = 1
         OTHERS                            = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " ALV_DISPLAY
    *&      Form  pf
    *       SUB-ROUTINE PF IS USED TO SET THE PF-STATUS OF THE SCREEN
    *       ON WHICH THE ALV GRID IS DISPLAYED
    *       -->RT_EXTAB
    FORM pf USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZTG_STAT'.
    ENDFORM.                    "pf
    *&      Form  USER_COMMAND
    *       SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
    *       AND EXECUTE THE APPROPIATE CODE
    *      -->LV_OKCODE   used to capture the function code
    *                     of the user-defined push-buttons
    *      -->L_SELFIELD   text
    FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
    * assign the function code to variable v_okcode
      lv_okcode = sy-ucomm.
    * handle the code execution based on the function code encountered
      CASE lv_okcode.
    * when the function code is EXECUTE then process the selected records
        WHEN 'EXECUTE'.
    * refresh it_process when user processes selected records
          REFRESH it_process.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    * refresh the ALV Grid output from internal table
          l_selfield-refresh = c_check.
        WHEN 'SEL_ALL'.
    * to select all the records displayed in ALV Grid
          LOOP AT it_final INTO wa_final.
            wa_final-flag = 'X'.
            MODIFY it_final FROM wa_final.
          ENDLOOP.
    * refresh the ALV Grid output from internal table
          l_selfield-refresh = c_check.
        WHEN 'DESEL_ALL'.
    * to deselect all the records displayed in ALV Grid
          LOOP AT it_final INTO wa_final.
            wa_final-flag = ' '.
            MODIFY it_final FROM wa_final.
          ENDLOOP.
    * refresh the ALV Grid output from internal table
          l_selfield-refresh = c_check.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    Hope this helps you.
    Regards,
    Tarun.

  • Problem with check box in ALV Grid Display

    I am Displaying Material Master Data in ALV Grid Display with Check Box for each record and if i checked check box then i am processing Update operation in Database,  my question is after perform update operation check box should be clear.
    Kindly help me!!!!

    Hello Raj
    Given the fact that you do not tell us the most important piece of information (namely whether you are using OO-based ALV or not) I assume you are using fm-based ALV lists.
    In this case you probably have defined a USER_COMMAND routine as described in the documentation of the fm.
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
    * define local data
      DATA: ls_outtab  LIKE LINE OF gt_outtab,
                ld_idx       TYPE i.
      LOOP AT gt_outtab INTO ls_outtab
                     WHERE ( chkbox = 'X' ).
        ld_idx = syst-tabix.
        " Call your update function / method / perform
       ls_outtab-chkbox = space.
       MODIFY gt_outtab FROM ls_outtab INDEX ld_Idx
          TRANSPORTING chkbox.
      ENDLOOP.
    " And now trigger refresh of the ALV display:
      rs_selfield-refresh = 'X'.  " <<< !!!
    ENDFORM.
    Regards
      Uwe

  • Emtpy check box  validation in javascript

    Friends I want to validate check boxes thru javascript,but I can do it if only one checkbox is there,but my requirement is to tell the page that it is alright even if one checkbox out of many is checked.Please tell me how to do it.
    Thanks
    MS
    <SCRIPT>
    function onSave() {
    (document.TestJsp.BONUS.checked)?
    alert("The box is checked"):
    alert("The box is not checked")
    </SCRIPT>
    <TR>
    <TD>
    <INPUT TYPE="CHECKBOX" NAME ="BONUS" VALUE="1" >
    </TD>
    </TR>
    <TR>
    <TD>
    <INPUT TYPE="CHECKBOX" NAME ="BONUS" VALUE="2" >
    </TD>
    </TR>
    <TR>
    <TD>
    <INPUT TYPE="SUBMIT" NAME ="SUBMITBUTTON" VALUE="1" onClick="onSave()">
    </TD>
    </TR>

    function validateCheckBox()
    if(document.TestJsp.BONUS.checked)
    return true;
    var len = document.TestJsp.BONUS.length;
    for(i = 0 ; i < len; i++)
    if(document.TestJsp.BONUS.checked)
    return true;
    return false;
    Sorry for the triple post. :=)

Maybe you are looking for

  • Mp3 device not showing up in finder

    Hi Anyone. I have recently converted over to MAC. Really happy so far. Everything that i used on my PC has come over fine cameras etc. But i have a Samsung mp3 player. I know that itunes does not use anything other than ipod so i was hoping to just d

  • Global Variants- can you restrict them?

    I know that in finance you can control who has access to global variants by an authorization object.  However, with the rest of the modules (mainly PM, MM) how do you restrict the global variants so they can not be edited?

  • Epson Stylus Color 1280 not printing with Mac OS X 10.6.8

    I have an Epson Stylus Photo 1280 printer (driver - Apollo P-2100 - Gutenprint v5.2.3) and am running on Mac (OSx 10.6.8) It WAS working but recently.... I changed the ink cartridges and it powers up with green light on. Once I try to send a job to t

  • Get-AdUser and a other domain

    I'm having problems running a script to search all accounts on a Domain. I want to be able to switch domain choices Current script is: Import-Module activedirectory Get-ADUser -Filter * -Properties * | Select-Object Name,LastLogonDate | export-csv C:

  • Zen Micro and Vista? - Sol

    I am trying to get my Zen Micro (DAP-MD0004) to work with Vista to no avail. It is loaded with the latest firmware (PlaysForSure - I dont think so!!!) and Vista picks it up and installs the driver no problem.However, if I try to view music through My