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
Similar Messages
-
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.
Moosahi
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 -
How to validate the mandatory fields in the view in WDA?
Dear experts,
Iam new to WDA. i just want to know how to validate the mandatory fields in the view in WDA?please refer any documents for validating the mandatory fields.
Regards,
murthy.
Edited by: Murthy Ganti on Jul 13, 2009 2:31 PMHi,
Firstly goto view->select the element that you want to make mandatory and set the State property to required.
Secondly place the below code in the WDDOBEFOREACTION
DATA: l_view_controller TYPE REF TO if_wd_view_controller.
* Get view controller
l_view_controller = wd_this->wd_get_api( ).
* Check for mandatory attribute
cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
EXPORTING view_controller = l_view_controller
display_messages = abap_true
Regards,
Radhika. -
How to Validate the Text Field in JSF
Hi,
I am facing a issue to validate the text field where the below code accepts (space' ',underscore'_',pipe'|') symbol as a first character and last character.Where by it can accept in the middle.
It should not accept special characters also. Below code is working properly for special characters.
<tr>
<td width="30%" align="right"><b><h:outputText id="aAccrualType" value="Accrual Type" /> </b> <span style="color:red">*</span></td>
<td width="50%">: <h:inputText id="accrualType" value="#{accrualTypeMast.accrualType}" required="true" >
<t:validateRegExpr pattern="^[(a-z)||(A-Z)||(0-9)||(_)||(\s)||(/)]+$" />
<f:validateLength minimum="1" maximum="50"/>
</h:inputText>
<h:message for="accrualType" showDetail="true" style="color:red" />
</td>
</tr>
The thing is i dont have much knowledge in regular expression.
Is there any other way to do this.
Could anyone help me in this.
Thanks,
Ambika☺This has nothing to do with JSF.
I suggest you to read the Pattern API documentation [1]. You can easily create a small Java Application and test the regexp using String#matches() as it uses the same regexp guidelines.
public static void main(String[] args) {
String regexp = "^[a-z]+$";
String value = "foo";
boolean match = value.matches(regexp);
System.out.println(value + " matches " + regexp + ": " + match);
}[1] http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html -
How to keep the input field from PDF Form to RTF
Hi,
I'm looking to keep the input fields from my pdf form document to Rtf so I can use them in my Rtf document.
Regards,
AlanGood day Alan,
I'm afraid that's not possible as form fields in a PDF file have no equivalent either in a Word format (.docx/.doc) or within the Rich Text Format (.rtf). That data is simply stripped during the conversion as there's no equivalent available.
Kind regards,
David
Acrobat Community Manager
Adobe Systems -
How to change the input field's color in SE51
Hi:
I need to change the color of input fields in module pool.
I tried to modify its screen-color but it did not work.
Need your suggestion.
Regards
Shashihi,
Check this similar thread
Regarding the input field color
thanks -
How to make the input field of an uplaod button to readonly
Hi all,
I have to upload an excel file using upload button.But the problem here is i want the user to use only browse button to upload a file..but he should not enter mannulally in the input field.Is it possible to gray out the input filed but the browse button should be in active state.
Regards
Padma NHi,
I dont think you can make the readonly only for the inputfield which is part of the FileUpload UI.
I guess your issue is related with user entering invalid urls and system hangs.
Regards
Ayyapparaj -
How to read the input field value into ABAP variable?
Hi All,
i need a read the value of an input field into an ABAP variable,and i am doing this in the following way
lstring = request->get_form_field('myFlag').
here 'myFlag' is the input field name,but this is not returning me any value into lstring.
I have gone through the SDN and tried to do this.
could you please help me out to resolve this issue.
Thanks in Advance,
PraveenaDear Praveena
In which event are you putting this code. Place it in oninputprocessing event(Page with flow logic Model of coding). Then it will surely work.
Regards
Vijay.M -
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 -
when I click on search button, I get the search result, but along with those results, I see some input fields automatically assigned the values in the search input, which should not be.
values are assigned to these fields because of controller context field values, once the values are populated these values are assigned everywhere where istle feild referring to.
How to keep the user input without changes?
Thanks!Naveen,
You set contradictory requirements: on one hand you have mapping, where values are always synchronized; on other hand you whant them to be unique.
Just break your existing mappings.
1. Create separate attributes in view context(s) if you do not need to access them in component controller or you do not need to be synchronized between views.
2. Create unique set of attributes in component controller for combination of attributes that really must be synchronized. Then map view context attributes accordingly.
VS -
How to validate the input parameters in Oracle BI Publisher reports
Hi
i am new to Oracle BI Publisher
I am using OBI for generating simple reports.
here i need validation for input parameters (Date Parameter) and also want to disable the Date filed so that user can select through the calendar component.
Here validation in the sense, the system must validate the date and alert the user with an appropriate message
Can anyone please provide me the solution in detail.
Thanks in advance
Edited by: user10185520 on Aug 26, 2008 6:15 AMI have the same task to validate input parameters with Oracle BI Publisher 5.6.3 running under Oracle eBS 10.5.10.2. My validation goes beyond of what I can do during parameter registration. I am using Data Templates.
My first logical place was the before report trigger. So, I built a report trigger which returns 'false' in case the parameters are not proper. Guess what... XMLP just returns a hard-coded message
!!Error : trigger '" + datatrigger.getName() + "' returns status as 'false'
First of all, this is a bad style to hardcode messages visible by the user (especially during French implementation). Second of all, it is not informative at all. It would be nice to change oracle.apps.xdo.dataengine.XMLPGEN.executeTrigger() to read, for example, a message from the message stack when the trigger returns 'false' and let the user read it.
Anyway, what I did was I built a special data group, decalred before any other data group, query like
select my_package.my_validation fro dual
If parameters fail the validation my PL/SQL package throws an application exception with a message. At least, in this case the error message gets available as the description of the concurrent request.
I wish the before report trigger worked!!! -
How to validate the incoming field value and raise an alert message
Dear all,
I have the following structure
If incoming value for the field externalid is empty then i have to raise a alert message to end user "externalid field is empty for the id : id number" and for all incoming values it should work. I used the following udf on field externalid with two arguments
if(externalid.equals(""))
throw new RuntimeException("externalid field empty for the following id : " +id);
else
return externalid;
This is working fine for single record. But for many records(multiple occurences), this logic is not working as if records 2 and 3 fails it is showing exception externalid field is empty for the id : record 2.
how to achieve the tranformation logic ?
Regards
Koti ReddyHi Amit,
I have tried the above udf, but still stuck-up.
For the above structure shown in image, i have tested giving the following payload
<?xml version="1.0" encoding="UTF-8"?>
<ns0:upsertRequest xmlns:ns0="http://sap.com/xi/SFIHCM01">
<sessionId/>
<upsert>
<type/>
<sfobject>
<id>1</id>
<businessKeys>1</businessKeys>
<type>1</type>
<status>1</status>
<externalId>1</externalId>
<username>1</username>
<firstName>1</firstName>
<lastName>1</lastName>
<mi>1</mi>
<gender>1</gender>
<email>1</email>
<managerExternalId>1</managerExternalId>
<hrExternalId>1</hrExternalId>
<department/>
<jobCode/>
<division/>
<location/>
<timeZone>1</timeZone>
<hireDate/>
<empId/>
<title/>
<businessPhone/>
<fax/>
<addressLine1/>
<addressLine2/>
<city/>
<state/>
<country/>
<zipCode/>
<reviewFreq/>
<lastReviewDate/>
<matrixManagerExternalIds/>
<defaultLocale/>
<customManagerExternalIds/>
<secondManagerExternalId/>
<loginMethod/>
<proxy/>
</sfobject>
<sfobject>
<id>2</id>
<businessKeys>2</businessKeys>
<type>2</type>
<status>2</status>
<externalId>2</externalId>
<username>2</username>
<firstName>2</firstName>
<lastName>2</lastName>
<mi>2</mi>
<gender>2</gender>
<email>2</email>
<managerExternalId>2</managerExternalId>
<hrExternalId/>
<department/>
<jobCode/>
<division/>
<location/>
<timeZone/>
<hireDate/>
<empId/>
<title/>
<businessPhone/>
<fax/>
<addressLine1/>
<addressLine2/>
<city/>
<state/>
<country/>
<zipCode/>
<reviewFreq/>
<lastReviewDate/>
<matrixManagerExternalIds/>
<defaultLocale/>
<customManagerExternalIds/>
<secondManagerExternalId/>
<loginMethod/>
<proxy/>
</sfobject>
<processingParam>
<name/>
<value/>
</processingParam>
</upsert>
</ns0:upsertRequest>
No node is creating for success records, instead it throws exception that "externalid field is missing for the id": id for empty externalid field value in second record.
But my requirement is..... when i process 50 records, records with missing value for field externalid should raise an alert message to end user intimating him to check the externalid field for particular id. If the value for externalid field is present in incoming record/payload, then it should be passed to target system.
How can i implement this logic ?
Regards
Koti Reddy -
How to disable the input fields and labels.
Hi,
I have a requirement, when i click on button all the fields and labels in the form will be disable .Hi,
You code wizard, in popup select set radio button and select the attribute and click on Ok, It will generate code automatically. Else find the below code
DATA lo_el_context TYPE REF TO if_wd_context_element.
lo_el_context = wd_context->get_element( ).
CALL METHOD lo_el_context->set_attribute
EXPORTING
name = `DISABLE` " Here disable is the name of attribute which u created in context of type wdy_boolean
value = 'X' .
Hope this helps u.,
Thanks & Regards,
Kiran. -
How to validate the field when i am populating the data cursor to block
Hi,
I am populating data cursor to multi record block.
Block contain 5 items. I am populating data cursor to block for 4 items. User will enter one item value that is quantity field.
If user enter negative values and decimal points in quantity filed i need to display message to user item level.
Please do the needful how to do it.902434 wrote:
Hi,
I am populating data cursor to multi record block.
Block contain 5 items. I am populating data cursor to block for 4 items. User will enter one item value that is quantity field.
If user enter negative values and decimal points in quantity filed i need to display message to user item level.
Please do the needful how to do it.If you want to validate at entry level then use When-Validate-Item trigger and check the input and show message. Like
If :quentity <0 then
message('do not enter negative value');
message('do not enter negative value');
raise form_trigger_failure;
end if;Why u open same thread again ? not closing one.. check this one
</a>
How to validate the field when i am populating the data cursor to block
Hopes this helps
If someone's response is helpful or correct, please mark it accordingly.
Maybe you are looking for
-
ok guys i need help anyone with my ipod it froze during an update now it will not work at all i ahve put it into the recovery mode or dfu and it will not reset it self it comes up with an error message 1603 the number is and says the ipod cannot be
-
Oversized text and lack of pages when placing a word document (.docx)
I'm reposting this, since the last one seemed to get lost in the jumble: When placing text from a word document (.docx) indesign only gives me three pages for a 118 long document. Also, those pages are blank, and to access the text, I have to delete
-
Java error importing class on report
Hi friends: I build a java program to save blob files into oracle database table. The program compile and execute fine in JDeveloper 10g. I get the class file and put in temporal directory and now I am trying to import these class file with Reports B
-
TS1398 I can't connect my iPhone 5 to my WIFI.
I bought my iPhone 5 32Gb from the Apple Store in Hong Kong and had it shipped to the Philippines where I currently reside. I've read some issues regarding the iPhone 5 not being able to connect to the internet and having a very weak wifi range. I've
-
Help getting mail for exchange to work against a S...
We are trying to set up mail for exchange on a nokia e66 phone, but we cant get it to connect. I have followed this guide: http://europe.nokia.com/support/product-support/nokia-e66/email/mail-for-exchange But on picture 15 and 16 i unsure what to pu