How to compare two input fields
Hi i have two input filds with labels E mail and confirmmail
in both the input flds same value should be enter ,if data in second input field is different from first input field an error should be displayed,can u please expalin me with code
thanks
kishore
Hi,
use as follows
String emailId1 = wdContext.currentContextElement().getID1();
String emailId2 = wdContext.currentContextElement().getID2();
//remove the following condition if not needed ,
if( (emailId1 != null && !emailId1.trim().equals("")) && ( emailId2 != null && !emailId2.trim().equals("")))
int x = emailId1.compareTo(emailId2);
if( x == 0)
//Both are same
else
//Do the else part
Regards
Ayyapparaj
Similar Messages
-
How to Compare two Dates in java
How to Compare two Date Field after getting the values from jTextField1.getText() and jTextField2.getText().
Date d1=DateFormat.getDateInstance().parse(yourstring1);
same for d2
d1.compareTo(d2);
could be that i misrememberd the exact naems of some functions or mixed up something in the equence of d1= -
How can I compare two summary field in cross-tab?
<p>Dear expert:</p><p>I have one question for how can I compare two summary field in cross-tab? I have following cross-table:</p><p>Type Sector1 Sector2 Sector3 Total </p><p>Outlook 10 11 9 30 </p><p>Target 5 3 1 9</p><p>I want to compare the summary field(total) relationship percent, I want to get "9/30". Someone told me I must create the DB view or table via SQL, then can implete in Crystal Report. Can I implete it in Crystal Report via fomula or other function?</p><p>Thanks so much for your warm-hearted help!</p><p>Steven</p>
Hello Steven, yes you can compare summary fields, If you are comparing Summary to Target, or vice versa - you can do it within Crystal Reports.
1. In Suppress conditional formula, create 2 Global variables: CurrentOutlook and CurrentTarger and get the current value.
2. In Display String formula for Total show ToText(CurrentTarget/CurrentOUtlook) + "%".
For more difficult cases of compariing fields in cross--tab, you may look into http://www.relasoft.net/KB10001.html.
Best,
Alexander -
Hi
i used the Build JDEVADF_11.1.1.4.0
I want to make compare validation between two input text Are equal or not . same Thing when i create new email i must enter the password and re enter password if not equal he give me messageHi,
for a validation String, you can put autosubmit=true and in the valuechangeListener make the comparation.
How to compare two Strings in java? http://stackoverflow.com/questions/513832/how-do-i-compare-strings-in-java -
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
srinivasHi,
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 disable a input field in OVS search
Hi friends,
I have crated a OVS search help for matnr.
i have two input field like matnr and mat desc.. user can enter any value and hit SEARCH..
im getting results.
Now i want to hardoced a value of matnr = 001.. and make this field read only..
how can we do it..
i just took a example of matnr and mat desc. to make u understand easily...
kindly help.
NirajaHi Niraja,
You can initialize the value for MATNR in the phase 1 of the eventhandler method for OVS. Try refer the code segment below. Am initializing the values for MATNR & MAKTX fields in the lines:
ls_search_input-matnr = 'D*'.
ls_search_input-maktx = '*'.
* pass the values to the OVS component
ovs_callback_object->set_input_structure(
input = ls_search_input ).
Regards,
Uday
Below is the complete code from my eventhandler method:
method ON_OVS .
" declare data structures for the fields to be displayed and for the table columns of the selection list
types:
begin of lty_stru_input,
" add fields for the display of your search input here
matnr type string,
maktx type string,
end of lty_stru_input.
types:
begin of lty_stru_list,
" add fields for the selection list here
matnr type string,
maktx type string,
end of lty_stru_list.
data: ls_search_input type lty_stru_input,
lt_select_list type standard table of lty_stru_list,
ls_text type wdr_name_value,
lt_label_texts type wdr_name_value_list,
lt_column_texts type wdr_name_value_list,
lv_window_title type string,
lv_group_header type string,
lv_table_header type string.
field-symbols: <ls_query_params> type lty_stru_input,
<ls_selection> type lty_stru_list.
data: lv_matnr type mara-matnr,
lv_maktx type makt-maktx.
case ovs_callback_object->phase_indicator.
when if_wd_ovs=>co_phase_0. "configuration phase, may be omitted
" in this phase you have the possibility to define the texts, if you don't want to use the defaults (DDIC-texts)
ls_text-name = `MATNR`. "must match a field name of search
ls_text-value = `Material Number`. "wd_assist->get_text( `001` ).
insert ls_text into table lt_label_texts.
ls_text-name = `MAKTX`.
ls_text-value = `Material Description`.
insert ls_text into table lt_label_texts.
ls_text-name = `MATNR`. "must match a field in list structure
ls_text-value = `Col1 -> Material Number`. "wd_assist->get_text( `002` ).
insert ls_text into table lt_column_texts.
ls_text-name = `MAKTX`. "must match a field in list structure
ls_text-value = `Col2 -> Material Description`. "wd_assist->get_text( `002` ).
insert ls_text into table lt_column_texts.
ovs_callback_object->set_configuration(
label_texts = lt_label_texts
column_texts = lt_column_texts
group_header = lv_group_header
window_title = lv_window_title
table_header = lv_table_header
col_count = 2
row_count = 10 ).
when if_wd_ovs=>co_phase_1. "set search structure and defaults
" In this phase you can set the structure and default values of the search structure. If this phase is omitted, " the search fields will not be displayed, but the selection table is displayed directly.
" Read values of the original context (not necessary, but you may set these as the defaults). A reference to " the context element is available in the callback object.
ovs_callback_object->context_element->get_static_attributes
( importing static_attributes = ls_search_input ).
" Setting the default values to be displayed in the selection screen
ls_search_input-matnr = 'D*'.
ls_search_input-maktx = '*'.
" pass the values to the OVS component
ovs_callback_object->set_input_structure( input = ls_search_input ).
when if_wd_ovs=>co_phase_2.
" If phase 1 is implemented, use the field input for the selection of the table
" If phase 1 is omitted, use values from your own context.
assign ovs_callback_object->query_parameters->*
to <ls_query_params>.
lv_matnr = <ls_query_params>-matnr.
lv_maktx = <ls_query_params>-maktx.
replace all occurences of: '*' in lv_matnr with '%',
'*' in lv_maktx with '%'.
select a~matnr
b~maktx into corresponding fields of table lt_select_list up to 10 rows
from mara as a inner join
makt as b on a~matnr = b~matnr where
( a~matnr like lv_matnr and b~maktx like lv_maktx and b~spras = 'EN' ).
" call business logic for a table of possible values
" lt_select_list = ???
ovs_callback_object->set_output_table( output = lt_select_list ).
when if_wd_ovs=>co_phase_3.
" apply result
assign ovs_callback_object->selection->* to <ls_selection>.
if <ls_selection> is assigned.
ovs_callback_object->context_element->set_attribute(
name = `MATNR`
value = <ls_selection>-MATNR ).
concatenate 'Description from MAKT:'
<ls_selection>-MAKTX
into <ls_selection>-MAKTX separated by space.
ovs_callback_object->context_element->set_attribute(
name = `MAKTX`
value = <ls_selection>-MAKTX ).
endif.
endcase.
endmethod. -
How to compare two Objects !!!!
Hi All,
I know that this question has been asked 100 times till now. But trust me I have checked all of them but couldn`t find answer. Here is my question:
I have an objecs. In that object I am setting (Id,Name,DOJ). Now I want to check whether the object I am trying to save in database already exists or not. If exists then I need to check whether all the setters are same for the two objects. Now can anyone tell me ,how to compare two objects directly without comparing the setters individually.
Thanks in advance.pavan13 wrote:
That is pretty good idea. However I have a query. Does that code actually compare all the setters in a two beans. I don`t want to check each setter seperately.Well, it's pretty meaningless to talk about "comparing setters", setters are methods, they don't have values to compare. Because equals is inside the class, you can simply compare the fields that get set by the setters. "Properties" is probably a better name.
In principal you could write something that tried to find all relevant fields and compare them, using reflection or bean info stuff. The resulting code would be about 50 times longer and take about 50 times longer to run. It's hardly asking a lot to put three comparisons between && operators.
Remember, though, not to compare string fields with ==, you should call .equals on the string fields.
p.s. don't let the bean terminology confuse you. Beans are just ordinary objects which follow a few rules. Personally I wish the term had never been coined.
Edited by: malcolmmc on Dec 6, 2007 4:15 PM -
How to compare two different environments
Can any please tell me how to compare two environments like DEVL to TEST?
I know how to compare a project(like DEVL to TEST) but i want to see all the changes in all the objects between two different environments.
Please help me.
Thank you.That is really a good piece of information.
Does it really matter where we are comparing from?
i will explain,let us say we have DEV and TST environment.
let us say both has same project name and the same number of objects but inside the object they may be different(like number of fields in the same record in both environments).
Now we want to have a compare report between those environments.
We can do in two different ways, right?
(1. source DEV, Target TST)
(2. source TST, Target DEV)
will the result get changed in both the cases?
(except like following)
(first case souce target)
( absent *changed)
(second case would be like following)
( souce target)
( *changed absent)
(but i gess the number of rows in both the cases does not get changed)
let me know if you can not understand the question. sorry about the confusing explanation -
Hi all,
How to compare two IDoc's. If the both the IDocs are are of same type, i want to distinguish the data in those two IDocs.
Thank you in Advance
Regards
HarshaHi Harsha,
Transaction WE05 will help you out.You should first know some details like the
iDoc type, partner, the date/time and maybe the iDoc #. There can be many iDocs
generated/processed per day and without having some info to start with,
one will never find anything useful. Filter what you can, and then
navigate in the left hand frame/double click on the results lines in the
right hand frame to drill down. Eventually you will see the single iDoc
with all the many 'segments' available. Expand the 'data records'
branch (and sub-branches) to see each 'segment' and find the data fields
& values (these will appear in the lower right hand frame).
Reward points if helpful..
Regards,
Goutham. -
How to compare two dates to know which one is greater than oher?
how to compare two dates to know which one is greater than oher?
Please search before asking basic questions.
Edited by: Rob Burbank on Mar 27, 2009 9:26 AMHi,
If thse to date fields are of same type u can directly compare like this.
regards,
Bharat. -
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 compare two rows in PL/SQL?
Hi All,
How to compare two rows in PL/SQL? Is there any method that I can use instead of comparing them column by column?
Any feedback would be highly appreciated.PhoenixBai wrote:
Hi All,
How to compare two rows in PL/SQL? Is there any method that I can use instead of comparing them column by column?What "rows" are you referring to?
If you're talking of rows within a PL/SQL associative array there are techniques as described in the documentation... e.g.
SQL> ed
Wrote file afiedt.buf
1 declare
2 type v1 is table of number;
3 r1 v1 := v1(1,2,4);
4 r2 v1 := v1(1,2,3);
5 begin
6 if r1 MULTISET EXCEPT DISTINCT r2 = v1() then
7 dbms_output.put_line('Same');
8 else
9 dbms_output.put_line('Different');
10 end if;
11* end;
SQL> /
Different
PL/SQL procedure successfully completed.
SQL> ed
Wrote file afiedt.buf
1 declare
2 type v1 is table of number;
3 r1 v1 := v1(1,2,3);
4 r2 v1 := v1(1,2,3);
5 begin
6 if r1 MULTISET EXCEPT DISTINCT r2 = v1() then
7 dbms_output.put_line('Same');
8 else
9 dbms_output.put_line('Different');
10 end if;
11* end;
SQL> /
Same
PL/SQL procedure successfully completed.
SQL>If you're talking about rows on a table then you can use the MINUS set operator to find the rows that differ between two sets of data...
SQL> select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-1980 00:00:00 800 20
7499 ALLEN SALESMAN 7698 20-FEB-1981 00:00:00 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-1981 00:00:00 1250 500 30
7566 JONES MANAGER 7839 02-APR-1981 00:00:00 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-1981 00:00:00 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-1981 00:00:00 2850 30
7782 CLARK MANAGER 7839 09-JUN-1981 00:00:00 2450 10
7788 SCOTT ANALYST 7566 19-APR-1987 00:00:00 3000 20
7839 KING PRESIDENT 17-NOV-1981 00:00:00 5000 10
7844 TURNER SALESMAN 7698 08-SEP-1981 00:00:00 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-1987 00:00:00 1100 20
7900 JAMES CLERK 7698 03-DEC-1981 00:00:00 950 30
7902 FORD ANALYST 7566 03-DEC-1981 00:00:00 3000 20
7934 MILLER CLERK 7782 23-JAN-1982 00:00:00 1300 10
14 rows selected.
SQL> select * from emp2;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7521 WARD SALESMAN 7698 22-FEB-1981 00:00:00 1250 500 30
7566 JONES MANAGER 7839 02-APR-1981 00:00:00 2975 20
7782 CLARK MANAGER 7839 09-JUN-1981 00:00:00 2450 10
7788 SCOTT ANALYST 7566 19-APR-1987 00:00:00 3000 20
7839 KING PRESIDENT 17-NOV-1981 00:00:00 5000 10
7900 JAMES CLERK 7698 03-DEC-1981 00:00:00 950 30
7934 MILLER CLERK 7782 23-JAN-1982 00:00:00 1300 10
7 rows selected.
SQL> select * from emp
2 minus
3 select * from emp2;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-1980 00:00:00 800 20
7499 ALLEN SALESMAN 7698 20-FEB-1981 00:00:00 1600 300 30
7654 MARTIN SALESMAN 7698 28-SEP-1981 00:00:00 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-1981 00:00:00 2850 30
7844 TURNER SALESMAN 7698 08-SEP-1981 00:00:00 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-1987 00:00:00 1100 20
7902 FORD ANALYST 7566 03-DEC-1981 00:00:00 3000 20
7 rows selected.If you actually need to know what columns data is different on "non-matching" rows (based on your primary key) then you'll have to compare column by column. -
How to compare two files in java & uncommon text should print in text file.
Hi,
Can any one help me to write Core java program for this.
How to compare two files in java & uncommon text should print in other text file.
thanks
SamHi All,
i m comparing two HTML file.. thats why i am getting problem..
import java.io.BufferedReader;
import java.io.FileReader;
public class textmatch{
public static void main(String[] argv)
throws Exception{
BufferedReader fh =new BufferedReader(new FileReader("internal.html"),1024);
BufferedReader sh = new BufferedReader(new FileReader("external.html"),1024);
String s;
String y;
while ((s=fh.readLine())!=null)
if ( s.equals(y=sh.readLine()) ){
System.out.println(s + " " + y); //REMOVE THIS PRINTLN STATEMENT IF YOU JUST WANT TO SHOW THE SIMILARITIES
sh.close();
fh.close(); }
thanks
Sam -
How to compare two files in Java & uncommon text should print in Diff text
Hi All,
can any one help me to write a java program..
How to compare two files in Java & uncommon text should print in Diff text file..
Thanks
SamHi All,
i m comparing two HTML file.. thats why i am getting problem..
import java.io.BufferedReader;
import java.io.FileReader;
public class textmatch{
public static void main(String[] argv)
throws Exception{
BufferedReader fh =new BufferedReader(new FileReader("internal.html"),1024);
BufferedReader sh = new BufferedReader(new FileReader("external.html"),1024);
String s;
String y;
while ((s=fh.readLine())!=null)
if ( s.equals(y=sh.readLine()) ){
System.out.println(s + " " + y); //REMOVE THIS PRINTLN STATEMENT IF YOU JUST WANT TO SHOW THE SIMILARITIES
sh.close();
fh.close(); }
thanks
Sam -
How do we validate input fields on the selection screen
How do we validate input fields on the selection screen
hi balram,
u can validate input fields using <b>AT SELECTION-SCREEN</b> Event.
PARAMETERS : p_werks TYPE marc-werks.
AT SELECTION-SCREEN ON p_werks.
SELECT SINGLE *
FROM t001w
WHERE werks = p_werks.
IF sy-subrc <> 0.
MESSAGE 'Invalid Plant' TYPE 'I'.
ENDIF.
Like this, we can validate user input for plant.
check this link:
http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
Reware me if useful......
Harimanjesh AN
Maybe you are looking for
-
Firewire port does not always work to import movies from video camera
I've been having issues with my Mac Pro lately, it is an 06 model. Opening up iMovie and starting the import process for video from my Canon camera, the software will not recognize that the camera is connected. In system profile I do see that the cam
-
Hello Problem with my DCIM pictures files of my Iphone 4
Hello I have a problem with copying pictures taken with my Iphone 4 on my PC; since the change of IOS version apparently, the structure of the Iphone pictures files has been changed in the DCIM files. The subfiles are not anymore classified by dates
-
Visual Studio 2008 Crystal Report 10.5 merge modules download
Hi All, I'm struggling with this problem about 2 weeks and still cannot find the resolution. I was developed a .Net application with visual studio 2008 and using crystal report to generate report. It is working fine in my local machine. However, afte
-
Why when i type in my message on email does it all not stay in window just on 1 line
why when i type in my message on email does it all not stay in window just on 1 line
-
RV120W VPN Setup - basic help needed
Hi all, I've recently bought a RV 120W Wireless-N VPN Firewall hoping it would ease me in creating VPN and remote connectivity. But I seems to be struggling with this. Here is my situation. When I bought my Cisco router I didn't know it had an ethern