Help on validation

hey guyz!
i have a requirement.....
in one enhancement i have added some 7 fileds with check boxes in a screen of which 1 must be checked while creating WBS.
if niether of them is checked we have to throw a message.
1) my Q is how can we check that 1 of them is checked of not???
after some of them has been checked.....we have to transfer those checked flields to the corresponding table...
now.....wud  "move corresponding" wud do for transfering checkboxes???
please help me with coding....m a beginner..
reg
zid.

Hi,
Use the below code.
PARAMETERS: p_chk1 AS CHECKBOX,
            p_chk2 AS CHECKBOX,
            p_chk3 AS CHECKBOX,
            p_chk4 AS CHECKBOX,
            p_chk5 AS CHECKBOX,
            p_chk6 AS CHECKBOX,
            p_chk7 AS CHECKBOX.
DATA: v_flag TYPE c,
      v_count TYPE i.
DATA: BEGIN OF wa,
      chk1,
      chk2,
      chk3,
      chk4,
      chk5,
      chk6,
      chk7,
      END OF wa.
AT SELECTION-SCREEN.
  MOVE p_chk1 TO wa-chk1.
  MOVE p_chk2 TO wa-chk2.
  MOVE p_chk3 TO wa-chk3.
  MOVE p_chk4 TO wa-chk4.
  MOVE p_chk5 TO wa-chk5.
  MOVE p_chk6 TO wa-chk6.
  MOVE p_chk7 TO wa-chk7.
  DO 7 TIMES VARYING v_flag FROM wa-chk1 NEXT wa-chk2.
    IF v_flag = 'X'.
      v_count = v_count + 1.
    ENDIF.
  ENDDO.
  IF v_count IS INITIAL.
    MESSAGE 'Please check at least one check box' TYPE 'E'.
  ENDIF.
<b>Second Method:</b>
If you want to know which are check boxes are checked
then use the below code
PARAMETERS: p_chk1 AS CHECKBOX,
            p_chk2 AS CHECKBOX,
            p_chk3 AS CHECKBOX,
            p_chk4 AS CHECKBOX,
            p_chk5 AS CHECKBOX,
            p_chk6 AS CHECKBOX,
            p_chk7 AS CHECKBOX.
DATA: v_flag TYPE c,
      v_count TYPE i.
DATA: begin of itab occurs 0,
       count type c,
      end of itab.
DATA: BEGIN OF wa,
      chk1,
      chk2,
      chk3,
      chk4,
      chk5,
      chk6,
      chk7,
      END OF wa.
AT SELECTION-SCREEN.
  MOVE p_chk1 TO wa-chk1.
  MOVE p_chk2 TO wa-chk2.
  MOVE p_chk3 TO wa-chk3.
  MOVE p_chk4 TO wa-chk4.
  MOVE p_chk5 TO wa-chk5.
  MOVE p_chk6 TO wa-chk6.
  MOVE p_chk7 TO wa-chk7.
  DO 7 TIMES VARYING v_flag FROM wa-chk1 NEXT wa-chk2.
    IF v_flag = 'X'.
      v_count = v_count + 1.
      itab-count = sy-index.
      append itab.
      clear itab.
    ENDIF.
  ENDDO.
  IF v_count IS INITIAL.
    MESSAGE 'Please check at least one check box' TYPE 'E'.
  ENDIF.
start-of-selection.
loop at itab.
write:/5 itab-count, 12 'Check box checked'.
endloop.
Message was edited by:
        Velangini Showry Maria Kumar Bandanadham

