Numeric Value Check
Sir,
I have a screen field name Moistue type numeric.
I want that moisture should be entered in the range of 8 & 25 otherwise error message
and cursor on moisture.
thanks
rajeev
Search before posting any Question, Read and Check the ABAPDOCU for simple and basic validation.
Use F1 help always.
Thread Locked for Posting
Edited by: Vijay Babu Dudla on Apr 25, 2009 1:20 AM
Hi Rajeev,
You can do this in AT SELECTION-SCREEN ON FIELD event of selection screen events.
Similar Messages
-
How to check non-numeric value in a field
Hi all,
I have a field 'MVALUE'. HOw can I check if I have a non-numeric value in my field. Let us say if I have a value '<25' in this field. How can I check if the value in this field is non-numeric. The field MVALUE is of CHAR datatype.
Please help. Waiting.........Might have to add a space in the string...
if not mvalue co ' 0123456789'.
* error
endif.
if you allow decimals and commas...
if not mvalue co ' .,0123456789'.
* error
endif. -
How to check whether a field contains at least one numeric value
how to check whether a field contains at least one numeric value..
Hi,
I hope that this code will works.
constants:
c_digit_grp TYPE char11 VALUE '0123456789', " Digit group
* Data Declaration
data :
str type string.
* if you want check entire string and pass entire string
if str CA c_digit_grp.
* write your logic ---this block will execute atleast one numeric value exists in the string
Endif.
Regards
Bhupal Reddy -
Validation To check numeric value
BEGIN
IF :P3_TOTAL_AMOUNT >= :P3_NET_AMOUNT THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;
The function returning boolean should compare total amount and net amount and through error if it less than net amount.
It works fine when the value of TOTAL amoun =365 and value of net amount = 364*(if it is all numeric value and no zero behind it)*
But the problem is
when is use Total amount = 9 and net amount = 100 (It doesnt works becuse it just takes 1 from the net amount and eliminates the zeros behind the 1(100) and it doesnt comes up with a error after validation )
Is there any one who can help me with this
Thanks,
HaryLev,
I'm not sure I follow. If you use to_number with a format mask and the user doesn't follow your mask, you'll get an error:select to_number('1000','999G990') from dual;This throws an "ORA-01722: invalid number" exception. That's why I say to try calling to_number without a format mask first, to handle the trivial case of the user not putting in the grouping separators (or whatever else is involved in your format).
You could, of course, put in a validation to make sure that the number follows the format you're expecting before you convert it (either for further validation, as in the original post, or for processing), but then you have multiple places where the format mask is specified--not to mention the annoyance for users when they put in a number only to be told that they need to use the appropriate grouping separators as well. My solution uses the data dictionary to get the format mask assigned to the page item and feeds that to to_number; if I change the page item's format mask, all of my processes automatically handle the new format. Because of the extra lookup, it's slightly slower than hard-coding the format mask, but that should be minimal as long as you don't use it in a where clause.
-David -
Looking for help with javascript to autofill checkboxes based on a numeric value.
I have a numeric field that I would like to have 1 - checkbox
out of five autofilled based on a numeric value.
For instance the numeric value is TotalPoints
If the TotalPoints Value is >10 autofill this checkbox
If the TotalPoints Value is 10 - 19 autofill this checkbox
If the TotalPoints Value is 20 - 49 autofill this checkbox
If the TotalPoints Value is 50 - 69 autofill this checkbox
If the TotalPoints Value is 70+ autofill this checkbox
Assistance in writing the correct script for this would be greatly appreciated.All the checkboxes have separate names.
Check box #1 is AssetClass.0 with the export value of 1
Check box #2 is AssetClass.1 with the export value of 2
Check box #3 is AssetClass.2 with the export value of 3
Check box #4 is AssetClass.3 with the export value of 4
Check box #5 is AssetClass.4 with the export value of 5
Score and StrategyUse the following calculation to determine your point score and indentify the appropriate strategy listed below.A. Add your points for questions 1 – 2.
B. Add your points for questions 3 – 12.
C. Subtract B from A. (Numeric Text Box) name is TotalPoints
Points Strategy Asset Class Mix (check boxes as named above)
0 – 10 Primarily Fixed Income: 80% Fixed Income; 20% Equity
10 – 19 Balanced Fixed Income-Oriented: 60% Fixed Income; 40% Equity
20 – 49 Balanced Equity-Oriented: 40% Fixed Income; 60% Equity
50 – 69 Primarily Equity: 20% Fixed Income; 80% Equity
70+ Equity: 95%; 5% Cash -
XDOFX if-then-else command testing of space and numeric value
Hi,
I have the following xdofx statement in a RTF template to display the value of one variable or another, depending on the value it contains: (the variable can contains both space or null or a numeric value).
<?xdofx: If Amount_1 = " then 'display amount_2' else If Amount_1 = 0 then 'display amount_2' else 'display Amount_1' end if?>
Result: When Amount_1 variable contains space or null value, then this If-then-else statement works. But When Amount_1 contains a number such as 0, it gives error "SBL-OMS-00203" (when it's checked against [=" ] in If condition). What's causing this? Is XDOFX being confused to test a variable that supposedly a character string (default by testing against [ =" ]), but find a number in the variable?
Any work around solution? (So [=" ] and [=0 ] can both be specified against a variable in an if-then-else statement in XDOFX).
Thanks a lot.
A.try
<?xdofx:if (Amount_1 =’’) then ‘display amount_2’ else if (Amount_1 =’0’) then ‘display amount_2’ else ‘display Amount_1’ end if?>or
<?xdofx:if (Amount_1 =’’) then ‘display amount_2’ else if (to_number(Amount_1) =0) then ‘display amount_2’ else ‘display Amount_1’ end if?> -
Error message - BSEG-WRBTR enter a numeric value
Hi,
I am having a problem with loading data using a abap program that calls RFBIBL00 program and the fb01 Transaction. The process is that the user enters the data in a excel sheet, saves as a tab deliminted txt file. The abap program reads the txt file, does some processing and submits the RFBIBL00 program with the FB01 code. When I check in SM35, it shows on the "incorrect " tab. When you display the log for the process, It is displaying "Formatting error in the field BSEG-WRBTR; see next message" and "Enter a numeric value". I am not sure where to start looking to try to correct this problem. I am tracing the abap program that submits the RFBIBL00 process and I am not finding where this is occuring. I am new to the ABAP world and I am having a hard time figuring this out. Can someone please let me know if I am proceeding in the right direction or if there is another way of solving this. I am not sure what program is generating the above error messages. If there is more information that is needed, please let me know and I will try to get it for you.
thanks in advance for the help on thisHi,
There may be two possiblities for this issue.
1. Incorrect data passed to the field BSEG-WRBTR
2. Check the Decemial Notation(Menu Path->System->status->Own profile and Defaults Tab). If it is diffrent with the entered amount format, then it will trigger error.
YOu can run the Bach in the fouground by choosing fouground radio button option in the Pop up.
Thanks,
Ramakrishna -
SAP-R/3- In which table, numeric values stored in equipment characteristis
SAP-R/3- In which table, numeric values stored in equipment characteristis are captured.
In AUSP table Char values in equipment characteristics are captured against object number.But this table does not cappture numeric characteristics.
Are these numeric values captured in any function module?Hi
check the BAPI for characteristics
BAPI_OBJCL_GETDETAIL
BAPI_OBJCL_CHANGE
or use the fun module:
CLAF_CLASSIFICATION_OF_OBJECTS.
You can use the tables
CAWN,INOB and AUSP to get the characteristics
Regards
Anji -
Numeric value out of range (null) - Inserting a double
Allright,
I can't figure this out to save my life.. I am refusing to put my code up because I am trying to insert into a DB Table with 140 some fields, so I will explain as best I can.. I am trying to insert a double into my DB.. I have been getting a numeric value out of range error on insertion. Just to see if it was a db problem, I shortened my query to 4 fields and two of them being the doubles for insertion. They inserted fine. So needless to say, i presumed that my insert statement for the 140 fields query was off. I double checked it and everything seems to be in order. I still get the error. I can assure that everything matches up.. my SQL string looks like this :
SQL = "INSERT INTO TABLE 1 (VAL1, VAL2, VAL3 ... VAL146) VALUES (?, ?, ? .... ?);
and my preparedStmt :
ps = con.prepareStatement(SQL);
ps.setInt(1, val1);
ps.setInt(2, val2);
ps.setString(3, val3);
ps.setDouble146, val146);
ps.executeUpdate();
Please help me solve this..
EdThe name of the table is FAC.
Here is the query:
INSERT INTO FAC (FAC_SK, KEY, ACTIVITY, BE_NUMBER,CATEGORY, CC, CLASS_LVL, CONDITION, COORD_BASIS, COORD_DATUM, COORD_DERIV,DOMAIN_LVL, EVAL, GRAPHIC_CC, GRAPHIC_ED_NUM, GRAPHIC_SCALE, GRAPHIC_SERIES,LAST_CHG_USERID, MIDB_TIMESTAMP, OPER_STATUS, OSUFFIX, PROD_LVL_CAP,PROD_LVL_REQ, RECORD_STATUS, RES_PROD, COORD, DATETIME_CREATED,DATETIME_LAST_CHG, FAC_NAME, GRAPHIC_AGENCY, GRAPHIC_ED_DATE,GRAPHIC_SHEET, REVIEW_DATE, ACCESS, AFFILIATION, AIR_DEF_AREA,ALLEGIANCE, BE, CAPACITY, CAPACITY_EVAL, CAPACITY_MAX, CAPACITY_UM,CLASS_RATING, CMD_CNTL_COMM, CODEWORD, CONDITION_AVAIL, CONTROL_MARK,COORD_DERIV_ACC, COORD_DERIV_ACC_UM, COORD_ROA, COORD_ROA_CONF_LVL,COORD_ROA_UM, CPFL, CRITICAL_INDUSTRY, DECLASS_ON, DEGREE_INTEREST,ELEVATION, LAT, LON, ELEVATION_ACC, ELEVATION_CONF_LVL, ELEVATION_DATUM,ELEVATION_DERIV, ELEVATION_DERIV_ACC, ELEVATION_DERIV_ACC_UM, ELEVATION_MSL,ELEVATION_MSL_ACC, ELEVATION_MSL_CONF_LVL, ELEVATION_MSL_DERIV, ELEVATION_MSL_DERIV_ACC,ELEVATION_MSL_DERIV_ACC_UM, ELEVATION_MSL_UM, ELEVATION_UM, FOREIGN_TECH_CC,FOREIGN_TECH_PERCENT, FPA, FUNCT_PRIMARY, FUNCT_SECONDARY, GEOIDAL_MSL_SEPARATION,GEOIDAL_MSL_SEPARATION_UM, ILAT, ILON, INTEGRATION, LINE_QTY, MED_DIAGNOSTICS,MED_MASS_CASUALTY, MIL_AREA, MIL_GRID_SYS, MODERNIZATION, MSN_PRIMARY, MSN_PRIMARY_SPECIALTY,MSN_SECONDARY, MSN_SECONDARY_SPECIALTY, OPEN_STG_COVERED, OPEN_STG_FILLED, OPEN_STG_TOTAL,OPEN_STG_UM, OUTPUT, OUTPUT_EVAL, OUTPUT_MAX, OUTPUT_RATE, OUTPUT_UM, PERIODICITY, PIN,POL_SUBDIV, POP_AREA, POP_AREA_PROXIMITY, POWER_DISTRICT, POWER_DISTRICT_SUB, POWER_SOURCE,RECUP_INTRVL, RECUP_INTRVL_MAX, RECUP_INTRVL_UM, RECUP_LOSS_IMPACT, RECUP_REPAIR_PRIORITY,RELATIVE_RANKING, RELEASE_MARK, ROLE_LVL, ROLE_TYPE, SCALE, TDI, TGT_RESTR, TURN_AROUND_TIME,WAC, WATERBODY, ADDRESS_NAME, CAPACITY_DATE, CAPACITY_EVAL_DATE, COORD_DATETIME,DATETIME_BEGIN, DATETIME_END, DATETIME_FIRST_INFO, DATETIME_LAST_INFO, DECLASS_ON_DATE,LOC_NAME, MAX_DEMO_USE, MIL_GRID, OUTPUT_DATE, OUTPUT_EVAL_DATE, PLACE_NAME, POSTAL_CODE,SCENARIO_SET, STREET_NAME, STREET_NUM, SYMBOL_CODE, UTM) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
The query works fine if I have no value for the two doubles : LAT and LON..
If I have a value for them, the thing gives me an error:
Numeric value out of range (null)
If you see anything wrong with that query.. Let me know..
Takizzle -
Numeric value variable problem with user exit
Dear experts,
I've created a variable (numeric value, user exit) and I want to get the value of variable from an user exit.
Actually, I want to convert "0calyear" to a number to be albe to calculate (multiplying, dividing etc).
If there is a possible solution only in FOX, the solution will be the best. However I couldn't find anything.
So, the next solution I am trying is user-exit. But I am in stuck here.
The problem is that I have no idea whether the numeric value variable has any sturcture like other variables(char. value) or not. If yes, what structure it has?
I know, the characterisc value variables have the structure as blow,
ls_varsel-chanm =
ls_varsel-seqno =
ls_varsel-sign =
ls_varsel-opt =
ls_varsel-low =
I've tried several times with the same way like above, but it doesn't work when I call the variable in "BPS0" or "UPSPL".
How can I solve it? Please let me know.
I am using SEM_BW 4.00.
Many Thanks.
BruceHi Ravi,
Sorry, there's a correction. <b>var2 is used for getting the first month of the year selected by the user in var1</b>. If the user doesn't enter a value for var1, then var2 should take first month of current year from var1 which has by default last month of current year (populated in i_step1 from sy-datum). The user can select the value of var1 according to his requirement. Then var 2 should get first month of the year selected. That's why I'm using two exit variables.
It works fine during the initial run of the query. But when the user clicks on the variable button in the toolbar and executes the query, var1 is not being displayed and an error message <i>No value could be determined for var2</i> is shown. All other variables used in the query are displayed except var1.
Krzys, Is the option <i>Can be changed in Query Navigation</i> available for Exit variables. I'll check that and get back to you.
Boujema, Thanks for the OSS note.
Thanks
Hari -
Limiting entry in a JTextField to numeric value and "%" value
Hi,
I want to allow the user to enter numeric value and % value
How can I limit the user to make such a entry in JTextFieldUse the code given below to make your textfield accept only numeric values. You can modify itto include % values too.
textField.setDocument( new TextFieldVerifier() );
class TextFieldVerifier extends PlainDocument {
public void insertString( int offset, String str, AttributeSet attSet ) throws BadLocationException {
boolean valid = false;
if ( str == null ) {
return;
String old = getText( 0, getLength() );
/* insert the new string at the given offset, into the old string */
String newStr = old.substring( 0, offset ) + str + old.substring( offset );
try {
/* check if the new string is a valid integer */
Integer.parseInt( newStr );
valid = true;
} catch ( NumberFormatException ne ) {
/* invalid, if not an integer */
valid = false;
Toolkit.getDefaultToolkit().beep();
if ( valid ) {
super.insertString( offset, str, attSet );
} -
Function module to validate numeric values
Hi all.
Can some one please tell me Is there any Function Module to validate only numeric values?
Like in year variable, it can never contain alphanumeric values or special symbols?
Is there any function module to check, wheather the variable contains only numeric values, no alphanumeric value or special symbol?
If there is no as such function module then what is the alternative approach we can take?
Plz help me .
Regards
DipankarFunction Module NUMERIC_CHECK for Editing and checking numeric fields ( i.e. Num validations)
Check using the Function Module "NUMERIC_CHECK".
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
STRING_IN = X
IMPORTING
STRING_OUT = X
HTYPE = H_TYPE.
if h_type = 'CHAR'.
WRITE:/ 'Not Numeric'.
else.
write:/ 'Numeric'.
ENDIF.
REWARDS IF USEFUL
GAURAV J.
Edited by: GAURAV on Feb 3, 2008 2:19 PM -
Numeric Value rounding problems in Materialized Views
All numeric values are getting rounded in the materialized views. Is there any solution for this?
Any help is greatly appreciated...
Thanks,
SatyaHi Bill,
Actually the problem is with the Toad version I'm using, it is not interpreting the decimal values of MVs properly. They look good when I checked in SQLPLUS.
Any way, thanks for your response.
-Satya -
Hello,
is ist possible to check if a column/row contains a numeric value?
Type= varchar2(30)
thanks
PhilIn a case of formating number value...this function will work (look for formating type...and modify to your need):
FUNCTION is_number_fmt (
char_in VARCHAR2
) RETURN BOOLEAN
IS
n NUMBER;
BEGIN
IF LENGTH (char_in) > 0 THEN
n := TO_NUMBER(char_in,'999G999G999G999G990D00',' NLS_NUMERIC_CHARACTERS = '',.''');
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END is_number_fmt;Checking code:
begin
if is_number_fmt('1.234,98') THEN
dbms_output.put_line ('OK');
ELSE
dbms_output.put_line ('BAD');
END IF;
END;I was working on several migration projects and it is not that easy to check numbers... -
Hi All,
We are facing a situation for one of our clients.
They are inputting some numeric value in the ADDITIONAL TEXT FIELD (Field name: MASCHINE) , while doing the result recording in quality management activities. On further saving after doing the result recording activities. This numeric value is getting disappeared from this field. This numeric value is required for customized report which they are using. On some investigation we checked that this value was getting saved in the QASR-MASCHINE TABLE. Now the client is looking for a explanation that why this disappearance is occurring.
Regards
vivek.
Maybe you are looking for
-
How do I play all tracks on an album sequentially on iPod nano 6th generation ?
I have an ipod nano 6th generation. I want to play all tracks on an album sequentially (as if I was playing a CD) without having to select each one in turn. On my ipod nano it repeats the same song and wont move to the next one automatically. can any
-
An adapter for connecting a 2.5 GHz dual-core Mac Mini to a VGA CRT monitor?
This question concerns the 2.5 GHz dual-core Mac Mini from Mid 2011 (Intel Core i5-2520M) (Macmini5,2). Is there an adapter for connecting it to a VGA CRT monitor?
-
JEditorPane can't display certain
I'm trying to get certain unicode characters like "\u1200" to display in a JEditorPane that I've set up to display text/html but all I see is a box like character "[]". What should I do? Set font doesn't work. I don't know what else to try.
-
Material related condition types
hello mm gurus, I have created a material and I want to maintain condition records for that material through MEK1 but there are so many condition types. I want to maintain the condition types which are related to material please explain me briefly th
-
hi all, can anyone plz provide any good material for Oracle 10g DS, any link to documentation or toturial will be worth helping... am unable to locate good material for Oracle 9i/10g Forms on net. thanx in advance Xaaf