How to validate user input field?

I need to validate a user input field against a table. This field is not part of an EO but is used to update an attribute on an existing EO.
My question is, where would I place the sql that would validate the user input value against the table?
Is there an easy way to do this?
I'm at a roadblock and really need some help. Thank you.

You can execute a sql query or a function from <your>AMImpl.java, using normal jdbc.
but I would recommend this, it is easier and cleaner approach
1. Create a VO (<your>VO) with the sql statement
Select client
from client_table
where resp_id = :1
and client= :2
2. Add this vo to the am
3. In AMImpl, get handle to the VO (this.get<your>VO1)
4. Bind params
this.get<your>VO1().setWhereClauseParams(0,current_resp );
this.get<your>VO1().setWhereClauseParams(1,user_input_value);
5. Execute the query
this.get<your>VO1().executeQuery();
6. Get the row after the query is executed
oracle.jbo.Row <your>Row = this.get<your>VO1().first();
7. Get the value of the attribute from the row
l_client = <your>Row.getAttribute("Client") ;
8. So now you have what you wanted to do with the sql.
Thanks
Tapash

Similar Messages

  • How to validate the input field

    Hi,
    I have a input form which is draged from input port of a RFC.
    in this input form i have two input fields nad submit button.
    on of this input field should always take the character values only. it should not take any numeric value
    and other input field should always take numeric value only.
    i.e how to validate this two input fields.
    regards
    srinivas

    Hi,
    U can validate input fields using javascript.Write OnClientClick function for that submit button if ur using htmlb or onClick if u r using html.Refer the follows
    http://help.sap.com/saphelp_nw70/helpdata/en/03/900e41a346ef6fe10000000a1550b0/frameset.htm
    There are two ways to achieve ur task.
    1.By checking for all alphabets.in this u need check all the alphabetic characters one by one.Refer the following
    http://www.shiningstar.net/articles/articles/javascript/javascriptvalidations.asp?ID=ROLLA
    http://www.shiningstar.net/articles/articles/javascript/checkNumeric.asp?ID=AW
    2.By using regular expressions.its very easy and a single line code.here u need to specify single expression for whole alphabets.Refer this
    http://aspzone.com/blogs/john/articles/173.aspx
    Everything has been given for validating in javascript.i hope u also validating in javascript only.
    For more details on "Regular expressions" search google.
    Regards,
    Tamil K

  • How to validate user input

    Hi,
    I am new to Form design
    I am designing an offline form I just want to validate the user input
    whether user has entered Character or Numric.
    if user enters characters in phone no I have to give an error message.
    can you please give the pice of the script to validate the user input.
    Regards
    Bikas

    Instead of finding what is the type of input, you can restrict the user not to type characters in Phone No field.
    Place the below code in Change event of the Phone No field with Java Script as language. 
    // restrict entry to digits
    if (xfa.event.change.match(/[0-9]/) == null)
         xfa.event.change = "";
    Note: You have placed the question in the wrong forum.. You might need the Designer ES forum.
    Thanks
    Srini

  • Captivate 6 How to validate user input without using keyboard shortcuts

    I've been using Adobe Captivate 6 for about 4 months now.  Completely new to the program.  The number one function of Captivate for me will to create many software simulations for verifiable training.  This means that I will be utilizing the training and assessment modes A LOT.  I have run into many hurdles throughout the process, but one of my biggies right now is this:
    In the training and assessment modes, I have times where the user must input data such as an address or number.  In the actual software they will be utilizing it is not always required to use TAB or ENTER in order to move to the next field.  In some instances, it will be necessary to actually click into a field after entering data.  My problem is that it seems as if Captivate will not allow this,  as a keyboard shortcut is automatically entered even if a TAB or ENTER is not required after input.  I assume this is so that the inputted information can be verified.  If you decide you do not want to use a keyboard shortcut to validate the inputted information, you must have a submit button.  Is there any way to change this??  All I want is for the user to enter information and then click into another field WITHOUT having to press ENTER, TAB, or hit a submit button.  Is this even possible if you need user input to be validated??  Any ideas or suggestions would be much appreciated!!

    Hello,
    A while ago I explained the work flow I’m using often in that case, only for the last field you need to have either a shortcut or a submit button AND the sequence has to be imposed. The idea is that you make the Submit button for the first field transparent, delete the  ‘Submit’ text and put it over the second field. So if the user clicks on the second field, he also submits the value of the first field.
    Here is the blog post I’m referring to:
    http://lilybiri.posterous.com/one-submit-button-for-multiple-text-entry-box
    Although it was written for previous versions, the idea will still be functional.
    Lilybiri

  • How to validate user inputs against checktables

    Hi all,
    how to validate userinputs for s_bukrs and s_hkont  against respective check tables(t001 and skb1).
    can u pl zprovide me codeing for this validations.
    very urgent.
    thanks in advance
    swathi

    Hi
    Write the report
    REPORT ZREPORT.
    tables: t001,skb1,
    select-options: s_bukrs for t001-bukrs,
                           s_hkont for skb1-saknr.
    AT SELECTION-SCREEN.
    Validate the screen fields
      PERFORM validate_screen.
    *&      Form  validate_screen
    Validation of Selection Screen fields
    FORM validate_screen .
    Validation of Company code
      CLEAR t001-bukrs.
      IF NOT s_bukrs[] IS INITIAL.
        SELECT bukrs UP TO 1 ROWS
            INTO t001-bukrs
            FROM t001
            WHERE bukrs IN s_bukrs.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e000 WITH 'Company code'(002).
        ENDIF.
      ENDIF.
    Validation of Account Number
      CLEAR skb1-SAKNR.
      IF NOT s_SAKNR[] IS INITIAL.
        SELECT SAKNR  UP TO 1 ROWS
            INTO skb1-SAKNR
            FROM skb1
            WHERE SAKNR IN s_SAKNR and
                         bukrs    in S_BUKRS.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e000 WITH 'Invalid Account Number'(003).
        ENDIF.
      ENDIF.
    ENDFORM.
    Reward points if useful
    Anji

  • How to validate the input field data in VC using RFC FM

    HI,
    Could any body please give me the solution for the following issue?
    When ever I enter a value in the input field of an iView, this value has to be validated from the backend BW system.  Is this validation is possible using RFC function module?
    If yes, please explain me.

    Hi Deepak,
    U can validate input fields using javascript.Write OnClientClick function for that submit button if ur using htmlb or onClick if u r using html.Refer the follows
    http://help.sap.com/saphelp_nw70/helpdata/en/03/900e41a346ef6fe10000000a1550b0/frameset.htm
    There are two ways to achieve ur task.
    1.By checking for all alphabets.in this u need check all the alphabetic characters one by one.Refer the following
    http://www.shiningstar.net/articles/articles/javascript/javascriptvalidations.asp?ID=ROLLA
    http://www.shiningstar.net/articles/articles/javascript/checkNumeric.asp?ID=AW
    2.By using regular expressions.its very easy and a single line code.here u need to specify single expression for whole alphabets.Refer this
    http://aspzone.com/blogs/john/articles/173.aspx
    Regards,
    Naren

  • In BSP how to give the input field as mandatory?

    Hi friends,
    In BSP how to give the input field as mandatory?
    In BSP i want to validate the input field (example checking the material no is valid or not)
    if this material no doesnot exit means i want to pass error message.What is the code for that.
    Moosa

    hi
    try this
    in LAYOUT
    <htmlb:inputField id = "vname"  disabled = "False" value = "<%= v_visitor %>"/> <font color="red" size="2"><b><%= page->messages->assert_message( 'vname' ) %></b></font></td>
    in DO_HANDLE_EVENT
    in oninputprocessing
    CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
    IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
      DATA: event TYPE REF TO CL_HTMLB_EVENT.
      event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
      IF event->name = 'button' AND event->event_type = 'click'.
        DATA: button_event TYPE REF TO CL_HTMLB_EVENT_BUTTON.
        button_event ?= event.
      ENDIF.
        case event->id.
            when 'select'.
               if v_visitor = ''.
                 page->messages->add_message(
                 condition = 'vname'
                 message   = 'Visitor Name can not be blank'
                 severity  = page->messages->CO_SEVERITY_ERROR ).
              ELSE.
                    here u can write ur when ur field getting filled
            endif.
         endcase.
    endif.
    give marks if it is helpful
    thanks

  • Create SAP B1 Query with Optional User Input Fields

    Hi All... any help is greatly appreciated, I am new to this forum and hope to contribute in the near future once I become more of an expert with B1.
    I have a query I need to build that will search about 10 UDF's. The problem is, I don't know how to make the user input fields optional within the query. Currently, I have the following queries as testing searching 2 UDF"s:
    SELECT T0.[ItemCode], T0.[ItemName], T0.[OnHand] FROM OITM T0 WHERE T0.[U_Quality] = [%0] OR T0.[U_LengthFT] =[%1]
    This query works when leaving one of the user input fields blank. However, the values it provides are wrong because it is an OR statement which will show item codes with a certain quality OR a certain size.
    The following query is the same as above but switched the OR to AND:
    SELECT T0.[ItemCode], T0.[ItemName], T0.[OnHand] FROM OITM T0 WHERE T0.[U_Quality] = [%0] AND T0.[U_LengthFT] =[%1]
    This query provides me with the correct values but will not work if one of the user defined fields is not filled out.
    How do I go about getting the results I want and not having the user fill out all the UDF's for the query to execute properly?

    I think I figured it out
    SELECT T0.ItemCode, T0.ItemName, T0.OnHand
    FROM OITM T0
    WHERE (T0.U_Quality = '[%0]' OR '[$0]' = '0') AND (T0.U_LengthFT ='[%1]' OR '[%1]' = '0')
    SAP must be defaulting empty user input field values to "0"
    I tried the above query and it worked!!!
    Is there anything you can add if I am missing something?
    Thanks, Alec.

  • Search for recordsgreater than 45 days and between user input fields

    Hi,
    How can I query where the
    Status id '3' greater than 45 days from the setup_date. (which is the sysdate)
    select ppcontract from proj_track where status_id = '3' and SETUP_DATE >= ADD_months (sysdate, +1.5)
    Also, How can I put a search criteria to the query which selects the creation_date between the beginning date (user input field) and the end date (user input field)
    I guess it would be like this, but it doesn’t work
    and creation_date between :p12_start and :p12_end
    Thank you in advance. Rav
    Message was edited by:
    user486969

    Try out this.
    Where START_DATE = Trunc(Sysdate) - 45
    Assuming both input fields are text/varchar2 type,
    DT Between To_Date(BEGIN_DT,'MM-DD-YYYY) And To_Date(END_DT,'MM-DD-YYYY)

  • How to get User input in JTextField?

    How to get User input in JTextField? Can u anyone give me some code samples? thanks

    read the API!!!

  • How to map user-defined fields in XML communication on SRM site

    Hi All!
    We use the External sourcing scenario and we transfer requirements from ERP  in SRM through XI (PurchaseRequestERPSourcingRequest_In)
    We should transfer the user-defined fields, but we can not map it in SRM site.
    We have enhanced enterprise service in XI, have realized BADI PUR_SE_PRERPSOURCINGRQCO_ASYN on ERP site.
    I see the XML message with ours z-fields in tr.  SXI_MONITOR (into SRM), but I can not find it in BBP_PDISC.
    We try to use BADI BBP_SAPXML1_IN_BADI (there is no method for SC), and BADI /SAPSRM/BD_SOA_MAPPING (z-fields is empty)
    Someone can tell how to map user-defined field for SC?
    Thanks in advance
    Evgeny Ilchenko

    Hello, Julia
    We have found solution our problem
    We have enhanced standard service in a new enhancement name space and defined own enhancement elements in our namespaces. Then these enhancement elements refered to the SAP standard Enterprise Service.
    But In our new interfaces were different  XML namespaces
    When we have correct an error we could use the next BADI
    on ERP site: PUR_SE_PRERPSOURCINGRQCO_ASYN
    on SRM site: /SAPSRM/BD_SOA_MAPPING
    BR,
    Evgeny

  • How to validate user name and password in webdynpro.

    Dear All,
    Actually i have created login name and password in view, webdynpro and want to validate the user name and password but  i am not finding proper code to  how to validate user name and password.
    Pl do the needful help.
    Regards.
    Tazeer.
    Moderator Message: There is a seperate forum for WebDynpro. Please ask your question there.
    Edited by: kishan P on Oct 5, 2010 1:08 PM

    Hello, I don´t get you question. User authentication is ready out of the box in webdypro...
    Regards Otto

  • How to validate an text field item using javascript for numbers only.

    hi,
    how to validate an text field item using javascript for numbers only.please help me on this urgent
    please mail me solun if posible on [email protected]

    Hi,
    Page HTML header
    <script>
    function onlyNum(evt) {
      // Usage: onKeyPress="return onlyNum(event)"
      evt = (evt) ? evt : window.event;
      var charCode = (evt.which) ? evt.which : evt.keyCode;
      if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        var status = 'This field accepts numbers only!';
        alert(status);
        return false;
      var status = '';
      return true;
    </script>Item HTML Form Element Attributes
    onKeyPress="return onlyNum(event)"Br,Jari

  • How to take user input and place it in a variable

    All I want to know is how to copy user input from the message pop up and store in a local variable?
    Thanks.

    Hi
    Just take a look at thread's example
    http://forums.ni.com/t5/NI-TestStand/TestStand-Message-Popup/m-p/1792424/highlight/true#M35397
    The trick is done by Message-Popup PostExpression: Locals.strMyResponse = Step.Result.Response
    Hope this helps
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • How to get user input to keep in array in the form of int[]?

    I really want to know how to get user input to keep in an array. Or if it's impossible, can i use the value in "int" and transfer it to an array?

    What I understand is that you want to set an input from the user in an array of int.
    Here is how it work:
    1. Create a stream and a buffer to get and store the informations entered by the user:
    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    2. Set this input in a String:
    String input = stdin.readLine();
    3. Set this string in an int:
    int userInput = Integer.parseInt(input);
    4. Then you can put this int in the array.
    Warning this code throws IOExceptions and NumberFormatException ( when you try to set letters as int ). But you can catch them easily.

Maybe you are looking for

  • How can I include results of a subsequenc​e, which runs in a new thread, in the main sequence test report

    Hi! I', m working with TestStand Version 4.2.1. I have a main sequence, which calkls different subsequences. All these steps are properly reported. One of subsequences runs as "new thread". How can I include its results in common test report of the m

  • DrillDown and field order

    Hello, I have a dimension with several levels each one with a code field and a description field. When I drill from an high level to a lower one the bi give me the descritpion before the code... is there a way to tell in which order drill down fields

  • Weigh machine integration with sap b1

    Respected Sir,   can you give me detailed information about how we integrate weigh machine with SAP Business One. Is it possible? If it is possible then how ?please explain me each and everything. If it is possible then please forward me related link

  • Storage location on MRP-list

    Hi! I am trying to add Storage Location to the Purch.Requisition during a MRP-run. What prerequisites are necessary in order to achieve this? The business scenario is StockTransportOrders from Plant to Plant, where we want the storage location of the

  • Macbook Pro 13 In. Mid 2012 Repair?

    Hello, I purchased my Macbook Pro Mid 2012 in July of 2012. Over the years my Mac has somehow sustained some damage including, Dent on casing of screen, hinge cracking, and moderate scratching around the casing. I honestly cannot pin point how all of