Similar Messages

  • Newbie help please:  "Validation of XML file failed."

    Hopefully my question is short and easy.
    I'm a developer and haven't used FrameMaker before. However for unforeseen reasons, I've inherited our technical help documentation constructed in FrameMaker which I've never used. Unfortunately I'm under a very tight deadline and I'm attempting to update our already existing and fairly extensive application help files.
    However, I'm getting a "Validation of XML file failed" error for 90% of our .xml help docs. I opened our .book file in FrameMaker fairly easily, and can see all of our .xml files. However the variables already embedded in the documents aren't being recognized and seem to be causing the above error. I've located our variable definition files (xml) in the concepts folder, but FrameMaker doesn't seem to recognize them. Any suggestions on what I can check or how I can get FM to refer to the variable definitions? I'm working with a new installation of FM, is there some setup I overlooked?
    Many thanks,
    dana.

    Sheila and Rick,
    Thank you both so much for your offer of help. My apologies for not replying earlier. Other 'emergencies' and priorities at work took me in other directions. It turns out another solution has been found for the time being. But thank you again for your replies. They say a lot about this community and its support. :)
    Thanks again,
    dana.

  • Need help in Validation of Network no.

    Hello, I am doing one enhancement.The report is for Post Travel and Living (T/L))Expense to G/L.
    Right now there are two scenarios. In first, Interface can book the expense in natural account (travel/meal etc.)to the cost center.
    In other scenario, it books a credit to a cost center in a separate account and debits the network on a billable T & L account.
    In the event if the network is invalid I have to handle the error.
    I need the help from experts. How can network be valid or invalid? Is it any FM for it or Table for it?
    Thanking in anticipation.
    Warm Regards,
    Harish

    Hi,
    I guess that you are talking about netwrok from PS module. In that case you can use BAPI BAPI_NETWORK_EXISTENCECHECK to check if network exists.
    Cheers

  • Help with validation on a manually created tabbed form

    version 4.1.1.00.23
    Hello,
    I have a manually created tabbed form that I'm having trouble creating validation on.
    The page is a Resource Staffing page where PM's can forecast the Resources that will be needed for various projects. The forecast can be for 12 - 18 months.
    The requirement is to display a message to the user if they are trying to save a row without forecasting any time. It's possible they may not know how may Resources or the length of time needed when the row is created.  If they respond that they want to save the row without time the MRU will create the record. If they answer that they do not want to save the row they are returned to the page without loss of information.
    The month fields on the page are defaulting to 0 (zero).
    I've updated the Save button to Redirect to URL and in the URL Redirect I have: javascript:confirmNoTimeSaved()
    The javascript:
    [code]
    function confirmNoTimeSaved()
        var arr_jan,arr_feb,arr_mar,arr_apr,arr_may,arr_jun,arr_jul,arr_aug,arr_sep,arr_oct,arr_nov,arr_dec = new Array();
            arr_jan = document.wwv_flow.f07;
            arr_feb = document.wwv_flow.f08;
            arr_mar = document.wwv_flow.f09;
            arr_apr = document.wwv_flow.f10;
            arr_may = document.wwv_flow.f11;
            arr_jun = document.wwv_flow.f12;
            arr_jul = document.wwv_flow.f13;
            arr_aug = document.wwv_flow.f14;
            arr_sep = document.wwv_flow.f15;
            arr_oct = document.wwv_flow.f16;
            arr_nov = document.wwv_flow.f17;
            arr_dec = document.wwv_flow.f18;
        for(i = 0; i < arr_jan.length; i++)
            if(arr_jan[i].value == 0 && arr_feb[i].value == 0 && arr_mar[i].value == 0
                && arr_apr[i].value == 0 && arr_may[i].value == 0 && arr_jun[i].value == 0
                && arr_jul[i].value == 0 && arr_aug[i].value == 0 && arr_sep[i].value == 0
                && arr_oct[i].value == 0 && arr_nov[i].value == 0 && arr_dec[i].value == 0)
                txt = 'You have no time assigned to your Forecast. Do you want to save this Forecast without time entered?' + '\n' + '\n' + '"Yes" to save the Forecast.' + '\n' + '"No" to return with no changes.';
                caption = 'Confirm Saving With No Time';
                vbMsg(txt,caption)
                switch (isChoice)
                    case 6:
                        doSubmit('SUBMIT');
                        break;
                    case 7:
                        doSubmit('CANCEL2');
                        break;
            else
                doSubmit('SUBMIT');   
                break;
    </script>
    <script language="VBScript">
    <!--
    //Yes    = 6
    //No     = 7
        Function vbMsg(isTxt,isCaption)
            testVal = MsgBox(isTxt,vbYesNo,isCaption)
            isChoice = testVal
        End Function
    //-->
    </script>
    [/code]
    The 'CANCEL2' is just a Branch I'm using to branch back to the page without clearing Cache. I do have 'Cancel' button on the page and the Branch created for that clears the Cache.
    While debugging the javascript I get into the VB Script on the testVal = MsgBox(isTxt,vbYesNo,isCaption) line and the browser crashes.
    Can someone help with this requirement?
    What additional information can I provide?
    Thanks,
    Joe

    The code above is my attempt at this requirement, however, the browser crashes when it gets to the VBScript on the MsgBox call. I don't have to use this approach. Does someone have an idea how to solve this?
    Thanks,
    Joe

  • I need help with validating signatures.

    I have Adobe Acrobat X and Reader 9 and need help with how to validate signatures.
    I have a document that I am emailing to all employees that require the signature; but, when the form is emailed back, it states that the signatures requires validating.

    Or, is the validation something I do once the form is emailed back to me?
    I guess a subquestion would be, how to establish/manage trusted certificates with reader or acrobat 8. 

  • Need help with validation of SSNumber in ESS US Personal Data WebDynpro app

    Hi,
       We're using ESS /SAP Netweaver 2004....
    When I make the Soc Sec#  visible (changing the Java webdynpro app ess.us.fam the dependents update form in ESS) and trying to make this field not mandatory, I get strange results...
    The Gender field that was mandatory before is now not treated as Required after I select the Review button, but this SSN Text that I made visible is treated as Mandatory with a Red box saying This field is required....
    I guess the Required (state) attribute in the InputField properties is only for showing the red asterisk, but the actual mandatory logic is done somewhere else???..Is this somewhere in the webdynpro app or in the SAP backend...
    This app uses the structure HCMT_BSP_PA_US_R0021...
    Can anyone point me to where this validation is done so I can change it to what I need,
    Thanks,
    Venkatesh

    Hello ,
    I am working on EP7.0 ERP05 NW04s . I want to make the Social Security Number field mandatory on the Family Members Detail (Edit) , ...I want to know what's the procedure to do that...
    Any help would be highly appreciated.

  • Help in Validation

    Hi Experts,
    I have a strange issue and I am not sure why it happens.
    Here is an example:
    I have a WBS 1000 (for which we have cost center 1000 assigned) in master data assigned to company code X
    When I post a document in company code Y, if I enter both WBS 1000 and cost center 1000 in line item of the document, system does not show any error and document is getting posted.
    What I need is system should show an error that cost center / WBS does not belong to company code Y.
    (Here, Co code X and Y have same chart of accounts and controlling area)
    I am not sure as to why it happens as I feel standard SAP should not allow account assignments of other co codes to be assigned.
    So now I would like to write a validation so that system checks document co code and compares with company code of cost objects (like cost center, internal order, WBS) and show system should an error message.
    Could some one help me in writing the boolean logic for this.
    Thanks,
    SD

    Hi,
    That's a definition made on Controlling area level (OKKP transaction). It's called 'Cd Validation'; if the flag is not set, then there is no validation for this point and posting in company code X could be done on cost objects from company code Y, assuming that these company codes belong to the same CO area.
    So, if you want to avoid this situation, the flag has to be set.
    Regards,
    Eli

  • Help setting validation based on route selected

    If the LC form only has one submit button, how do you set a validation on submit based on the route selected when running forms in workspace?
    For example, if users have the option to Approve or Reject a form, can you determine which route they have selected and validate fields accordingly? So that if "reject" is selected we can validate that the reject comment field was completed, and if "approve" is selected we can validate that the form was signed?  Is there some property of the submit button or process field that makes this distiction?
    Thanks for your help!

    You can use a JavaScript if-else statement on the preSubmit event of the button. Do a check to see which of the fields are populated, then perform the required action.
    You could even hide the buttons, then if the user fills in a comment in the reject field, you simply show the reject button and keep the approve button hidden. You could have a pop-up when the form opens informing the user of the document's steps / process.

  • Help with Validation Problem Please

    I don't understand this validation and don't know how to fix it. I have checked my other websites and they seem fine. I don't think I have done anything different The link for the website ishttp://www.greenpatchwebsites.com/pow/index.html
    and the validator is http://validator.w3.org/check?uri=www.greenpatchwebsites.com%2Fpow%2Findex.html&charset=%2 8detect+automatically%29&doctype=Inline&group=0
    Please can you help.
    Thank you very much in advance.

    Thanks for that. I have tried it on a new page: http://www.greenpatchwebsites.com/pow/newtest.html and here is the validator :
    http://validator.w3.org/check?uri=www.greenpatchwebsites.com%2Fpow%2Fnewtest.html&charset= %28detect+automatically%29&doctype=Inline&group=0&No200=1- unfortunately loads of errors
    I also tried the recommended template:
    Use the following markup as a template to create a new XHTML 1.0 document using a proper DOCTYPE. See the list below if you wish to use another document type.
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
         <title>An XHTML 1.0 Strict standard template</title>
         <meta http-equiv="content-type"
              content="text/html;charset=utf-8" />
         <meta http-equiv="Content-Style-Type" content="text/css" />
    </head>
    <body>
         <p>… Your HTML content here …</p>
    </body>
    </html>
    but was getting errors with that. As you can tell, I need serious help with this. Which doc type should I be using
    and why doesn't Dreamweaver just do it for you when you select one?
    Thanks very much again in advance.

  • Can anyone help on Validations

    Hi SDNers,
    I am facing a problem with validations.
    Here is my requirement.
    I had a field (Phone Number). In that business will enter either Lanline Number ot Mobile Number.
    Ex - 0444 12345678 or 044 12345678 These are land line numbers.
    ex:- Mobile numbers : 1234567891.
    Here I need a validatin in this way.
    1) First we need to check is NUL or not.
    2) Then the phone shold not start with other than 0 or 1.
    3) If its starts with 1 then there should not be a Space between those numbers.
    4) If Landline number starts with 0 we need to check area code first 4 digits or 3 digits and space than phone number.
        Ex -  0444 12345678 or 044 12345678. (We need to check phone number is in this format or not)
    Any Help?
    Thanks
    Kiran

    Hi,
    This is working. Just paste this
    IS_NOT_NULL(Phone Number) AND LEFT(Phone Number,1)<=1 AND IF(LEFT(Phone Number,1)=1,ABS(Phone Number)=Phone Number) AND (IF(LEFT(Phone Number,1)=0,LEN(ABS(Phone Number))=2 OR IF(LEFT(Phone Number,1)=0,LEN(ABS(Phone Number))=3))
    And If you want to avoid more than one space between the number( Example: 044 123 45678)
    Paste this:
    IS_NOT_NULL(Phone Number) AND LEFT(Phone Number,1)<=1 AND IF(LEFT(Phone Number,1)=1,ABS(Phone Number)=Phone Number) AND (IF(LEFT(Phone Number,1)=0,LEN(ABS(Phone Number))=2 OR IF(LEFT(Phone Number,1)=0,LEN(ABS(Phone Number))=3)) AND IF(LEFT(Phone Number,1)=0,ABS(RIGHT(Phone Number,LEN(Phone Number)-LEN(ABS(Phone Number))-2)) = RIGHT(Phone Number,LEN(Phone Number)-LEN(ABS(Phone Number))-2)))
    Regards
    Goutham Kanithi
    Reward Points if helpful

  • Need help creating valid XHTML statement

    Hi -
    This is for a homework assignment that requires valid XHTML (I have to validate the dynamically generated HTML). Everything is great with the servlet except the statements where I "echo" the user input.
    The user inputs several values (loan calculator servlet), hits submit and if the values are valid inputs, the servlet returns the amount of the monthly payment. It also displays the inputs in case the user wants to change one of them (loan amount, interest rate or term of the loan).
    The servlet output is fine but my problem is in validating the html. The W3C validator shows an error on the lines where I'm echoing the original inputs.
    Here's my code that generates the html:
    out.println("<td><input type=\"text\" name=\"amount\" value=" + amount + "><br/></td>");Here's the html line that is output:
    <td><input type="text" name="amount" value=783745.43><br/></td>For this to be valid XHTML, the value needs to be in quotes. For example, that parameter should be value="783745.43".
    This is the error that the validator produces:
    Error Line 16 column 43: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.
    <td><input type="text" name="amount" value=783745.43><br/></td>The 'shorttag' and 'omittag' make no sense to me; I haven't found a decent reference yet on how to use them.
    I've tried multiple combinations of escape sequences but have had no success. Can anybody point out what I'm overlooking?
    Thanks in advance.

    I have understand about the SQL statement.
    My problem is like this. I have 3 variable. I have a table with 3 field.
    How can I use those variable to reftrieve value from my select statement?
    How can I use those variable to send value to my update or insert statement?
    sample statement:
    - select F1, F2, F3 from T where F1 = V1
    - insert into F1, F2, F3 values(V1, V2, V3)
    please help, I'm working on my final project in college.
    Thanks before.
    "Sweet devil is still as sweet as ever..."

  • Help with validation expression

    I could really use some help. The following validation item works. It keeps new records from being submitted when the p1_units field is greater than 10.
    if v('p1_units') <= 10 then
    return null;
    else
    return 'test';
    end if;
    This is not what I want though. What I want is to use the following in place of where I have the 10.
    select s1 - s2 from
    (select sum(units) s1 from units_avail where trunc(add_date) <= trunc(sysdate) and model = '56478') t1,
    (select sum(units) s2 from orders where model = '56478') t2
    This sql statement is used else where in the application and it returns the current count of unit available by summing of the total of all orders and subtracting that from the total of all inventory receipts.
    Thanks in advance.

    Hi,
    If I understood your post correctly this PL/SQL procedure would help:
    DECLARE
    v_number NUMBER(5);--select precision and scale according to your task
    BEGIN
    select s1 - s2 into v_number
    from
    (select sum(units) s1 from units_avail
    where trunc(add_date) <= trunc(sysdate) and model = '56478') t1,
    (select sum(units) s2 from orders where model = '56478') t2;
    if v('p1_units') <= v_number then
    return null;
    else
    return 'test';
    end if;
    END;
    Val

  • URGENT HELP ON VALIDATION

    Hi,
    <b>How to validate the character field in screen ?
    And how can I display an error message when i enter  number instead of charater ?</b>
    NOTE : book_ name should accept only characters.. but not integers
    Please reply me ASAP.
    Thanks,
    Shiva shekar k

    Hi Shiva ,
       there are two methods you can validate for character fields in your screen .
    method 1 , declare your screen field as char only and the system will do the auto validation for you .
    method 2 ,
        you can use a condition like  scr-field  consists of only SY-ABDC field or not .
    check sy-subrc value and of SY-SUBRC NE 0 then check raise a message ...
    Reward if helpful !
    Regards,
    Ranjita

  • Help with validations...

    Hello,
    I am new to Oracle APEX and hope that someone in this Forum can help me with my problem.
    I have one report from, which shows me data. If I click on a button, I can create a new data set. My primary key is generated by two data fields, let's say number1 and number2 are together the primary key.
    Now if I create a new data set and select a number for 1 and 2 which is already in the data set, I of course, get an error message. My question is, how I can "warn" the user that the numbers he wants to use are already in the database?
    I hope this picture helps understanding my problem:
    !http://img682.imageshack.us/img682/1985/imageqj.jpg!

    Hi,
    Normally the Apply Changes button would be conditional on hidden page items having values - typically, these would be the primary keys on the table. If these values are NULL, then the Create button would be visible instead.
    As these two items are going to become the primary keys on the table, then, as soon as the page is submitted (which is what happens when the Create button is clicked on the form), then the values are stored in the session and the condition, which is checked when the page reloads, will see them as non-NULL and therefore displays the Apply Changes button.
    You can get around this by having another hidden page item on the form. Call this, say, P4_OK. When you click the Edit button on a row on page 2, make sure that P4_OK is set to 1. When you click the create button, make sure that it is set to 0. Then, update your page 4 Create button's condition to P4_OK being equal to 0 and the Apply Changes button's condition set to P4_OK being equal to 1. If the branches that are triggered by these buttons return you to page 2, then that is all that you need to do (though I always clear the cache for the form page when I branch away from it, so you might want to enter 4 into the Clear Cache setting on both branches). If, however, you stay on page 4, then the branch that is triggered by the Create button needs to set P4_OK to 1 as you will have a valid record on the page by the time the branch is called (validation errors will not trigger the branch so P4_OK will stay at 0 if the two PK values already exist in the table)
    Andy

  • Help with validation errors

    I have an employment app in PHP that was written by someone else.  When run through the validator it had 900 errors.  I have rewritten the app and have a few errors I don't know how to fix (I am unfamiliar with PHP).  The employment app can be found here:  http://preview.stpha.org/applyonline.php.  Also there is a file "sentapp.php" that sends file to an email box.
    Here are the errors I don't understand:
    1.  Line 462, Column 29: there is no attribute "onSubmit"
    <form name="stpha" onSubmit="return makeAlert('Employment Application- Errors',…
    2.  Line 656, Column 71: there is no attribute "onClick"
    …" name="relation" value="Yes" onClick="showRel((document.getElementById('relat…
    3.  Line 2665 (2679 & 2673), Column 85: character "[" is not allowed in the value of attribute "id"
    …to upload: <input name="uploadedfile[]" type="file" id="uploadedfile[]" /></td>
    4.  Line 2669 (& 2673), Column 76: ID "uploadedfile[]" already defined
    …to upload: <input name="uploadedfile[]" type="file" id="uploadedfile[]" /></td>
    Thanks for any help you can provide.

    Not sure about the second two, but the first two are showing up as errors  because of the capital letters.
    Under your current doctype, onClick & onSubmit should be onclick & onsubmit.

  • Need help on validation of inputted text

    Hi there. I got the following script for the format of an inputted number (7 numeric char). If entered as "1", the format will be changed to "0000001". Now I want to get this effect: if entered as "f1", the format will be changed to "F000001". How can I modify the script to achieve that? Thanks.
    if (!(this.isNull)) {
    var tf = this.rawValue;
    if (tf < 1 ) {
    xfa.host.messageBox("The number must be a numeral starting from 1.","Incorrect Number",1);
    xfa.host.setFocus("TextField27"); }
    if (tf.length < 7) {
    var diff = 7 - tf.length;
    for (var i=0;i < diff;i++) {
    tf = "0" + tf;}
    this.rawValue = tf;}
    var regExp = /\d{7}/;//}
    if (!(regExp.test(tf))) {
    xfa.host.messageBox("The number must be in the format of 9999999.","Validation",1);
    this.rawValue = "";
    xfa.host.setFocus("TextField27");}}

    How about this, where TextField27 has a max length of 7?
    if (!(this.isNull)) {
              var str = this.rawValue;
              var regExp = /\D/;
              if (regExp.test(str)) {
        xfa.host.messageBox("...must contain numbers only.");
              else {
        var diff = 6 - str.length;
        for (var i=0; i < diff; i++) {
          str = "0" + str;
        this.rawValue = "f" + str;
    Steve

Maybe you are looking for